From 4387176931ad69cf96b08af0d43db1bba48e9a9c Mon Sep 17 00:00:00 2001 From: Nischal Shrestha <39024181+nischalstha9@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:37:38 +0545 Subject: [PATCH] Revert/compose rename (#2021) * Revert "Merge pull request #2015 from hotosm/fix-backend-test" This reverts commit 8c1ea522d5567f5f833f1ebba8260a434f8eb4c3, reversing changes made to 3e418b51851d988c01213de785a43e286d39331e. * Revert "build: rename docker-compose.yml files --> compose.yml (#1998)" This reverts commit 1b1b1fb513687679005f15867fc59720e58e1047. --- .github/workflows/build_and_deploy.yml | 3 +-- .github/workflows/pr_test_frontend.yml | 2 +- INSTALL.md | 14 ++++++------ .../josm/{compose.yaml => docker-compose.yml} | 0 contrib/just/start/Justfile | 16 +++++++------- contrib/just/stop/Justfile | 8 +++---- contrib/just/test/Justfile | 12 +++++----- .../{compose.yaml => docker-compose.yml} | 0 .../{compose.yaml => docker-compose.yml} | 0 .../{compose.yaml => docker-compose.yml} | 0 ...ent.yaml => docker-compose.development.yml | 0 compose.main.yaml => docker-compose.main.yml | 0 ...staging.yaml => docker-compose.staging.yml | 22 +++++++++---------- compose.yaml => docker-compose.yml | 0 docs/dev/Backend.md | 6 ++--- docs/dev/Production.md | 6 ++--- scripts/renew-certs-manual.sh | 2 +- 17 files changed, 45 insertions(+), 46 deletions(-) rename contrib/josm/{compose.yaml => docker-compose.yml} (100%) rename contrib/openobserve/{compose.yaml => docker-compose.yml} (100%) rename contrib/playwright/{compose.yaml => docker-compose.yml} (100%) rename contrib/tunnel/{compose.yaml => docker-compose.yml} (100%) rename compose.development.yaml => docker-compose.development.yml (100%) rename compose.main.yaml => docker-compose.main.yml (100%) rename compose.staging.yaml => docker-compose.staging.yml (83%) rename compose.yaml => docker-compose.yml (100%) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 48b9dcfe0d..ed5e161e63 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -26,7 +26,6 @@ jobs: compose_command: pytest tag_override: ci-${{ github.ref_name }} coverage: true - compose_file: "compose.${{ github.ref_name }}.yaml" secrets: inherit frontend-unit-test: @@ -157,5 +156,5 @@ jobs: uses: hotosm/gh-workflows/.github/workflows/remote_deploy_compose.yml@2.0.9 with: environment: ${{ github.ref_name }} - docker_compose_file: "compose.${{ github.ref_name }}.yaml" + docker_compose_file: "docker-compose.${{ github.ref_name }}.yml" secrets: inherit diff --git a/.github/workflows/pr_test_frontend.yml b/.github/workflows/pr_test_frontend.yml index ab6a2c21dd..5ee70aeb0d 100644 --- a/.github/workflows/pr_test_frontend.yml +++ b/.github/workflows/pr_test_frontend.yml @@ -23,7 +23,7 @@ jobs: with: playwright: true cache_image: false - compose_file: compose.yaml -f contrib/playwright/compose.yaml + compose_file: docker-compose.yml -f contrib/playwright/docker-compose.yml compose_service: ui-test cache_extra_imgs: | "docker.io/postgis/postgis:${{ vars.POSTGIS_TAG }}" diff --git a/INSTALL.md b/INSTALL.md index b6a7c48891..daafad9544 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -155,10 +155,10 @@ local test - used during development, or to start a test version The corresponding docker-compose files are: ```text -main - compose.main.yaml -staging - compose.staging.yaml -development - compose.development.yaml -local test - compose.yaml +main - docker-compose.main.yml +staging - docker-compose.staging.yml +development - docker-compose.development.yml +local test - docker-compose.yml ``` Set your selection to a terminal variable to make the next step easier: @@ -173,7 +173,7 @@ export GIT_BRANCH=development #### Pull the Images ```bash -docker compose -f "compose.${GIT_BRANCH}.yaml" pull +docker compose -f "docker-compose.${GIT_BRANCH}.yml" pull ``` > This will pull the latest containers for the branch you selected. @@ -185,13 +185,13 @@ Before we can run, you need to build your version of the frontend. This is because the frontend contains variable specific to your deployment. ```bash -docker compose -f "compose.${GIT_BRANCH}.yaml" build ui +docker compose -f "docker-compose.${GIT_BRANCH}.yml" build ui ``` #### Start the Containers ```bash -docker compose -f "compose.${GIT_BRANCH}.yaml" up -d +docker compose -f "docker-compose.${GIT_BRANCH}.yml" up -d ``` You should see the containers start up in order. diff --git a/contrib/josm/compose.yaml b/contrib/josm/docker-compose.yml similarity index 100% rename from contrib/josm/compose.yaml rename to contrib/josm/docker-compose.yml diff --git a/contrib/just/start/Justfile b/contrib/just/start/Justfile index 3091a5c120..86b2af1c0a 100644 --- a/contrib/just/start/Justfile +++ b/contrib/just/start/Justfile @@ -57,8 +57,8 @@ without-central: [no-cd] josm: docker compose \ - -f compose.yaml \ - -f contrib/josm/compose.yaml \ + -f docker-compose.yml \ + -f contrib/josm/docker-compose.yml \ up -d @echo @@ -76,8 +76,8 @@ tunnel: #!/usr/bin/env sh docker compose \ - -f compose.yaml \ - -f contrib/tunnel/compose.yaml \ + -f docker-compose.yml \ + -f contrib/tunnel/docker-compose.yml \ up --wait # Workaround to until PR merged: @@ -92,8 +92,8 @@ tunnel: # Is is required to correctly download forms from Collect CENTRAL_DOMAIN_OVERRIDE="$(echo "${odk_url}" | sed 's|^https://||')" \ docker compose \ - -f compose.yaml \ - -f contrib/tunnel/compose.yaml \ + -f docker-compose.yml \ + -f contrib/tunnel/docker-compose.yml \ up -d central just --unstable start _print-tunnel-url "$odk_url" "$button_url" @@ -112,8 +112,8 @@ _get-tunnel-url service_name: #!/usr/bin/env sh service_url=$(docker compose \ - -f compose.yaml \ - -f contrib/tunnel/compose.yaml \ + -f docker-compose.yml \ + -f contrib/tunnel/docker-compose.yml \ logs {{service_name}}-tunnel | \ grep 'Your quick Tunnel' -A 1 | tail -n 1 | \ sed -n 's/.*| *\(https:\/\/[^ ]*\).*/\1/p') diff --git a/contrib/just/stop/Justfile b/contrib/just/stop/Justfile index 596c93fdf3..8237b78a8b 100644 --- a/contrib/just/stop/Justfile +++ b/contrib/just/stop/Justfile @@ -25,15 +25,15 @@ default: [no-cd] josm: docker compose \ - -f compose.yaml \ - -f contrib/josm/compose.yaml \ + -f docker-compose.yml \ + -f contrib/josm/docker-compose.yml \ down # Stop FMTM & tunnels [no-cd] tunnel: docker compose \ - -f compose.yaml \ - -f contrib/tunnel/compose.yaml \ + -f docker-compose.yml \ + -f contrib/tunnel/docker-compose.yml \ down diff --git a/contrib/just/test/Justfile b/contrib/just/test/Justfile index a70d10da87..6cdb0d2e29 100644 --- a/contrib/just/test/Justfile +++ b/contrib/just/test/Justfile @@ -30,24 +30,24 @@ backend: [no-cd] frontend: docker compose \ - -f compose.yaml \ - -f contrib/playwright/compose.yaml \ + -f docker-compose.yml \ + -f contrib/playwright/docker-compose.yml \ run --rm --service-ports ui-test 'npm run test:e2e-report' # View Playwright tests as they happen in browser [no-cd] frontend-debug: docker compose \ - -f compose.yaml \ - -f contrib/playwright/compose.yaml \ + -f docker-compose.yml \ + -f contrib/playwright/docker-compose.yml \ run --rm ui-test 'npm run test:e2e-debug' # Create Playwright tests interactively [no-cd] frontend-interactive: docker compose \ - -f compose.yaml \ - -f contrib/playwright/compose.yaml \ + -f docker-compose.yml \ + -f contrib/playwright/docker-compose.yml \ run --rm ui-test 'npm run test:e2e-interactive' # Check coverage for backend tests diff --git a/contrib/openobserve/compose.yaml b/contrib/openobserve/docker-compose.yml similarity index 100% rename from contrib/openobserve/compose.yaml rename to contrib/openobserve/docker-compose.yml diff --git a/contrib/playwright/compose.yaml b/contrib/playwright/docker-compose.yml similarity index 100% rename from contrib/playwright/compose.yaml rename to contrib/playwright/docker-compose.yml diff --git a/contrib/tunnel/compose.yaml b/contrib/tunnel/docker-compose.yml similarity index 100% rename from contrib/tunnel/compose.yaml rename to contrib/tunnel/docker-compose.yml diff --git a/compose.development.yaml b/docker-compose.development.yml similarity index 100% rename from compose.development.yaml rename to docker-compose.development.yml diff --git a/compose.main.yaml b/docker-compose.main.yml similarity index 100% rename from compose.main.yaml rename to docker-compose.main.yml diff --git a/compose.staging.yaml b/docker-compose.staging.yml similarity index 83% rename from compose.staging.yaml rename to docker-compose.staging.yml index dc78b5d5d7..d8159f200d 100644 --- a/compose.staging.yaml +++ b/docker-compose.staging.yml @@ -46,43 +46,43 @@ networks: services: proxy: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: proxy api: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: api ui: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: ui central: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: central central-ui: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: central-ui s3: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: s3 fmtm-db: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: fmtm-db electric: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: electric central-db: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: central-db migrations: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: migrations backups: image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}" @@ -107,6 +107,6 @@ services: retries: 3 certbot: extends: - file: compose.development.yaml + file: docker-compose.development.yml service: certbot image: "ghcr.io/hotosm/fmtm/proxy:certs-init-staging" diff --git a/compose.yaml b/docker-compose.yml similarity index 100% rename from compose.yaml rename to docker-compose.yml diff --git a/docs/dev/Backend.md b/docs/dev/Backend.md index ff34eabeb6..4c64121957 100644 --- a/docs/dev/Backend.md +++ b/docs/dev/Backend.md @@ -116,13 +116,13 @@ just migrate ### Interactive Debugging -- The `compose.yaml` builds FMTM using the `debug` target in the Dockerfile. +- The `docker-compose.yml` builds FMTM using the `debug` target in the Dockerfile. - The debug image contains `debugpy` to assist debugging in the container. To use it: 1. Re-build the docker image `docker compose build api` -2. Uncomment the debug port in compose.yaml: +2. Uncomment the debug port in docker-compose.yml: ```yml services: @@ -201,7 +201,7 @@ Creating a new release during development may not always be feasible. - A development version of osm-fieldwork can be mounted into the FMTM container via bind mount. - Clone the osm-fieldwork repo to the same root directory as FMTM. -- Uncomment the line in compose.yaml +- Uncomment the line in docker-compose.yml ```yaml - ../osm-fieldwork/osm_fieldwork:/home/appuser/.local/lib/python3.12/site-packages/osm_fieldwork diff --git a/docs/dev/Production.md b/docs/dev/Production.md index e852f9cc61..c228b8efaf 100644 --- a/docs/dev/Production.md +++ b/docs/dev/Production.md @@ -185,11 +185,11 @@ attaching to the FMTM containers: export GIT_BRANCH=development # Shut down the running database & delete the data -docker compose -f compose.$GIT_BRANCH.yaml down -v +docker compose -f docker-compose.$GIT_BRANCH.yml down -v # First, ensure you have a suitable .env with database vars # Start the databases only -docker compose -f compose.$GIT_BRANCH.yaml up -d fmtm-db central-db +docker compose -f docker-compose.$GIT_BRANCH.yml up -d fmtm-db central-db # (Optional) restore odk central from the backup backup_filename=fmtm-central-db-${GIT_BRANCH}-XXXX-XX-XX-sql.gz @@ -208,7 +208,7 @@ fmtm-${GIT_BRANCH}-fmtm-db-1 \ pg_restore --verbose -U fmtm -d fmtm # Run the entire docker compose stack -docker compose -f compose.$GIT_BRANCH.yaml up -d +docker compose -f docker-compose.$GIT_BRANCH.yml up -d ``` ## Help! FMTM Prod Is Broken 😨 diff --git a/scripts/renew-certs-manual.sh b/scripts/renew-certs-manual.sh index 9711122118..6bf6195378 100644 --- a/scripts/renew-certs-manual.sh +++ b/scripts/renew-certs-manual.sh @@ -35,7 +35,7 @@ if [[ -z $(docker ps -q -f "ancestor=ghcr.io/hotosm/fmtm/proxy:${BRANCH_NAME}") echo "No containers using the 'ghcr.io/hotosm/fmtm/proxy:${BRANCH_NAME}' image are running." echo "You must first start the containers using:" echo - echo "docker-compose -f compose.${BRANCH_NAME}.yaml up -d" + echo "docker-compose -f docker-compose.${BRANCH_NAME}.yml up -d" echo exit 1 fi