diff --git a/.github/workflows/additional-ci-image-checks.yml b/.github/workflows/additional-ci-image-checks.yml index f9800b0f4e62..00e83b09b601 100644 --- a/.github/workflows/additional-ci-image-checks.yml +++ b/.github/workflows/additional-ci-image-checks.yml @@ -128,8 +128,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: "Login to ghcr.io" diff --git a/.github/workflows/additional-prod-image-tests.yml b/.github/workflows/additional-prod-image-tests.yml index c6a2146ecf9f..8c5dc2d272cc 100644 --- a/.github/workflows/additional-prod-image-tests.yml +++ b/.github/workflows/additional-prod-image-tests.yml @@ -106,8 +106,8 @@ jobs: with: fetch-depth: 2 persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Login to ghcr.io @@ -152,8 +152,8 @@ jobs: with: fetch-depth: 2 persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Login to ghcr.io diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index f96997c957aa..214b5ec7d78b 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -62,8 +62,8 @@ jobs: # Need to fetch all history for selective checks tests fetch-depth: 0 persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - uses: actions/setup-python@v5 with: python-version: "${{ inputs.default-python-version }}" @@ -86,8 +86,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Setup node" uses: actions/setup-node@v4 with: @@ -116,8 +116,8 @@ jobs: with: fetch-depth: 2 persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" uses: actions/checkout@v4 with: @@ -205,8 +205,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Setup python" uses: actions/setup-python@v5 with: @@ -274,8 +274,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh # Install python from scratch. No cache used. We always want to have fresh version of everything - uses: actions/setup-python@v5 with: @@ -346,8 +346,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: "Cleanup dist files" diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 95ba2de38e2a..c530b30478a1 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -130,8 +130,8 @@ jobs: # COMPOSITE ACTIONS. WE CAN RUN ANYTHING THAT IS IN THE TARGET BRANCH AND THERE IS NO RISK THAT # CODE WILL BE RUN FROM THE PR. #################################################################################################### - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Setup python" uses: actions/setup-python@v5 with: diff --git a/.github/workflows/check-providers.yml b/.github/workflows/check-providers.yml index 7c62d5ab529e..e254264fa655 100644 --- a/.github/workflows/check-providers.yml +++ b/.github/workflows/check-providers.yml @@ -76,8 +76,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: > Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }} uses: ./.github/actions/prepare_breeze_and_image @@ -141,8 +141,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: > Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }} uses: ./.github/actions/prepare_breeze_and_image @@ -215,8 +215,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{ matrix.python-version }}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image - name: "Cleanup dist files" diff --git a/.github/workflows/ci-image-build.yml b/.github/workflows/ci-image-build.yml index 75a611ba55ab..709304f71331 100644 --- a/.github/workflows/ci-image-build.yml +++ b/.github/workflows/ci-image-build.yml @@ -169,8 +169,8 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}" # BE RUN SAFELY AS PART OF DOCKER BUILD. BECAUSE IT RUNS INSIDE THE DOCKER CONTAINER AND IT IS # ISOLATED FROM THE RUNNER. #################################################################################################### - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: inputs.do-build == 'true' - name: "Install Breeze" uses: ./.github/actions/breeze diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6a89cb9e1da..fc186ce109c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,8 +129,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: Fetch incoming commit ${{ github.sha }} with its parent uses: actions/checkout@v4 with: @@ -215,8 +215,8 @@ jobs: with: persist-credentials: false if: needs.build-info.outputs.in-workflow-build == 'false' - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: needs.build-info.outputs.in-workflow-build == 'false' - name: "Install Breeze" uses: ./.github/actions/breeze @@ -524,8 +524,8 @@ jobs: with: persist-credentials: false if: needs.build-info.outputs.in-workflow-build == 'false' - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: needs.build-info.outputs.in-workflow-build == 'false' - name: "Install Breeze" uses: ./.github/actions/breeze diff --git a/.github/workflows/finalize-tests.yml b/.github/workflows/finalize-tests.yml index 504f4a769850..9aed5d543aee 100644 --- a/.github/workflows/finalize-tests.yml +++ b/.github/workflows/finalize-tests.yml @@ -95,8 +95,8 @@ jobs: with: # Needed to perform push action persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Set constraints branch name" id: constraints-branch run: ./scripts/ci/constraints/ci_branch_constraints.sh >> ${GITHUB_OUTPUT} @@ -180,8 +180,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Download all artifacts from the current build" uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/generate-constraints.yml b/.github/workflows/generate-constraints.yml index 0adad4da3b32..d15eee6d6931 100644 --- a/.github/workflows/generate-constraints.yml +++ b/.github/workflows/generate-constraints.yml @@ -65,8 +65,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Login to ghcr.io diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml index 73a8abd1b959..094c09d9f035 100644 --- a/.github/workflows/helm-tests.yml +++ b/.github/workflows/helm-tests.yml @@ -67,8 +67,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{inputs.default-python-version}}:${{inputs.image-tag}}" uses: ./.github/actions/prepare_breeze_and_image - name: "Helm Unit Tests: ${{ matrix.helm-test-package }}" @@ -88,8 +88,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Setup git for tagging diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index abc3c631f197..da987fbffd7b 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -98,8 +98,8 @@ jobs: with: persist-credentials: false if: inputs.is-airflow-runner == 'true' || matrix.backend == 'postgres' - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: inputs.is-airflow-runner == 'true' || matrix.backend == 'postgres' - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image diff --git a/.github/workflows/k8s-tests.yml b/.github/workflows/k8s-tests.yml index 7e09efa99403..bc8f272759cb 100644 --- a/.github/workflows/k8s-tests.yml +++ b/.github/workflows/k8s-tests.yml @@ -77,8 +77,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze id: breeze diff --git a/.github/workflows/prod-image-build.yml b/.github/workflows/prod-image-build.yml index ad9c35a445af..f1468de6e32d 100644 --- a/.github/workflows/prod-image-build.yml +++ b/.github/workflows/prod-image-build.yml @@ -133,8 +133,8 @@ jobs: with: persist-credentials: false if: inputs.do-build == 'true' && inputs.upload-package-artifact == 'true' - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: inputs.do-build == 'true' && inputs.upload-package-artifact == 'true' - uses: actions/setup-python@v5 with: @@ -269,8 +269,8 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}" # BE RUN SAFELY AS PART OF DOCKER BUILD. BECAUSE IT RUNS INSIDE THE DOCKER CONTAINER AND IT IS # ISOLATED FROM THE RUNNER. #################################################################################################### - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh if: inputs.do-build == 'true' - name: "Install Breeze" uses: ./.github/actions/breeze diff --git a/.github/workflows/push-image-cache.yml b/.github/workflows/push-image-cache.yml index cb8c072e7417..686b77bcbb88 100644 --- a/.github/workflows/push-image-cache.yml +++ b/.github/workflows/push-image-cache.yml @@ -110,8 +110,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: "Start ARM instance" @@ -168,8 +168,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: "Cleanup dist and context file" diff --git a/.github/workflows/release_dockerhub_image.yml b/.github/workflows/release_dockerhub_image.yml index 2ce069cc0c3f..3e9335deefd8 100644 --- a/.github/workflows/release_dockerhub_image.yml +++ b/.github/workflows/release_dockerhub_image.yml @@ -61,8 +61,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Selective checks @@ -98,8 +98,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Install Breeze" uses: ./.github/actions/breeze - name: Free space diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index a54019da211a..86fbbf544653 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -150,8 +150,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{matrix.python-version}}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image - name: > diff --git a/.github/workflows/static-checks-mypy-docs.yml b/.github/workflows/static-checks-mypy-docs.yml index 2dcc64c9c37e..ddc9831dd8fd 100644 --- a/.github/workflows/static-checks-mypy-docs.yml +++ b/.github/workflows/static-checks-mypy-docs.yml @@ -114,8 +114,8 @@ jobs: python-version: ${{ inputs.default-python-version }} cache: 'pip' cache-dependency-path: ./dev/breeze/pyproject.toml - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{ inputs.default-python-version}}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image id: breeze @@ -158,8 +158,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image id: breeze @@ -200,8 +200,8 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - - name: Cleanup docker - uses: ./.github/actions/cleanup-docker + - name: "Cleanup docker" + run: ./scripts/ci/cleanup_docker.sh - name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}" uses: ./.github/actions/prepare_breeze_and_image - uses: actions/cache@v4 diff --git a/.github/actions/cleanup-docker/action.yml b/scripts/ci/cleanup_docker.sh old mode 100644 new mode 100755 similarity index 79% rename from .github/actions/cleanup-docker/action.yml rename to scripts/ci/cleanup_docker.sh index fa64e5b264de..039b462279fc --- a/.github/actions/cleanup-docker/action.yml +++ b/scripts/ci/cleanup_docker.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -14,13 +15,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# ---- -name: 'Cleanup docker' -description: 'Cleans up docker' -runs: - using: "composite" - steps: - - name: "Cleanup docker" - shell: bash - run: docker system prune --all --force --volumes +function cleanup_docker { + docker system prune --all --force --volumes +} + +cleanup_docker