To build this project, if you didn't build the CARDS platform itself locally, you must first gather the CARDS-platform Maven artifacts:
./get_cards_platform_jars.shThen run:
mvn clean installDocker images for this project are built on top of a generic CARDS image.
You can either download one from the github repository, or build a local image from source.
In either case, the version of CARDS to use must match the version declared in the root pom.xml file as the cards.version property.
There are two sets of maven build profiles you can choose from:
- if you want to use a
local,published, orlatestimage for the base CARDS project - and if you want to build a
productionordevelopmentimage
A development image will be slimmer, since it skips copying any of the built JARs into the Docker image, so it must be used on the same machine where it was built, using the local maven repository as a source for dependencies.
Therefore, the resultant image should only be used with the --dev_docker_image and --cards_generic_jars_repo flags for generate_compose_yaml.py.
This is useful for testing new code during development as it does not require a new Docker image to be built every time that code is changed.
A production image will be self-contained, and can be started on any computer, even without access to internet. In this case, the base CARDS image you use must also be a production image.
As for the base image to use, local will use a CARDS image built on the same computer, but with a version matching the cards.version property, e.g. cards/cards:0.9.30,
published will use an image with a matching version fetched from our github package repository, e.g. ghcr.io/data-team-uhn/cards:0.9.30,
and latest will use the latest image built locally, cards/cards:latest.
If neither of these are right, you can either change the value to use in docker/pom.xml, or in docker/Dockerfile,
or just once when building by overriding the cardsBaseImage maven parameter, e.g. mvn install -P production -D cardsBaseImage=ghcr.io/data-team-uhn/cards:0.9.30_apple-cert.
The default is to use the local image.
So, to build a development image based on the latest CARDS image, run:
mvn clean install -P development,latestTo build a production image based on the corresponding published CARDS image, run:
mvn clean install -P production,publishedEnter the main cards-deploy-tool repository (https://github.com/data-team-uhn/cards-deploy-tool)
and start the project with:
python3 generate_compose_yaml.py --cards_docker_image cards/cards4lfs:latest --oak_filesystem --composum
docker-compose build
docker-compose up -dLFS will be available at http://localhost:8080 once it starts.
Run python3 generate_compose_yaml.py --help to find out more about the parameters supported by the script, such as using Mongo for storage, using different ports, or configuring SAML authentication.
After you build a docker image, you can quickly run a non-persistent image with:
docker run -it --rm --env OAK_FILESYSTEM=true -p 8080:8080 cards/cards4lfs:latestEnter the main cards repository (https://github.com/data-team-uhn/cards)
and build the generic CARDS platform with:
mvn clean installThen, start the project with (replace with the current version of this project):
PROJECT_VERSION=1.0.0-SNAPSHOT ./start_cards.sh --dev --project cards4lfsLFS will be available at http://localhost:8080 once it starts.
Enter the main cards-deploy-tool repository (https://github.com/data-team-uhn/cards-deploy-tool)
and start the project with:
python3 generate_compose_yaml.py --dev_docker_image --cards_generic_jars_repo /path/to/lfs/.cards-generic-mvnrepo --cards_docker_image cards/cards4lfs:latest --oak_filesystem --composum
docker-compose build
docker-compose up -dLFS will be available at http://localhost:8080 once it starts.