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

Remove Docker Compose: "version" #2718

Merged
merged 8 commits into from
Mar 27, 2024
2 changes: 1 addition & 1 deletion .github/workflows/build-rdo-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
run: python3.10 -m venv /var/www/html/.venv

- name: Create scheduler release archive
run: tar -cvzf ${{ env.PKGDIR }}/scheduler_${{ env.RELEASE_VERSION }}.tar.gz --exclude=./.git* --exclude=Makefile --exclude=Dockerfile --exclude=base.yml --exclude=requirements* --exclude=tests .
run: tar -cvzf ${{ env.PKGDIR }}/scheduler_${{ env.RELEASE_VERSION }}.tar.gz --exclude=./.git* --exclude=Makefile --exclude=Dockerfile --exclude=requirements* --exclude=tests .
working-directory: ./mula

- name: Create virtual env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mula_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/checkout@v4

- name: Build the images
run: DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose -f base.yml -f .ci/docker-compose.yml build --build-arg PYTHON_VERSION=${{ matrix.version }}
run: DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker compose --project-directory . -f .ci/docker-compose.yml build --build-arg PYTHON_VERSION=${{ matrix.version }}
working-directory: ./mula

- name: Run unit tests
Expand Down
2 changes: 0 additions & 2 deletions boefjes/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
katalogus_integration:
build:
Expand Down
1 change: 0 additions & 1 deletion boefjes/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ sql_migrations
.dockerignore
export_migrations
docs
base.yml
2 changes: 1 addition & 1 deletion boefjes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ check:
## Tests
##|------------------------------------------------------------------------|

ci-docker-compose := docker compose -f base.yml -f .ci/docker-compose.yml
ci-docker-compose := docker compose --project-directory . -f .ci/docker-compose.yml


test: itest ## Run all tests.
Expand Down
1 change: 0 additions & 1 deletion boefjes/base.yml

This file was deleted.

2 changes: 0 additions & 2 deletions bytes/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
bytes_unit:
build:
Expand Down
2 changes: 1 addition & 1 deletion bytes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ migrate: ## Run alembic migrations
##|------------------------------------------------------------------------|

test: utest itest ## Run all tests.
ci-docker-compose := docker compose -f base.yml -f .ci/docker-compose.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

By changing the paths in the compose file you can sometimes resolve this already even without the --project-directory 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what you mean @Donnype, can you be more specific?

  • You want to change the path inside the compose file (tried that with context wasn't trivial to get to work...)?
  • You want to change the path of the compose file?
--project-directory string   Specify an alternate working directory
                             (default: the path of the, first specified, Compose file)

ci-docker-compose := docker compose --project-directory . -f .ci/docker-compose.yml


utest: ## Run the unit tests.
Expand Down
1 change: 0 additions & 1 deletion bytes/base.yml

This file was deleted.

2 changes: 0 additions & 2 deletions docker-compose.release-example.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# You should use this file in the following manner:
# `docker compose --env-file .env-prod -f docker-compose.release-example.yml`

version: "3.9"

services:
rabbitmq:
restart: on-failure
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
rabbitmq:
restart: unless-stopped
Expand Down
2 changes: 0 additions & 2 deletions keiko/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
ci_keiko:
healthcheck:
Expand Down
4 changes: 2 additions & 2 deletions keiko/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ test:
pytest

itest:
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml up -d --build && sleep 1
docker compose --project-directory . -f .ci/docker-compose.yml up -d --build && sleep 1
robot -d reports tests/robot
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml down --remove-orphans
docker compose --project-directory . -f .ci/docker-compose.yml down --remove-orphans

debian12:
mkdir -p build
Expand Down
1 change: 0 additions & 1 deletion keiko/docker-compose-base.yml

This file was deleted.

2 changes: 0 additions & 2 deletions mula/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
ci_scheduler_unit:
build:
Expand Down
1 change: 0 additions & 1 deletion mula/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ pyproject.toml
sql_migrations
.dockerignore
docs
base.yml
2 changes: 1 addition & 1 deletion mula/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export file
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

ci-docker-compose := docker compose -f base.yml -f .ci/docker-compose.yml
ci-docker-compose := docker compose --project-directory . -f .ci/docker-compose.yml

##
##+------------------------------------------------------------------------+
Expand Down
1 change: 0 additions & 1 deletion mula/base.yml

This file was deleted.

2 changes: 0 additions & 2 deletions octopoes/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:

rabbitmq:
Expand Down
12 changes: 5 additions & 7 deletions octopoes/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ test:
pytest

rtest:
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml kill
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml down --remove-orphans
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml up -d --build ci_octopoes ci_octopoes_api_worker
docker compose --project-directory . -f .ci/docker-compose.yml down --remove-orphans
docker compose --project-directory . -f .ci/docker-compose.yml up -d --build ci_octopoes ci_octopoes_api_worker
sleep 2
robot -d reports tests/robot

itest:
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml kill
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml build $(build_args)
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml down
docker compose -f docker-compose-base.yml -f .ci/docker-compose.yml run --rm octopoes_integration
docker compose --project-directory . -f .ci/docker-compose.yml down --remove-orphans
docker compose --project-directory . -f .ci/docker-compose.yml build $(build_args)
docker compose --project-directory . -f .ci/docker-compose.yml run --rm octopoes_integration
1 change: 0 additions & 1 deletion octopoes/base.yml

This file was deleted.

1 change: 0 additions & 1 deletion octopoes/docker-compose-base.yml

This file was deleted.

2 changes: 0 additions & 2 deletions rocky/.ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
rocky_tests:
build:
Expand Down
1 change: 0 additions & 1 deletion rocky/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ pyproject.toml
sql_migrations
.dockerignore
docs
base.yml
assets/dist
static
11 changes: 5 additions & 6 deletions rocky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ test:
python3 manage.py test

testclean:
docker compose -f .ci/docker-compose.yml kill
docker compose -f .ci/docker-compose.yml down --remove-orphans
docker compose -f .ci/docker-compose.yml build
docker compose --project-directory . -f .ci/docker-compose.yml down --remove-orphans
docker compose --project-directory . -f .ci/docker-compose.yml build

utest: testclean ## Run the unit tests.
docker compose -f .ci/docker-compose.yml run --rm rocky_tests
docker compose --project-directory . -f .ci/docker-compose.yml run --rm rocky_tests

itest: testclean ## Run the integration tests.
docker compose -f .ci/docker-compose.yml run --rm rocky_integration
docker compose --project-directory . -f .ci/docker-compose.yml run --rm rocky_integration

bench: testclean ## Run the report benchmark.
docker compose -f .ci/docker-compose.yml run --rm rocky_integration \
docker compose --project-directory . -f .ci/docker-compose.yml run --rm rocky_integration \
python -m cProfile -o .ci/bench_$$(date +%Y_%m_%d-%H:%M:%S).pstat -m pytest -m slow --no-cov tests/integration

export_migrations:
Expand Down