From ed12285278453f02eff1b72b646baa093f74317a Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Fri, 27 Oct 2023 13:01:47 +0200 Subject: [PATCH] .github/: remove docker, runc auto-update workflows These were for coreos-overlay. The packages have been moved to portage-stable and are now handled by the weekly package updates automation. Signed-off-by: Thilo Fromm --- .github/workflows/docker-apply-patch.sh | 65 ---------------------- .github/workflows/docker-release-main.yaml | 53 ------------------ .github/workflows/runc-apply-patch.sh | 51 ----------------- .github/workflows/runc-release-main.yaml | 65 ---------------------- 4 files changed, 234 deletions(-) delete mode 100755 .github/workflows/docker-apply-patch.sh delete mode 100644 .github/workflows/docker-release-main.yaml delete mode 100755 .github/workflows/runc-apply-patch.sh delete mode 100644 .github/workflows/runc-release-main.yaml diff --git a/.github/workflows/docker-apply-patch.sh b/.github/workflows/docker-apply-patch.sh deleted file mode 100755 index ac9606c45b..0000000000 --- a/.github/workflows/docker-apply-patch.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh" - -prepare_git_repo - -if ! check_remote_branch "docker-${VERSION_NEW}-${TARGET_BRANCH}"; then - echo "remote branch already exists, nothing to do" - exit 0 -fi - -pushd "${SDK_OUTER_OVERLAY}" - -VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-containers/docker/Manifest | sort -ruV | head -n1) -if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then - echo "already the latest Docker, nothing to do" - exit 0 -fi - -# we need to update not only the main ebuild file, but also its DOCKER_GITCOMMIT, -# which needs to point to COMMIT_HASH that matches with $VERSION_NEW from upstream docker-ce. -dockerEbuildOld=$(get_ebuild_filename app-containers/docker "${VERSION_OLD}") -dockerEbuildNew="app-containers/docker/docker-${VERSION_NEW}.ebuild" -git mv "${dockerEbuildOld}" "${dockerEbuildNew}" -sed -i "s/GIT_COMMIT=\(.*\)/GIT_COMMIT=${COMMIT_HASH_MOBY}/g" "${dockerEbuildNew}" -sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" "${dockerEbuildNew}" - -cliEbuildOld=$(get_ebuild_filename app-containers/docker-cli "${VERSION_OLD}") -cliEbuildNew="app-containers/docker-cli/docker-cli-${VERSION_NEW}.ebuild" -git mv "${cliEbuildOld}" "${cliEbuildNew}" -sed -i "s/GIT_COMMIT=\(.*\)/GIT_COMMIT=${COMMIT_HASH_CLI}/g" "${cliEbuildNew}" -sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" "${cliEbuildNew}" - -# update also docker versions used by the current runc ebuild file. -versionRunc=$(sed -n "s/^DIST runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-containers/runc/Manifest | sort -ruV | head -n1) -runcEbuildFile=$(get_ebuild_filename app-containers/runc "${versionRunc}") -sed -i "s/github.com\/docker\/docker-ce\/blob\/v${VERSION_OLD}/github.com\/docker\/docker-ce\/blob\/v${VERSION_NEW}/g" ${runcEbuildFile} - -popd - -# URL for Docker release notes has a specific format of -# https://docs.docker.com/engine/release-notes/MAJOR.MINOR/#COMBINEDFULLVERSION -# To get the subfolder part MAJOR.MINOR, drop the patchlevel of the semver. -# e.g. 20.10.23 -> 20.10 -# To get the combined full version, drop all dots from the full version. -# e.g. 20.10.23 -> 201023 -# So the result becomes like: -# https://docs.docker.com/engine/release-notes/20.10/#201023 -URLSUBFOLDER=${VERSION_NEW%.*} -URLVERSION="${VERSION_NEW//./}" -URL="https://docs.docker.com/engine/release-notes/${URLSUBFOLDER}/#${URLVERSION}" - -generate_update_changelog 'Docker' "${VERSION_NEW}" "${URL}" 'docker' - -regenerate_manifest app-containers/docker-cli "${VERSION_NEW}" -commit_changes app-containers/docker "${VERSION_OLD}" "${VERSION_NEW}" \ - app-containers/docker-cli \ - app-containers/runc - -cleanup_repo - -echo "VERSION_OLD=${VERSION_OLD}" >>"${GITHUB_OUTPUT}" -echo 'UPDATE_NEEDED=1' >>"${GITHUB_OUTPUT}" diff --git a/.github/workflows/docker-release-main.yaml b/.github/workflows/docker-release-main.yaml deleted file mode 100644 index 84c0ef4fca..0000000000 --- a/.github/workflows/docker-release-main.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Get the latest Docker release for main -on: - schedule: - - cron: '35 7 * * 3' - workflow_dispatch: - -jobs: - get-docker-release: - runs-on: ubuntu-latest - steps: - - name: Check out scripts - uses: actions/checkout@v3 - with: - token: ${{ secrets.BOT_PR_TOKEN }} - path: scripts - - name: Figure out latest Docker release version - id: docker-latest-release - run: | - versionCommitPairMoby=( $(git ls-remote --tags https://github.com/moby/moby | grep 'refs/tags/v[0-9]*\.[0-9]*\.[0-9]*$' | sed -e 's#^\([0-9a-fA-F]*\)[[:space:]]*refs/tags/v\(.*\)$#\2 \1#g' | sort --reverse --unique --version-sort | head --lines 1) ) - commitHashCLI=$(git ls-remote --tags https://github.com/docker/cli | grep 'refs/tags/v'"${versionCommitPairMoby[0]}"'$' | cut -f1) - - echo "VERSION_NEW=${versionCommitPairMoby[0]}" >>"${GITHUB_OUTPUT}" - echo "COMMIT_HASH_MOBY=${versionCommitPairMoby[1]}" >>"${GITHUB_OUTPUT}" - echo "COMMIT_HASH_CLI=${commitHashCLI}" >>"${GITHUB_OUTPUT}" - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - env: - WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - CHANNEL: main - run: scripts/.github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for main - id: apply-patch-main - env: - GHA_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - VERSION_NEW: ${{ steps.docker-latest-release.outputs.VERSION_NEW }} - COMMIT_HASH_MOBY: ${{ steps.docker-latest-release.outputs.COMMIT_HASH_MOBY }} - COMMIT_HASH_CLI: ${{ steps.docker-latest-release.outputs.COMMIT_HASH_CLI }} - PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} - SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} - TARGET_BRANCH: main - run: scripts/.github/workflows/docker-apply-patch.sh - - name: Create pull request for main - uses: peter-evans/create-pull-request@v5 - if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.BOT_PR_TOKEN }} - path: scripts - branch: docker-${{ steps.docker-latest-release.outputs.VERSION_NEW }}-main - base: main - title: Upgrade Docker in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.docker-latest-release.outputs.VERSION_NEW }} - body: Subject says it all. - labels: main diff --git a/.github/workflows/runc-apply-patch.sh b/.github/workflows/runc-apply-patch.sh deleted file mode 100755 index 8aa1b4a495..0000000000 --- a/.github/workflows/runc-apply-patch.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -source "${GHA_SCRIPTS_DIR}/.github/workflows/common.sh" - -prepare_git_repo - -if ! check_remote_branch "runc-${VERSION_NEW}-${TARGET_BRANCH}"; then - echo "remote branch already exists, nothing to do" - exit 0 -fi - -pushd "${SDK_OUTER_OVERLAY}" - -# Get the newest runc version, including official releases and rc -# versions. We need some sed tweaks like replacing dots with -# underscores, adding trailing underscore, sort, and trim the trailing -# underscore and replace other underscores with dots again, so that -# sort -V can properly sort "1.0.0" as newer than "1.0.0-rc95" and -# "0.0.2.1" as newer than "0.0.2". -VERSION_OLD=$(sed -n "s/^DIST runc-\([0-9]*\.[0-9]*.*\)\.tar.*/\1_/p" app-containers/runc/Manifest | tr '.' '_' | sort -ruV | sed -e 's/_$//' | tr '_' '.' | head -n1) -if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then - echo "already the latest Runc, nothing to do" - exit 0 -fi - -runcEbuildOld=$(get_ebuild_filename app-containers/runc "${VERSION_OLD}") -runcEbuildNew="app-containers/runc/runc-${VERSION_NEW}.ebuild" -git mv "${runcEbuildOld}" "${runcEbuildNew}" -sed -i "s/${VERSION_OLD}/${VERSION_NEW}/g" "${runcEbuildNew}" -sed -i "s/COMMIT_ID=\"\(.*\)\"/COMMIT_ID=\"${COMMIT_HASH}\"/g" "${runcEbuildNew}" - -# update also runc versions used by docker and containerd -sed -i "s/runc-${VERSION_OLD}/runc-${VERSION_NEW}/g" app-containers/containerd/containerd-9999.ebuild - -dockerVersion=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-containers/docker/Manifest | sort -ruV | head -n1) - -popd - -URL="https://github.com/opencontainers/runc/releases/tag/v${VERSION_NEW}" - -generate_update_changelog 'runc' "${VERSION_NEW}" "${URL}" 'runc' - -commit_changes app-containers/runc "${VERSION_OLD}" "${VERSION_NEW}" \ - app-containers/containerd - -cleanup_repo - -echo "VERSION_OLD=${VERSION_OLD}" >>"${GITHUB_OUTPUT}" -echo 'UPDATE_NEEDED=1' >>"${GITHUB_OUTPUT}" diff --git a/.github/workflows/runc-release-main.yaml b/.github/workflows/runc-release-main.yaml deleted file mode 100644 index f674810b38..0000000000 --- a/.github/workflows/runc-release-main.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: Get the latest Runc release for main -on: - schedule: - - cron: '50 7 * * 4' - workflow_dispatch: - -jobs: - get-runc-release: - runs-on: ubuntu-latest - steps: - - name: Check out scripts - uses: actions/checkout@v3 - with: - token: ${{ secrets.BOT_PR_TOKEN }} - path: scripts - - name: Figure out latest Runc release version - id: runc-latest-release - run: | - REMOTE='https://github.com/opencontainers/runc' - # Get the newest runc version, including official releases - # and rc versions. We need some sed tweaks like replacing - # dots with underscores, adding trailing underscore, sort, - # and trim the trailing underscore and replace other - # underscores with dots again, so that sort -V can properly - # sort "1.0.0" as newer than "1.0.0-rc95" and "0.0.2.1" as - # newer than "0.0.2". - versionCommitPair=( $(git ls-remote --tags "${REMOTE}" | grep 'refs/tags/v[a-z0-9._-]*$' | sed -e 's#^\([0-9a-fA-F]*\)[[:space:]]*refs/tags/v\(.*\)$#\2_ \1#g' -e 's/\./_/g' | sort --reverse --unique --version-sort --key=1,1 | sed -e 's/_ / /' -e 's/_/./g' | head --lines=1) ) - versionNew="${versionCommitPair[0]}" - # Gentoo expects an underline between version and rc, so - # "1.1.0-rc.1" becomes "1.1.0_rc.1". - versionNew="${versionNew//-/_}" - # Gentoo expects no separators between rc and the number, so - # "1.1.0_rc.1" becomes "1.1.0_rc1" - versionNew="${versionNew//rc./rc}" - commitHash="${versionCommitPair[1]}" - echo "VERSION_NEW=${versionNew}" >>"${GITHUB_OUTPUT}" - echo "COMMIT_HASH=${commitHash}" >>"${GITHUB_OUTPUT}" - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - env: - WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - CHANNEL: main - run: scripts/.github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for main - id: apply-patch-main - env: - GHA_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" - VERSION_NEW: ${{ steps.runc-latest-release.outputs.VERSION_NEW }} - COMMIT_HASH: ${{ steps.runc-latest-release.outputs.COMMIT_HASH }} - PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} - SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} - TARGET_BRANCH: main - run: scripts/.github/workflows/runc-apply-patch.sh - - name: Create pull request for main - uses: peter-evans/create-pull-request@v5 - if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.BOT_PR_TOKEN }} - path: scripts - branch: runc-${{ steps.runc-latest-release.outputs.VERSION_NEW }}-main - base: main - title: Upgrade Runc in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.runc-latest-release.outputs.VERSION_NEW }} - body: Subject says it all. - labels: main