From d77abec97c2ac5e8c405dce6fdffcedebfc2f587 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 25 Feb 2026 16:27:10 +1100 Subject: [PATCH 1/3] suite: add lando shortcuts --- README.md | 19 +++++++++++++++++++ suite | 26 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/README.md b/README.md index f32e7ce..f60faa2 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,25 @@ added to the `docker-compose.override.yml` file. This file is listed in the The `./suite` script transparently apply the overrides if the file is present. + +### In-container command shortcuts + +There are shortcuts for running common commands in the appropriate container, +e.g., + +```shell +./suite lando [DJANGO-COMMAND] +``` + +will run any Django command accepted by the `lando` script in the `lando` +container. One exception is the `dbshell` command, which will be emulated by +running in the `lando.db` container instead. + +HINT: As a rule of thumb when adding more commands in this ilk, they should take +the normal name of command and argument list, and work by simply prefixing +them with `./suite`. Under the hood, the script should select the most +appropriate container to run the selected command in. + ## Accessing the websites provided by the suite ### Firefox configuration diff --git a/suite b/suite index 7c2d92c..75bf91c 100755 --- a/suite +++ b/suite @@ -1,9 +1,35 @@ #!/bin/sh # A simple wrapper that takes care of using compose overrides if present. +while :; do + case $1 in + lando) + shift + case $1 in + dbshell) + shift + # Fake the DB shell command by running in the correct container + set - exec -it lando.db psql -U postgres "${@}" + ;; + *) + if docker compose ps -q lando >/dev/null 2>&1; then + set - exec -it lando lando "${@}" + else + set - run --rm -it lando lando "${@}" + fi + ;; + esac + ;; + *) + break + ;; + esac +done + if [ -e docker-compose.override.yml ]; then set - -f docker-compose.override.yml "${@}" fi set - compose -f docker-compose.yml "${@}" +echo "docker ${@}" >&2 docker "${@}" From 65fd2c834ad56c2335ea251bf4bb6abb3068a868 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Fri, 27 Feb 2026 15:06:37 +1100 Subject: [PATCH 2/3] suite: add local-dev shortcut --- README.md | 4 ++++ suite | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f60faa2..fab6b72 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,10 @@ the normal name of command and argument list, and work by simply prefixing them with `./suite`. Under the hood, the script should select the most appropriate container to run the selected command in. +Available shortcuts: +* lando +* local-dev + ## Accessing the websites provided by the suite ### Firefox configuration diff --git a/suite b/suite index 75bf91c..65d730b 100755 --- a/suite +++ b/suite @@ -20,6 +20,11 @@ while :; do ;; esac ;; + + local-dev) + set - run --rm -it local-dev "${@}" + ;; + *) break ;; From 78b26cd37bc8981c2eabcea17c883a9d36ed0ac4 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 3 Sep 2025 14:08:10 +1000 Subject: [PATCH 3/3] docker: add support for try-like repository (bug 1986575) As Try is a rather large repo, it's not always desirable to use it. Instead, the feature is set behind a docker compose profile which is not enabled by default, but can be on demand. --- README.md | 19 ++++++++++++++++++- docker-compose.yml | 30 +++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fab6b72..157346f 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,6 @@ added to the `docker-compose.override.yml` file. This file is listed in the The `./suite` script transparently apply the overrides if the file is present. - ### In-container command shortcuts There are shortcuts for running common commands in the appropriate container, @@ -119,6 +118,24 @@ Available shortcuts: * lando * local-dev + +### Optional services + +Some services are disabled by default. This is generally because they are heavy +to start and/or run, and not always necessary in a basic environment. + +Those services can be started as [docker compose profiles](https://docs.docker.com/compose/how-tos/profiles/), + +```shell +$ ./suite --profile up [...] +``` + +The `--profile` option can be repeated on a single command as many times for +different profiles. + +The following optional profiles currently exist: + - `try`: clones mozilla-unified twice, in hg.test and in the try worker. + ## Accessing the websites provided by the suite ### Firefox configuration diff --git a/docker-compose.yml b/docker-compose.yml index 6e9e327..cff1c3c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -234,6 +234,8 @@ services: command: lando start_landing_worker hg volumes: - ../lando:/code + # Keep those in a persistent volume, as the firefox-try repo takes a while to clone. + - lando-try-worker-repos:/files/repos restart: on-failure depends_on: lando: @@ -353,6 +355,21 @@ services: volumes: - autoland-hg:/repos + autoland.hg-init-try: + platform: linux/amd64 + image: mozilla/autolandhg:latest + build: + context: ../conduit-autoland-hg + dockerfile: ./Dockerfile + profiles: + # It takes a while to clone m-u, when it's not always needed. + # This service only starts when `--profile try` is passed. + - try + entrypoint: hg + command: clone https://hg.mozilla.org/mozilla-unified /repos/firefox-try + volumes: + - autoland-hg:/repos + autoland.hg: platform: linux/amd64 image: mozilla/autolandhg:latest @@ -366,7 +383,14 @@ services: volumes: - autoland-hg:/repos depends_on: - - autoland.hg-init + autoland.hg-init: + condition: service_completed_successfully + autoland.hg-init-try: + condition: service_completed_successfully + # This service is only available when the stack is started with `--profile try`. + # We just let the service start if this dependency is missing. + required: false + ############################### # Phabricator-Emails @@ -463,6 +487,9 @@ services: volumes: - local-dev:/home/phab - ../review:/home/phab/review + # Mount some external sources for Try tests + # - ~/.mozbuild/lando.toml:/root/.mozbuild/lando.toml + # - ~/work/firefox/:/firefox/ depends_on: - tinyproxy - phabricator.test @@ -569,6 +596,7 @@ volumes: git-repos: git_hg_sync_clones: lando-postgres-db: + lando-try-worker-repos: local-dev: media: phabricator-emails-postgres-db: