Skip to content

Commit

Permalink
Revert/compose rename (#2021)
Browse files Browse the repository at this point in the history
* Revert "Merge pull request #2015 from hotosm/fix-backend-test"

This reverts commit 8c1ea52, reversing
changes made to 3e418b5.

* Revert "build: rename docker-compose.yml files --> compose.yml (#1998)"

This reverts commit 1b1b1fb.
  • Loading branch information
nischalstha9 authored Dec 23, 2024
1 parent 8c1ea52 commit 4387176
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 46 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -157,5 +156,5 @@ jobs:
uses: hotosm/gh-workflows/.github/workflows/[email protected]
with:
environment: ${{ github.ref_name }}
docker_compose_file: "compose.${{ github.ref_name }}.yaml"
docker_compose_file: "docker-compose.${{ github.ref_name }}.yml"
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pr_test_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
14 changes: 7 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand All @@ -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.
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions contrib/just/start/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"
Expand All @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions contrib/just/stop/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

12 changes: 6 additions & 6 deletions contrib/just/test/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions compose.staging.yaml → docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/dev/Backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/dev/Production.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 😨
Expand Down
2 changes: 1 addition & 1 deletion scripts/renew-certs-manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4387176

Please sign in to comment.