Skip to content

Commit

Permalink
Merge pull request #70 from DUNE-DAQ/mroda/variables
Browse files Browse the repository at this point in the history
Dynamic branch and dependency selection
  • Loading branch information
jcfreeman2 authored Nov 6, 2023
2 parents ebf9376 + caa9d94 commit 7bc7c3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dockerfiles/Dockerfile.microservices
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM ghcr.io/dune-daq/microservices_dependencies:latest
ARG DEPENDENCY_TAG=latest
FROM ghcr.io/dune-daq/microservices_dependencies:$DEPENDENCY_TAG

RUN git clone https://github.com/DUNE-DAQ/microservices -b develop
ARG BRANCH=develop
RUN git clone https://github.com/DUNE-DAQ/microservices -b $BRANCH

ENTRYPOINT ["/microservices/entrypoint.sh"]
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ docker run --rm -e MICROSERVICE=<name of microservice> ghcr.io/dune-daq/microser
```

There are a couple of points to note:
* The value of MICROSERVICE should be the name of a given microservice's subdirectory in this repo. As of Oct-6-2023, the available subdirectories are: `config-service`, `ers-dbwriter`, `logbook`, `opmon-dbwriter`, `runnumber-rest` and `runregistry-rest`.
* The value of MICROSERVICE should be the name of a given microservice's subdirectory in this repo. As of Oct-6-2023, the available subdirectories are: `config-service`, `ers-dbwriter`, `ers-protobuf-dbwriter`, `logbook`, `opmon-dbwriter`, `runnumber-rest` and `runregistry-rest`.
* Most microservices require additional environment variables to be set, which can be passed using the usual docker syntax: `-e VARIABLE_NAME=<variable value>`
* If you don't know what these additional environment variables are, you can just run the `docker` command as above without setting them; the container will exit out almost immediately but only after telling you what variables are missing
* The `77df` tag for the image in the example above just refers to the first four characters of the git commit of the microservices repo whose `dockerfiles/Dockerfile.microservices` Docker file was used to create the image. Currently [Oct-11-2023] this is the head of the `develop` branch.

For details on a given microservice, look at its own README file (format is `docs/README_<microservice name>.md`). They may or may not be up to date, however.

## building images
When building from a branch that is not develop you need to specify the branch you want to use to build the code, e.g.:
```bash
docker build -f Dockerfile.microservices -t ghcr.io/dune-daq/microservices:user-my-branch --build-arg BRANCH=my-branch .
```

0 comments on commit 7bc7c3a

Please sign in to comment.