This repository contains the TrainBuilder class responsible for building valid train images based on the configuration
selected in the user interface, as well as the train algorithm files submitted to the UI.
Based on the configuration the service obtains the files from the central API and the public keys of both the
participating stations and the user who created the train from our vault secret storage.
Using these values the train builder creates the train_config.json
containing all relevant information about the train
and packages it along with the user submitted files into a train image.
The selected route is then submitted to vault under the given train ID and the image is pushed to the pht_incoming
project of our container registry.
The service is configured using environment variables, which define the connection parameters to other central PHT services. The following environment variables are required:
VAULT_TOKEN=<token>
VAULT_URL=https://vault-pht-dev.tada5hi.net
HARBOR_API=https://harbor-pht.tada5hi.net/api/v2.0
HARBOR_URL=https://harbor-pht.tada5hi.net
HARBOR_USER=<harbor_user>
HARBOR_PW=<harbor_pw>
AMPQ_URL=<ampq_url>
UI_TRAIN_API=https://pht-dev.tada5hi.net/api/trains/
REDIS_HOST=redis
Use the prebuilt image to use the service in a separate docker-compose file, the image uses the same environment variables as defined in the next section.
- Edit the environment variables in the
docker-compose.yaml
or in a.env
in the working directory with the required values - Build the image and run the service:
docker-compose build docker-compose up -d