Skip to content

Commit

Permalink
Move cleanup-docker to a shell scripts from composite action (apache#…
Browse files Browse the repository at this point in the history
…38659)

Cleaning up docker is a single bash script to execute - it is defined
as a composite action but since it's just one bash commenad to execute,
it is better to just keep it as a bash script instead - which wil make
it easier to add other scripts.
  • Loading branch information
potiuk authored Apr 1, 2024
1 parent 39b3eb2 commit bc7b68b
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/additional-ci-image-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,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"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/additional-prod-image-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,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
Expand Down Expand Up @@ -153,8 +153,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
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,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 }}"
Expand All @@ -90,8 +90,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:
Expand Down Expand Up @@ -120,8 +120,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:
Expand Down Expand Up @@ -209,8 +209,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:
Expand Down Expand Up @@ -278,8 +278,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:
Expand Down Expand Up @@ -350,8 +350,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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,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:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/check-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,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
Expand Down Expand Up @@ -140,8 +140,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
Expand Down Expand Up @@ -214,8 +214,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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: Fetch incoming commit ${{ github.sha }} with its parent
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -216,8 +216,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
Expand Down Expand Up @@ -534,8 +534,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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/finalize-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,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}
Expand Down Expand Up @@ -185,8 +185,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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-constraints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/helm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,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 }}"
Expand All @@ -91,8 +91,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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/k8s-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "Install Breeze"
uses: ./.github/actions/breeze
id: breeze
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prod-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,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:
Expand Down Expand Up @@ -268,8 +268,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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push-image-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,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"
Expand Down Expand Up @@ -179,8 +179,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"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_dockerhub_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,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
Expand Down Expand Up @@ -94,8 +94,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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,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: >
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/static-checks-mypy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,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
Expand Down Expand Up @@ -157,8 +157,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
Expand Down Expand Up @@ -199,8 +199,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
Expand Down
16 changes: 6 additions & 10 deletions .github/actions/cleanup-docker/action.yml → scripts/ci/cleanup_docker.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit bc7b68b

Please sign in to comment.