Skip to content
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

docker: add support for revision worker (bug 1787300) #43

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bin/run-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# !/bin/sh

# Run docker-compose with local repos, excluding Bugzilla.
# The following repos should be cloned in the parent directory:

# https://github.com/mozilla-conduit/conduit-autoland-hg
# https://github.com/mozilla-conduit/lando-api
# https://github.com/mozilla-conduit/lando-ui
# https://github.com/mozilla-conduit/phabricator
# https://github.com/mozilla-conduit/review

docker-compose \
-f docker-compose.yml \
-f docker-compose.review.yml \
-f docker-compose.lando-api.yml \
-f docker-compose.lando-ui.yml \
-f docker-compose.autolandhg.yml \
-f docker-compose.phabricator.yml \
-f docker-compose.override.yml \
up --build -d
38 changes: 37 additions & 1 deletion docker-compose.lando-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
- ../lando-api:/app
- ../lando-api/docker/dev-version.json:/version.json
- ../lando-api/migrations:/migrations
- patches:/patches

lando-api.landing-worker:
build:
Expand All @@ -26,11 +27,14 @@ services:
# Use ./Dockerfile to run using uwsgi, similar to remote environments
dockerfile: ./Dockerfile-dev
image: suite_lando-api
command: ["landing-worker"]
command: ["start-landing-worker"]
environment:
ENV: localdev
# TREESTATUS_URL: "http://autoland.treestatus:8000/"
DATABASE_URL: postgresql://postgres:[email protected]/postgres
PHABRICATOR_URL: http://phabricator.test/
PHABRICATOR_UNPRIVILEGED_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
PHABRICATOR_ADMIN_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
Comment on lines +35 to +37
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: these can all go into a reusable template at the top.

SENTRY_DSN:
CELERY_BROKER_URL: redis://redis.queue/0
OIDC_IDENTIFIER: https://lando-api.test
Expand All @@ -53,6 +57,37 @@ services:
# Prevent writing python cache to the host.
- caches_cache:/app/.cache/
- /repos
- patches:/patches
depends_on:
- lando-api.db
- redis.queue

lando-api.revision-worker:
build:
context: ../lando-api/
dockerfile: ./Dockerfile-dev
image: suite_lando-api
command: ["start-revision-worker"]
environment:
ENV: localdev
DATABASE_URL: postgresql://postgres:[email protected]/postgres
PHABRICATOR_URL: http://phabricator.test/
PHABRICATOR_UNPRIVILEGED_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
PHABRICATOR_ADMIN_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
SENTRY_DSN:
CELERY_BROKER_URL: redis://redis.queue/0
OIDC_IDENTIFIER: https://lando-api.test
LANDO_UI_URL: https://lando.test
REPO_CLONES_PATH: /repos
REPOS_TO_LAND: first-repo,second-repo,third-repo
user: root
volumes:
- ../lando-api:/app
- ../lando-api/migrations:/migrations
# Prevent writing python cache to the host.
- caches_cache:/app/.cache/
- /repos
- patches:/patches
depends_on:
- lando-api.db
- redis.queue
Expand All @@ -68,3 +103,4 @@ services:

volumes:
caches_cache:
patches:
40 changes: 32 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ services:
context: ../lando-api/
dockerfile: ./Dockerfile
image: suite_lando-api
command: ["landing-worker"]
command: ["start-landing-worker"]
environment:
- ENV=localdev
- DATABASE_URL=postgresql://postgres:[email protected]/postgres
Expand All @@ -185,6 +185,37 @@ services:
# Prevent writing python cache to the host.
- caches_cache:/app/.cache/
depends_on:
- autoland.hg
- lando-api.db
- redis.queue

lando-api.revision-worker:
build:
context: ../lando-api/
dockerfile: ./Dockerfile
image: suite_lando-api
command: ["start-revision-worker"]
environment:
ENV: localdev
DATABASE_URL: postgresql://postgres:[email protected]/postgres
PHABRICATOR_URL: http://phabricator.test/
PHABRICATOR_UNPRIVILEGED_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
PHABRICATOR_PRIVILEGED_API_KEY: api-lefsv24henzsbzpw337bhizawuyh
SENTRY_DSN:
CELERY_BROKER_URL: redis://redis.queue/0
OIDC_IDENTIFIER: https://lando-api.test
LANDO_UI_URL: https://lando.test
REPO_CLONES_PATH: /repos
REPOS_TO_LAND: first-repo,second-repo,third-repo
user: root
volumes:
- ../lando-api:/app
- ../lando-api/migrations:/migrations
# Prevent writing python cache to the host.
- caches_cache:/app/.cache/
- /repos
depends_on:
- autoland.hg
- lando-api.db
- redis.queue

Expand Down Expand Up @@ -273,13 +304,6 @@ services:
HTTP_ALLOWED: 1
volumes:
- local-dev:/home/phab
depends_on:
- tinyproxy
- phabricator.test
- bmo.test
- bmo.feed
- bmo.pushd
- autoland.hg.test

###########################
# Proxy containers
Expand Down
1 change: 0 additions & 1 deletion docker/local-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ RUN apt-get install -y \
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"


# copy configuration
COPY arcrc .arcrc
COPY hgrc .hgrc
Expand Down
2 changes: 2 additions & 0 deletions docker/local-dev/clone_repositories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ cd third-repo
echo -e "api-lefsv24henzsbzpw337bhizawuyh\n" | moz-phab install-certificate
cd ..

chmod a+rwx .

git clone hg::http://hg.test/first-repo test-repo-cinnabar