-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image parameters to compose.yaml
#1092
Conversation
compose.yaml
Outdated
@@ -66,6 +66,7 @@ services: | |||
- README.md | |||
|
|||
divviup_api: | |||
image: ${DIVVIUP_API_IMAGE:-us-west2-docker.pkg.dev/janus-artifacts/divviup-api/divviup_api:0.3.9} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR isn't quite ready to go, because the default image here is not in a public repository. I'm working on separate changes to enable docker-release.yml
to push to us-west2-docker.pkg.dev/divviup-artifacts-public
and will update this URL to point there before merging this.
6c84f1f
to
4c5e6db
Compare
I think an easier entry point would be to create another file, |
Seems reasonable! The simplest thing would be to use merge, but that requires passing multiple compose YAMLs in the correct order at the command line so that merge rules are evaluated correctly (i.e., So I opted for include. This requires us to add a further overrides file, but it makes the dev setup easier to use. I also moved the |
Unfortunately, Dependabot cannot update image names in |
compose.dev.override.yaml
Outdated
develop: | ||
watch: | ||
- path: migration | ||
action: rebuild | ||
ignore: | ||
- README.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The develop stanzas are mixed up, this one should go on divviup_api_migration
and vice versa.
Still need #1093 and in turn https://github.com/divviup/janus-ops/pull/1825 before I can merge this. |
Compose files can be parameterized using Bash-style (*sigh*) syntax ([1]). We add variables `JANUS_AGGREGATOR_IMAGE`, `JANUS_MIGRATOR_IMAGE`, `DIVVIUP_API_IMAGE` and `DIVVIUP_API_MIGRATOR_IMAGE` to allow setting Docker image tags like so: ```sh DIVVIUP_API_IMAGE=myrepository.dev/divviup_api:0.0.1 \ JANUS_AGGREGATOR_IMAGE=myrepository.dev/janus_aggregator:0.7.8 \ docker compose up ``` These variables are interpolated into the `image` field of the `service` elements ([2]). Because we also have a `build` element on the `divviup-api` services, the behavior is to pull the specified image and fall back to the `build` element if it can't be found ([3]). So if you want to build `divviup-api` from source and use that, do: ```sh DIVVIUP_API_IMAGE=divviup_api:1 docker compose up ``` `divviup_api:1` will be built from the local context, unless it's already in the local Docker repository, and then launched. We provide defaults for all these images that pull from Divvi Up owned public artifact repositories. It's somewhat unfortunate that we use a `divviup-api` version that is behind `main`, but on the other hand the objective is to enable a demo experience, so it makes sense to pin Janus and divviup-api versions where the demo is known to work end-to-end. [1]: https://docs.docker.com/compose/compose-file/12-interpolation/ [2]: https://docs.docker.com/compose/compose-file/05-services/#image [3]: https://docs.docker.com/compose/compose-file/build/#using-build-and-image
Add a distinct compose.dev.yaml and include the base compose.yaml into it with some overrides.
5a0be9a
to
4a1426d
Compare
Compose files can be parameterized using Bash-style (sigh) syntax (1). We add variables
JANUS_AGGREGATOR_IMAGE
,JANUS_MIGRATOR_IMAGE
,DIVVIUP_API_IMAGE
andDIVVIUP_API_MIGRATOR_IMAGE
to allow setting Docker image tags like so:These variables are interpolated into the
image
field of theservice
elements (2). Because we also have abuild
element on thedivviup-api
services, the behavior is to pull the specified image and fall back to thebuild
element if it can't be found (3). So if you want to builddivviup-api
from source and use that, do:divviup_api:1
will be built from the local context, unless it's already in the local Docker repository, and then launched.We provide defaults for all these images that pull from Divvi Up owned public artifact repositories. It's somewhat unfortunate that we use a
divviup-api
version that is behindmain
, but on the other hand the objective is to enable a demo experience, so it makes sense to pin Janus and divviup-api versions where the demo is known to work end-to-end.