Deploying bedbase.org
This repository deploys the API for bedbase. It will run these services:
- production API: https://api.bedbase.org/
- dev API: https://api-dev.bedbase.org/
This repo will deploy a new service by following these steps:
- Build an image by packaging the bedhost image (from dockerhub) with the bbconf file in this repository.
- Push that image to AWS.
- Deploy it to yeti cluster with aws task def.
Build the container
Section titled “Build the container”Here we use the databio/bedhost container on dockerhub, and just add the configuration file in this repo to it, so build is super fast.
docker build -t databio/bedhost-configured -f deployment/Dockerfiles/primary.Dockerfile .Or for dev:
docker build -t databio/bedhost-configured-dev -f deployment/Dockerfiles/dev1.Dockerfile .Run it locally to test
Section titled “Run it locally to test”First, source the .env file to set env vars in the calling environment.
Then, use --env-file to pass those env vars through to the container
source environment/production.envdocker run --rm --network="host" \ --env-file environment/docker.env \ databio/bedhost-configured-devHere's another example for running the container:
docker run --rm --init -p 8000:8000 --name bedstat-rest-server \ --network="host" \ --volume "$(pwd)/deployment/config/api.bedbase.org.yaml:/bedbase.yaml" \ --env-file environment/docker.env \ --env BEDBASE_CONFIG=/bedbase.yaml \ databio/bedhost uvicorn bedhost.main:app --reloadBuilding the Amazon-tagged version
Section titled “Building the Amazon-tagged version”You could build and push to ECR like this if you need it... but the github action will do this for you.
Authenticate with AWS ECR:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 235728444054.dkr.ecr.us-east-1.amazonaws.comBuild/tag/push image:
docker build -t 235728444054.dkr.ecr.us-east-1.amazonaws.com/bedhost -f deployment/Dockerfiles/primary.Dockerfile .docker push 235728444054.dkr.ecr.us-east-1.amazonaws.com/bedhost