From 554e3f82973b790aed5473f48a247eeed0a81872 Mon Sep 17 00:00:00 2001 From: Igor Sudak Date: Fri, 5 Apr 2024 21:43:52 +0000 Subject: [PATCH] Split Dockerfile.scheduler into 2 images: alts-scheduler and alts-tests --- .github/workflows/preflight.yml | 11 ++++++----- .github/workflows/run-tests.yml | 3 ++- Dockerfile.celery | 2 +- Dockerfile.scheduler | 14 ++++++++++++-- docker-compose.yml | 11 +++++++++-- requirements/{devel.txt => tests.txt} | 0 6 files changed, 30 insertions(+), 11 deletions(-) rename requirements/{devel.txt => tests.txt} (100%) diff --git a/.github/workflows/preflight.yml b/.github/workflows/preflight.yml index 4ef43c9..cdfdf60 100644 --- a/.github/workflows/preflight.yml +++ b/.github/workflows/preflight.yml @@ -51,6 +51,7 @@ jobs: uses: docker/build-push-action@v5 with: file: Dockerfile.scheduler + target: alts-tests context: . load: true cache-from: type=gha @@ -74,7 +75,7 @@ jobs: - name: Run pytest run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm --no-deps alts_tests bash -c " /usr/sbin/sshd && \ pytest -v --cov \ --junit-xml=$REPORTS_DIR/pytest-report.xml \ @@ -84,28 +85,28 @@ jobs: - name: Run pylint if: ${{ steps.changed-files.outputs.src == 'true' }} run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm alts_tests bash -c " pylint --exit-zero ${{ steps.changed-files.outputs.src_files }} \ | tee $REPORTS_DIR/pylint-report.txt" - name: Run black if: ${{ steps.changed-files.outputs.py == 'true' }} run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm alts_tests bash -c " black --check --diff --color ${{ steps.changed-files.outputs.py_files }} \ | tee >(sed 's/\x1B\[[0-9;]*m//g' > $REPORTS_DIR/black-report.txt)" - name: Run isort if: ${{ steps.changed-files.outputs.py == 'true' }} run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm alts_tests bash -c " isort --check-only --diff --color ${{ steps.changed-files.outputs.py_files }} \ | tee >(sed 's/\x1B\[[0-9;]*m//g' > $REPORTS_DIR/isort-report.txt)" - name: Run bandit if: ${{ steps.changed-files.outputs.src == 'true' }} run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm alts_tests bash -c " bandit -c pyproject.toml ${{ steps.changed-files.outputs.src_files }} \ | tee >(sed 's/\x1B\[[0-9;]*m//g' > $REPORTS_DIR/bandit-report.txt)" diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 88634d4..2b69d3f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,6 +29,7 @@ jobs: with: file: Dockerfile.scheduler context: . + target: alts-tests load: true cache-from: type=gha cache-to: type=gha,mode=max @@ -39,7 +40,7 @@ jobs: - name: Run pytest id: pytest run: | - docker compose run --rm --no-deps tests bash -c " + docker compose run --rm alts_tests bash -c " /usr/sbin/sshd && \ pytest -v --cov \ --cov-report=json:$REPORTS_DIR/pytest-report.json \ diff --git a/Dockerfile.celery b/Dockerfile.celery index d46b3f8..050fa9b 100644 --- a/Dockerfile.celery +++ b/Dockerfile.celery @@ -52,7 +52,7 @@ EOT RUN <