Buiding a deps image - stjude/proteinpaint GitHub Wiki
To get the latest image:
If not building one, install the image in ~/pp/container/
from: github repo.
And then follow these steps:
- Run
npm run cjs
from sjpp to transpile the datasets. - Copy over the dataset files from
~/sjpp/dataset/cjs
to~/pp/container/datasets
- Make sure the serverconfig ds inputs match with what is stored in
~/pp/container/datasets
- From the same folder now run the command:
run ./run.sh ghcr.io/stjude/ppfull:{image version goes here}
- Start your local instance for the port provided in the serverconfig (as an example, see serverconfig file configurations below).
Hints:
- inspect logs with
docker logs pp
- ssh into the container with
docker exec -it pp bash
- stop the container with
docker stop pp
- to check logs of the same ppfull container on the production servers run:
podman logs {pp-cont_name}
To build a new deps image follow the steps below:
The deps image is placed in:
proteinpaint/container/deps
The purpose of the deps image is to speed up the build process by already having prebuilt binaries, R and R libraries, Rust dependency, etc, so when ppserver
and ppfull
images are built, the built is faster, because the ppfull
and ppserver
image are built from the deps image.
In case a new binary, R library, Rust dependency, etc is added to the project, it should be added to the deps image:
proteinpaint/container/deps
It's recommended to prune all the images before building the deps image:
docker system prune -a
To test the updated deps image locally, perform the following steps:
cd container/deps
./version.sh deps
./build.sh
The new deps image version named "ppfull:latest" and "ppserver:latest" should be added to
proteinpaint/container/ppfull/Dockerfile
ARG VERSION=latest
#########################
# Full app update
#########################
FROM ppfull:$VERSION
and:
proteinpaint/container/server/Dockerfile
ARG VERSION=latest
#########################
# Server-only app update
#########################
FROM ppserver:$VERSION
Simulate the Docker build:
Remove all previous builds/images in docker manually before the following steps.
For the full build (recommended), do the following:
cd container
./pack.sh
./build2.sh -z full
./run.sh ppfull:NEW_VERSION # requires a serverconfig.json, read the NEW_VERSION from the list of docker images.
It requires minimal serverconfig.json
in the container dir.
For the server only build which doesn't include client code, do the following:
cd container
./pack.sh
./build2.sh -z server #in case server only build is tested, execute this and the following step, otherwise skip both.
./run.sh ppserver:NEW_VERSION # requires a serverconfig.json, read the NEW_VERSION from the list of docker images.
It requires minimal serverconfig.json
in the container dir.
Example minimal serverconfig.json in the container dir
{
"tpmasterdir": "...",
"port": 3000,
"genomes": [
{
"name": "hg19",
"species": "human",
"file": "./genome/hg19.js",
"datasets": [
{
"name": "ClinVar",
"jsfile": "./dataset/clinvar.hg19.js"
}
]
},
{
"name": "hg38",
"species": "human",
"file": "./genome/hg38.js",
"datasets": [
{
"name": "ClinVar",
"jsfile": "./dataset/clinvar.hg38.js"
}
]
}
],
"backend_only": false,
"URL": "http://localhost:3456"
}
In case everything works as expected locally, release a new deps image using CI action. :
https://github.com/stjude/proteinpaint/actions/workflows/CD-publish-deps-image.yml
In case the build is successful, the deps image versions are updated inside of:
proteinpaint/container/ppfull/Dockerfile
ARG VERSION=NEW_VERSION
and:
proteinpaint/container/server/Dockerfile
ARG VERSION=NEW_VERSION
To release the newly built image:
Start a new release using the github action.