bl1231 / bilbomd-backend

Backend server for bilbomd-ui
1 stars 0 forks source link
bilbomd saxs webapp

bilbomd-backend

Provides backend support for bilbomd-ui

Description

bilbomd-backend provides authentication and authorization functionality for the bilbomd-ui front end application. It also provides several API functionalities for authentication, user creation/editing, and BilboMD job creation. The bilbomd-backend also provides an interface to MongoDB which provides a persistant store for User and Job records. The bilbomd-backend server also mediates the addition of BilboMD jobs to the BullMQ queueing system. BilboMD jobs are then processed exclusively by bilbomd-workers.

Getting Started

Technologies Used

Installing

bilbomd-backend is most easily installed via docker compose as a docker container along side the redis and mongodb containers. Please see the bilbomd instructions

Instructions for installing a develoment instance of the backend

Clone the repo.

cd /wherever/this/will/live
git clone https://github.com/bl1231/bilbomd-backend

Install the Node.js dependencies for testing purposes, but keep in mind that these will be installed inside the Docker container when you run docker compose build from the bilbomd main project.

npm install

Run tests

npm run test

Run program

Production is run via docker compose. However, for interactive local development efforts you might be able to:

npm run dev

However, bilbomd-backend needs to communicate with Redis and MongoDB which are typically running in separate Docker images so you would likely have to fiddle with PORT values etc. in order to run in "dev" mode within a local terminal. It will be much easier to use docker compose and develop directly within the bilbomd-dev environment. Details can be found in bilbomd repo. Briefly, the entry point for the backend service in bilbomd-dev has been set as:

command: [ "npm", "run", "dev" ]

and the local directory has been mounted inside the docker image:

    volumes:
      - ./bilbomd-backend:/app

This makes it so that bilbomd-backend will automatically restart inside the docker image anytime changes are made to source files.

Build docker image

To test if the Dockerfile will build you can use this command:

docker build --build-arg USER_ID=1001 --build-arg GROUP_ID=1001 -f bilbomd-backend.dockerfile

or if using podman-hpc on perlmutter...

podman-hpc build --build-arg USER_ID=$UID -t bl1231/bilbomd-spin-backend -f bilbomd-spin-backend.dockerfile

Then you need to tag and push in order for it to be available to Helm/SPIN.

podman-hpc login registry.nersc.gov
podman-hpc tag bl1231/bilbomd-spin-backend:latest registry.nersc.gov/m4659/sclassen/bl1231/bilbomd-spin-backend:latest
podman-hpc push registry.nersc.gov/m4659/sclassen/bilbomd-spin-backend:latest

Authors

Version History

Acknowledgments

Inspiration, code snippets, etc.