This repository has been archived by the owner on Nov 11, 2019. It is now read-only.
Add Dockerfile + docker-compose.yml #207
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM nixos/nix:1.11 | ||
|
||
ENV NIX_PATH="nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/fa4167c0a13cbe0d97b9c88d91b86845a8c4e740.tar.gz" | ||
|
||
COPY nix/nix.conf /etc/nix/nix.conf | ||
COPY .git/ /app/.git/ | ||
COPY lib/ /app/lib/ | ||
COPY nix/ /app/nix/ | ||
COPY src/ /app/src/ | ||
COPY VERSION /app/ | ||
|
||
RUN nix-channel --update | ||
# TODO: remove downloaded packages | ||
RUN nix-env -iA nixpkgs.nix nixpkgs.cacert nixpkgs.git nixpkgs.gnumake \ | ||
&& nix-collect-garbage -d | ||
|
||
RUN cd /app && nix-shell nix/default.nix -A releng_frontend --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A releng_clobberer --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A releng_tooltool --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A releng_treestatus --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A releng_mapper --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A releng_archiver --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A shipit_bot_uplift --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A shipit_dashboard --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A shipit_frontend --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A shipit_pipeline --run "exit" | ||
RUN cd /app && nix-shell nix/default.nix -A shipit_signoff --run "exit" | ||
|
||
# Doing this after all the nix installation means rebuilds are faster for Makefile-only changes | ||
COPY Makefile /app/ | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["/root/.nix-profile/bin/make"] | ||
CMD ["docker-run", "APP=${SERVICES_APP}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
version: "2.1" | ||
|
||
# TODO: what links do we need? | ||
services: | ||
releng_db: | ||
image: postgres@sha256:6ac0fbeddde3bb7b0003a2ace8c126f742f8bdd90695801337d3edaaf1fcc478 | ||
expose: | ||
- 5432 | ||
environment: | ||
- POSTGRES_PASSWORD=releng | ||
- POSTGRES_USER=releng | ||
- POSTGRES_DB=releng | ||
volumes: | ||
- ./tmp/postgres:/var/lib/postgresql/data | ||
|
||
releng_frontend: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_frontend | ||
|
||
releng_clobberer: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8001:8001" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_clobberer | ||
|
||
releng_tooltool: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8002:8002" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_tooltool | ||
|
||
releng_treestatus: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8003:8003" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_treestatus | ||
- DATABASE_URL=postgresql://releng:releng@releng_db:5432/releng | ||
links: | ||
- releng_db | ||
healthcheck: | ||
# TODO: this command generates spamming output from the releng_db container | ||
# using the real pg client might fix this | ||
test: ["CMD", "nc", "-vz", "releng_db", "5432"] | ||
interval: 15s | ||
timeout: 2s | ||
retries: 10 | ||
|
||
releng_mapper: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8004:8004" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_mapper | ||
|
||
releng_archiver: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8005:8005" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=releng_archiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
version: "2.1" | ||
|
||
services: | ||
shipit_db: | ||
image: postgres@sha256:6ac0fbeddde3bb7b0003a2ace8c126f742f8bdd90695801337d3edaaf1fcc478 | ||
expose: | ||
- 5432 | ||
environment: | ||
- POSTGRES_PASSWORD=shipit | ||
- POSTGRES_USER=shipit | ||
- POSTGRES_DB=shipit | ||
volumes: | ||
- ./tmp/postgres:/var/lib/postgresql/data | ||
|
||
shipit_frontend: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
ports: | ||
- "8010:8010" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=shipit_frontend | ||
# The frontend exposes information from each of the backends. | ||
links: | ||
- shipit_dashboard | ||
- shipit_pipeline | ||
- shipit_signoff | ||
|
||
shipit_dashboard: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
expose: | ||
- 8011 | ||
ports: | ||
- "8011:8011" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=shipit_dashboard | ||
- DATABASE_URL=postgresql://shipit:shipit@shipit_db:5432/shipit | ||
links: | ||
- shipit_db | ||
healthcheck: | ||
# TODO: this command generates spamming output from the shipit_db container | ||
# using the real pg client might fix this | ||
test: ["CMD", "nc", "-vz", "shipit_db", "5432"] | ||
interval: 15s | ||
timeout: 2s | ||
retries: 10 | ||
|
||
shipit_pipeline: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
expose: | ||
- 8012 | ||
ports: | ||
- "8012:8012" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=shipit_pipeline | ||
# The pipeline service needs to be able to trigger actions in the "step" services | ||
links: | ||
- shipit_signoff | ||
|
||
# TODO: might be nice to rename step services to have "step" in their name to make it more obvious | ||
shipit_signoff: | ||
image: mozbhearsum/bhearsum-shipit-test | ||
expose: | ||
- 8013 | ||
ports: | ||
- "8013:8013" | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
environment: | ||
- APP_DEV_HOST=0.0.0.0 | ||
- SERVICES_APP=shipit_signoff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
binary-caches = https://s3.amazonaws.com/releng-cache/ https://cache.nixos.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
While these work, it works out I did them wrong. Healthchecks should be part of the container they're checking (so this one should be in the db container), and there's a special depends_on syntax for depending on a service being healthy. mozilla-releng/balrog#297 (review) has a good example of how to do it.