PetrCala / artma

Automatic Replication Tools for Meta-Analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic Replication Tools for Meta-Analysis

Table of Contents

How to run

Prerequisites

  • Install node, Python, R, Podman (or Docker),
  • Set up podman or Set up Docker
  • Install podman-compose using brew install podman-compose

Steps

  • Initialize the podman using podman machine start.
  • Run npm run start:dev. This will build all necessary images, and start up relevant containers in a development environment. For production environment, execute npm run start:prod instead.
  • Individual parts of the application can be accessed from your browser or from the terminal under these domains:
    • React application: 127.0.0.1:3000
    • Flask application: 127.0.0.1:8080
    • R: 127.0.0.1:8787

Notes

  • You can check that the containers are up and running by calling podman ps -a from another terminal instance.
  • Upon pressing Ctrl+C in the terminal instance where the start:dev command was executed, all of the running containers will be gracefully shut down and deleted.
  • Any images built during the process will remain present. You can check the list of these images by running podman images. Remove these using podman rmi [image-name], or podman rmi -a, which will remove all images.
  • You can also access any of the containers by using localhost as the host name, such as localhost:3000 for the React application.

Handling images containers

Scripts

There are several pre-defined node scripts which should help you work with images and containers. All of these can be executed using npm run [script-name]Here is a list of some of them:

  • images:build: Builds the Docker images only if they don't already exist.
  • images:rebuild: Forces the rebuild of all Docker images.
  • images:rebuild-<image-tag>: Force the rebuild of a single Docker image (specified by <image-tag>). E.g., bun run images:rebuild-react rebuilds the React image.
  • images:rename: Renames all existing images to match the current project version.
  • start:dev: Builds any missing images and starts up all containers in a development environment. Upon Ctrl+C, all of the containers will be gracefully shut down and deleted.
  • start:prod: Very similar to start:dev, but builds and starts the containers in a production environment.
  • stop: Stops and removes all existing containers.

Useful notes

  • Remove empty images

    podman images --format "{{.ID}}: {{.Repository}}:{{.Tag}}" | grep '<none>' | awk -F: '{print $1}' | xargs -I {} podman rmi {}
  • Get logs of a container that is running in a detached mode

    podman logs -f <container-name>

Technical choices

Front-end

  • React with Next.js

Back end

  • Flask
  • R API endpoint through Plumber

CI/CD

  • Containers using Podman (or Docker)

Useful resources

About

Automatic Replication Tools for Meta-Analysis

License:GNU Affero General Public License v3.0


Languages

Language:Shell 43.7%Language:TypeScript 25.6%Language:Python 16.5%Language:Dockerfile 7.8%Language:R 3.7%Language:CSS 2.0%Language:JavaScript 0.7%Language:Rebol 0.1%