Skip to content

Commit

Permalink
Move cleanup-docker to a shell scripts from composite action (#38659)
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit bc7b68b)
  • Loading branch information
potiuk authored and ephraimbuddy committed Apr 2, 2024
1 parent 456dff6 commit 48b47ab
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 @@ -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"
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 @@ -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
Expand Down Expand Up @@ -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
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 @@ -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 }}"
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
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 @@ -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:
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 @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
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 @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
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 @@ -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}
Expand Down Expand Up @@ -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:
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 @@ -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
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 @@ -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 }}"
Expand All @@ -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
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 @@ -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
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 @@ -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
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 @@ -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:
Expand Down Expand Up @@ -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
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 @@ -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"
Expand Down Expand Up @@ -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"
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 @@ -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
Expand Down Expand Up @@ -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
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 @@ -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: >
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 @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
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 48b47ab

Please sign in to comment.