From 6ac7367f83a54218453180e49a943ba40af97797 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 21 Feb 2020 11:22:32 +0100 Subject: [PATCH 01/42] schedule daily Github actions for Kernel This commit add 2 different Github actions that run once in a day, one for Alpha, Kernel 4.19, and the other for Edge, Kernel 5.5. Because of limitations of Github Actions, i.e. create-pull-request actions, we cannot combine the two actions into one. Also we need to create a patch and apply it to the top source directory, since the create-pull-request action requires the changes in the top directory. Although we are not updating flatcar-master branch, (only Alpha and Edge) the Github actions files need to be merged to flatcar-master, because Github actions can only schedule cron jobs from the default branch, flatcar-master. --- .../.github/workflows/kernel-apply-patch.sh | 36 ++++++++++++++ .../workflows/kernel-releases-alpha.yml | 47 +++++++++++++++++++ .../workflows/kernel-releases-edge.yml | 47 +++++++++++++++++++ .../.github/workflows/setup-flatcar-sdk.sh | 28 +++++++++++ 4 files changed, 158 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh new file mode 100755 index 0000000000..0553db0c3f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -euo pipefail + +branch="linux-${VERSION_NEW}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git checkout -B "${branch}" "github/${BASE_BRANCH}" + +versionOld=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) +[[ "${VERSION_NEW}" = "$versionOld" ]] && echo "already the latest Kernel, nothing to do" && exit 1 + +for pkg in sources modules kernel; do \ + pushd "sys-kernel/coreos-${pkg}" >/dev/null || exit; \ + git mv "coreos-${pkg}"-*.ebuild "coreos-${pkg}-${VERSION_NEW}.ebuild"; \ + sed -i -e '/^COREOS_SOURCE_REVISION=/s/=.*/=""/' "coreos-${pkg}-${VERSION_NEW}.ebuild"; \ + popd >/dev/null || exit; \ +done + +( cd ../../..; exec cork enter -- ebuild "/mnt/host/source/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-${VERSION_NEW}.ebuild" manifest --force ) + +# We can only create the actual commit in the actual source directory, not under the SDK. +# So create a format-patch, and apply to the actual source. +git add sys-kernel/coreos-* +git commit -a -m "sys-kernel/coreos-sources: Upgrade Linux ${versionOld} to ${VERSION_NEW}" +git format-patch -1 --stdout HEAD > "${branch}".patch +popd || exit + +git config user.name 'Flatcar Buildbot' +git config user.email 'buildbot@flatcar-linux.org' +git reset --hard HEAD +git fetch origin +git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +git am ~/flatcar-sdk/src/third_party/coreos-overlay/"${branch}".patch + +echo ::set-output name=VERSION_OLD::"${versionOld}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml new file mode 100644 index 0000000000..b1d5a962fa --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -0,0 +1,47 @@ +name: Get the latest Kernel release for Alpha +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + KV_ALPHA: 4.19 + run: | + git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionAlpha=$(git -C linux tag | sed -n "/^v${KV_ALPHA}.[0-9]*$/s/^v//p" | sort -ruV | head -1) + rm -rf linux + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + KERNEL_VERSION: 4.19 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml new file mode 100644 index 0000000000..1335c32f69 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -0,0 +1,47 @@ +name: Get the latest Kernel release for Edge +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + KV_EDGE: 5.5 + run: | + git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionEdge=$(git -C linux tag | sed -n "/^v${KV_EDGE}.[0-9]*$/s/^v//p" | sort -ruV | head -1) + rm -rf linux + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + KERNEL_VERSION: 5.5 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh new file mode 100755 index 0000000000..f1f09b62d3 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -euo pipefail + +curl -L -o cork https://github.com/flatcar-linux/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64 +curl -L -o cork.sig https://github.com/flatcar-linux/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64.sig +gpg --keyserver keys.gnupg.net --receive-keys 84C8E771C0DF83DFBFCAAAF03ADA89DEC2507883 +gpg --verify cork.sig cork +rm -f cork.sig +chmod +x cork +mkdir -p ~/.local/bin +mv cork ~/.local/bin + +export PATH=$PATH:$HOME/.local/bin +mkdir -p ~/flatcar-sdk + +pushd ~/flatcar-sdk || exit +cork create || true + +# /var under the chroot has to be writable by the runner user +sudo chown -R runner:docker ~/flatcar-sdk/chroot/var + +git -C src/third_party/coreos-overlay reset --hard github/flatcar-master +git -C src/third_party/coreos-overlay config user.name 'Flatcar Buildbot' +git -C src/third_party/coreos-overlay config user.email 'buildbot@flatcar-linux.org' +popd || exit + +echo ::set-output name=path::"${PATH}" From a5ef692fd1b48fe0e7b20faf00606c575dcb584c Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 6 Mar 2020 15:22:08 +0100 Subject: [PATCH 02/42] .github: fix a commit message in Kernel workflows We should use a prefix `sys-kernel`, without `coreos-sources`. --- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 0553db0c3f..cd98cb61ee 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -22,7 +22,7 @@ done # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. git add sys-kernel/coreos-* -git commit -a -m "sys-kernel/coreos-sources: Upgrade Linux ${versionOld} to ${VERSION_NEW}" +git commit -a -m "sys-kernel: Upgrade Linux ${versionOld} to ${VERSION_NEW}" git format-patch -1 --stdout HEAD > "${branch}".patch popd || exit From 4e9d98cc60b95c80371094df0fe0e4ea11a4d8da Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 9 Mar 2020 10:17:00 +0100 Subject: [PATCH 03/42] .github: do not fail if the release is already the latest Kernel If the current Flatcar release is already the latest Kernel, we should simply exit with 0, without giving a failure status 1. The `exit 1` would the otherwise result in a failure of the entire Github actions. --- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index cd98cb61ee..c37d692bc5 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -8,7 +8,7 @@ pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" versionOld=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) -[[ "${VERSION_NEW}" = "$versionOld" ]] && echo "already the latest Kernel, nothing to do" && exit 1 +[[ "${VERSION_NEW}" = "$versionOld" ]] && echo "already the latest Kernel, nothing to do" && exit for pkg in sources modules kernel; do \ pushd "sys-kernel/coreos-${pkg}" >/dev/null || exit; \ From f0db41dbb50d0ac36ec2f7dfcb13aa37c672bea6 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 9 Mar 2020 10:22:06 +0100 Subject: [PATCH 04/42] .github: schedule daily Github actions for Go Schedule daily Github actions for creating PRs for upstream Go releases, just like Kernel. --- .../.github/workflows/go-apply-patch.sh | 33 +++++++++++++ .../.github/workflows/go-releases-alpha.yml | 47 +++++++++++++++++++ .../.github/workflows/go-releases-edge.yml | 47 +++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh new file mode 100755 index 0000000000..f7cce4a7f3 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -euo pipefail + +branch="go-${VERSION_NEW}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git checkout -B "${branch}" "github/${BASE_BRANCH}" + +versionOld=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) +[[ "${VERSION_NEW}" = "${versionOld}" ]] && echo "already the latest Go, nothing to do" && exit + +pushd "dev-lang/go" >/dev/null || exit +git mv $(ls -1 go-${versionOld}*.ebuild | sort -ruV | head -n1) "go-${VERSION_NEW}.ebuild" +popd >/dev/null || exit + +( cd ../../..; exec cork enter -- ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${VERSION_NEW}.ebuild" manifest --force ) + +# We can only create the actual commit in the actual source directory, not under the SDK. +# So create a format-patch, and apply to the actual source. +git add dev-lang/go/go-${VERSION_NEW}* +git commit -a -m "dev-lang/go: Upgrade Go ${versionOld} to ${VERSION_NEW}" +git format-patch -1 --stdout HEAD > "${branch}".patch +popd || exit + +git config user.name 'Flatcar Buildbot' +git config user.email 'buildbot@flatcar-linux.org' +git reset --hard HEAD +git fetch origin +git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +git am ~/flatcar-sdk/src/third_party/coreos-overlay/"${branch}".patch + +echo ::set-output name=VERSION_OLD::"${versionOld}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml new file mode 100644 index 0000000000..bbd733af30 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -0,0 +1,47 @@ +name: Get the latest Go release for Alpha +on: + schedule: + - cron: '15 7 * * *' + +jobs: + get-go-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Go release + id: fetch-latest-release + env: + GO_VERSION: 1.13 + run: | + git clone https://github.com/golang/go + versionAlpha=$(git -C go tag | sed -n "/^go${GO_VERSION}.[0-9]*$/s/^go//p" | sort -ruV | head -1) + rm -rf go + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + GO_VERSION: 1.13 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + run: .github/workflows/go-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: go-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml new file mode 100644 index 0000000000..04ffc24a1d --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -0,0 +1,47 @@ +name: Get the latest Go release for Edge +on: + schedule: + - cron: '20 7 * * *' + +jobs: + get-go-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Go release + id: fetch-latest-release + env: + GO_VERSION: 1.13 + run: | + git clone https://github.com/golang/go + versionEdge=$(git -C go tag | sed -n "/^go${GO_VERSION}.[0-9]*$/s/^go//p" | sort -ruV | head -1) + rm -rf go + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + GO_VERSION: 1.13 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + run: .github/workflows/go-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: go-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge From 2b9e74e80cf9e1a54be71a8004b9f5531ccdf0b5 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 12 Mar 2020 17:41:41 +0100 Subject: [PATCH 05/42] .github: git shallow clone instead of full clone for kernel To reduce running time of git clone, we should avoid a full git clone of the linux kernel repo. Instead, we shallow clone the repo, and parse tags list by running `git ls-remote`. --- .../.github/workflows/kernel-releases-alpha.yml | 4 ++-- .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index b1d5a962fa..0d56f5dcb2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -15,8 +15,8 @@ jobs: env: KV_ALPHA: 4.19 run: | - git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionAlpha=$(git -C linux tag | sed -n "/^v${KV_ALPHA}.[0-9]*$/s/^v//p" | sort -ruV | head -1) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionAlpha=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_ALPHA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) rm -rf linux echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 1335c32f69..819c6aaa21 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -15,8 +15,8 @@ jobs: env: KV_EDGE: 5.5 run: | - git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionEdge=$(git -C linux tag | sed -n "/^v${KV_EDGE}.[0-9]*$/s/^v//p" | sort -ruV | head -1) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionEdge=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_EDGE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) rm -rf linux echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge From 1011b5d7a274c2ab7ecad3ca972d664a4f4fb646 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 12 Mar 2020 17:32:40 +0100 Subject: [PATCH 06/42] .github/workflows: do not clone the whole golang repo Instead of cloning the whole golang github repo, we should do a shallow clone, and parse the tags list by running `git ls-remote`. --- .../coreos-overlay/.github/workflows/go-releases-alpha.yml | 4 ++-- .../coreos-overlay/.github/workflows/go-releases-edge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index bbd733af30..6a62ef837b 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -15,8 +15,8 @@ jobs: env: GO_VERSION: 1.13 run: | - git clone https://github.com/golang/go - versionAlpha=$(git -C go tag | sed -n "/^go${GO_VERSION}.[0-9]*$/s/^go//p" | sort -ruV | head -1) + git clone --depth=1 --no-checkout https://github.com/golang/go + versionAlpha=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) rm -rf go echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index 04ffc24a1d..ba331ff2ab 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -15,8 +15,8 @@ jobs: env: GO_VERSION: 1.13 run: | - git clone https://github.com/golang/go - versionEdge=$(git -C go tag | sed -n "/^go${GO_VERSION}.[0-9]*$/s/^go//p" | sort -ruV | head -1) + git clone --depth=1 --no-checkout https://github.com/golang/go + versionEdge=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) rm -rf go echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge From f9163d93c6932d1cb093dc012bc138b1777e7fdf Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 17 Mar 2020 13:14:33 +0100 Subject: [PATCH 07/42] .github: set up coreos profiles after setting up SDK We need to set up coreos profiles under `/etc/portage/repos.conf`, to be able to run any package-related actions like `emerge` or `egencache`. Also change permissions for directories, so portage actions could write files. --- .../.github/workflows/setup-flatcar-sdk.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh index f1f09b62d3..6d5b8ea700 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -17,9 +17,32 @@ mkdir -p ~/flatcar-sdk pushd ~/flatcar-sdk || exit cork create || true +sudo tee "./chroot/etc/portage/repos.conf/coreos.conf" < Date: Wed, 18 Mar 2020 13:34:05 +0100 Subject: [PATCH 08/42] .github: schedule daily Github actions for Docker Schedule daily Github actions to get upstream Docker releases, for Alpha and Edge. We need to change more files, as Docker version is used by torcx as well as docker-runc. --- .../.github/workflows/docker-apply-patch.sh | 56 +++++++++++++++++++ .../workflows/docker-releases-alpha.yml | 47 ++++++++++++++++ .../workflows/docker-releases-edge.yml | 47 ++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh new file mode 100755 index 0000000000..6fb563fa83 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +set -euo pipefail + +branch="docker-${VERSION_NEW}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git checkout -B "${branch}" "github/${BASE_BRANCH}" + +VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && exit + +# 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. +dockerEbuildOldSymlink=$(ls -1 app-emulation/docker/docker-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) +dockerEbuildNewSymlink="app-emulation/docker/docker-${VERSION_NEW}.ebuild" +dockerEbuildMain="app-emulation/docker/docker-9999.ebuild" +git mv ${dockerEbuildOldSymlink} ${dockerEbuildNewSymlink} +sed -i "s/DOCKER_GITCOMMIT=\"\(.*\)\"/DOCKER_GITCOMMIT=\"${COMMIT_HASH}\"/g" ${dockerEbuildMain} +sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" ${dockerEbuildMain} + +# torcx ebuild file has a docker version with only major and minor versions, like 19.03. +versionTorcx=${VERSION_OLD%.*} +torcxEbuildFile=$(ls -1 app-torcx/docker/docker-${versionTorcx}*.ebuild | sort -ruV | head -n1) +sed -i "s/docker-${VERSION_OLD}/docker-${VERSION_NEW}/g" ${torcxEbuildFile} + +# update also docker versions used by the current docker-runc ebuild file. +versionRunc=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sort -ruV | head -n1) +runcEbuildFile=$(ls -1 app-emulation/docker-runc/docker-runc-${versionRunc}*.ebuild | sort -ruV | head -n1) +sed -i "s/github.com\/docker\/docker-ce\/blob\/v${VERSION_OLD}/github.com\/docker\/docker-ce\/blob\/v${VERSION_NEW}/g" ${runcEbuildFile} + +function enter() ( cd ../../..; exec cork enter -- $@ ) + +# Update manifest and regenerate metadata +enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/app-emulation/docker/docker-${VERSION_NEW}.ebuild" manifest --force + +# We can only create the actual commit in the actual source directory, not under the SDK. +# So create a format-patch, and apply to the actual source. +git add app-emulation/docker/docker-${VERSION_NEW}* app-torcx metadata +git commit -a -m "app-emulation/docker: Upgrade Docker ${VERSION_OLD} to ${VERSION_NEW}" + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos + +# Create 2 patches, one for the main ebuilds, the other for metadata changes. +git format-patch -2 HEAD +popd || exit + +git config user.name 'Flatcar Buildbot' +git config user.email 'buildbot@flatcar-linux.org' +git reset --hard HEAD +git fetch origin +git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch + +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml new file mode 100644 index 0000000000..7bb04351c0 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml @@ -0,0 +1,47 @@ +name: Get the latest Docker release for Alpha +on: + schedule: + - cron: '35 7 * * *' + +jobs: + get-docker-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Docker release + id: fetch-latest-release + run: | + git clone https://github.com/docker/docker-ce docker + versionAlpha=$(git -C docker ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitAlpha=$(git -C docker rev-parse --short=7 v${versionAlpha}) + rm -rf docker + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/docker-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: docker-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml new file mode 100644 index 0000000000..21ab313264 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml @@ -0,0 +1,47 @@ +name: Get the latest Docker release for Edge +on: + schedule: + - cron: '40 7 * * *' + +jobs: + get-docker-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Docker release + id: fetch-latest-release + run: | + git clone https://github.com/docker/docker-ce docker + versionEdge=$(git -C docker ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitEdge=$(git -C docker rev-parse --short=7 v${versionEdge}) + rm -rf docker + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/docker-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: docker-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge From 40ebacc9701b528600e083ed3344ac78600c0792 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 20 Mar 2020 07:07:58 +0100 Subject: [PATCH 09/42] .github: schedule daily Github actions for runc Schedule daily Github actions for upstream runc releases, just like Docker. In this case, we also need to update multiple repos like `app-emulation/docker`, `app-emulation/containerd`, `app-torcx/docker`, etc. --- .../.github/workflows/runc-apply-patch.sh | 53 +++++++++++++++++++ .../.github/workflows/runc-releases-alpha.yml | 47 ++++++++++++++++ .../.github/workflows/runc-releases-edge.yml | 47 ++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh new file mode 100755 index 0000000000..188716072e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +set -euo pipefail + +branch="runc-${VERSION_NEW}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git checkout -B "${branch}" "github/${BASE_BRANCH}" + +VERSION_OLD=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sort -ruV | head -n1 | tr '-' '_') +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Runc, nothing to do" && exit + +runcEbuildOld=$(ls -1 app-emulation/docker-runc/docker-runc-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) +runcEbuildNew="app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" +git mv ${runcEbuildOld} ${runcEbuildNew} +sed -i "s/${VERSION_OLD}/${VERSION_NEW}/g" ${runcEbuildNew} + +# update also runc versions used by docker and containerd +sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" app-emulation/docker/docker-9999.ebuild +sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" app-emulation/containerd/containerd-9999.ebuild + +dockerVersion=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) + +# torcx ebuild file has a docker version with only major and minor versions, like 19.03. +versionTorcx=${dockerVersion%.*} +torcxEbuildFile=$(ls -1 app-torcx/docker/docker-${versionTorcx}*.ebuild | sort -ruV | head -n1) +sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" ${torcxEbuildFile} + +function enter() ( cd ../../..; exec cork enter -- $@ ) + +# Update manifest and regenerate metadata +enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" manifest --force + +# We can only create the actual commit in the actual source directory, not under the SDK. +# So create a format-patch, and apply to the actual source. +git add app-emulation/docker-runc/docker-runc-${VERSION_NEW}* app-torcx metadata +git commit -a -m "app-emulation/docker-runc: Upgrade Runc ${VERSION_OLD} to ${VERSION_NEW}" + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos + +# Create 2 patches, one for the main ebuilds, the other for metadata changes. +git format-patch -2 HEAD +popd || exit + +git config user.name 'Flatcar Buildbot' +git config user.email 'buildbot@flatcar-linux.org' +git reset --hard HEAD +git fetch origin +git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch + +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml new file mode 100644 index 0000000000..127b180d55 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -0,0 +1,47 @@ +name: Get the latest Runc release for Alpha +on: + schedule: + - cron: '50 7 * * *' + +jobs: + get-runc-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Runc release + id: fetch-latest-release + run: | + git clone --depth=1 --no-checkout https://github.com/opencontainers/runc + # Get the newest runc version, including official releases and rc versions. + # We need some sed tweaks like adding underscore, sort, and trim the underscore again, + # so that sort -V can give the newest version including non-rc versions. + versionAlpha=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') + rm -rf runc + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/runc-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: runc-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml new file mode 100644 index 0000000000..3849a4c643 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -0,0 +1,47 @@ +name: Get the latest Runc release for Edge +on: + schedule: + - cron: '55 7 * * *' + +jobs: + get-runc-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Runc release + id: fetch-latest-release + run: | + git clone --depth=1 --no-checkout https://github.com/opencontainers/runc + # Get the newest runc version, including official releases and rc versions. + # We need some sed tweaks like adding underscore, sort, and trim the underscore again, + # so that sort -V can give the newest version including non-rc versions. + versionEdge=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') + rm -rf runc + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/runc-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: runc-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge From c33e7561c18d312d97e45394c393876cb10cdbf7 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 20 Mar 2020 07:23:39 +0100 Subject: [PATCH 10/42] .github: fix sed expressions in runc-apply-patch To be able to sort correctly between official releases and rc releases, we need to add some sed tweaks when getting the original runc version. --- .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 188716072e..333ac621fb 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -7,7 +7,10 @@ branch="runc-${VERSION_NEW}" pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" -VERSION_OLD=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sort -ruV | head -n1 | tr '-' '_') +# Get the original runc version, including official releases and rc versions. +# We need some sed tweaks like adding underscore, sort, and trim the underscore again, +# so that sort -V can give the newest version including non-rc versions. +VERSION_OLD=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sed '/-/!{s/$/_/}' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Runc, nothing to do" && exit runcEbuildOld=$(ls -1 app-emulation/docker-runc/docker-runc-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) From 9936ea88418ca74134d5f5b384f1f4ec60eaa6f3 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 30 Mar 2020 17:06:23 +0200 Subject: [PATCH 11/42] .github: schedule daily Github actions for Kernel in beta, stable Check for upstream Kernel releases once in a day, for Beta and Stable, just like it has been done for Alpha and Edge. --- .../workflows/kernel-releases-beta.yml | 47 +++++++++++++++++++ .../workflows/kernel-releases-stable.yml | 47 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml new file mode 100644 index 0000000000..4d906f210e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -0,0 +1,47 @@ +name: Get the latest Kernel release for Beta +on: + schedule: + - cron: '50 6 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + KV_BETA: 4.19 + run: | + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionBeta=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_BETA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + echo ::set-output name=VERSION_BETA::$(echo ${versionBeta}) + echo ::set-output name=BASE_BRANCH_BETA::flatcar-master-beta + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Beta + id: apply-patch-beta + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} + KERNEL_VERSION: 4.19 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for Beta + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_BETA }}-beta + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} + commit-message: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} + body: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} + labels: beta diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml new file mode 100644 index 0000000000..91b7315960 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -0,0 +1,47 @@ +name: Get the latest Kernel release for Stable +on: + schedule: + - cron: '40 6 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + KV_STABLE: 4.19 + run: | + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionStable=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_STABLE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + echo ::set-output name=VERSION_STABLE::$(echo ${versionStable}) + echo ::set-output name=BASE_BRANCH_STABLE::flatcar-master + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Stable + id: apply-patch-stable + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} + KERNEL_VERSION: 4.19 + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for Stable + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_STABLE }}-stable + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} + commit-message: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} + body: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} + labels: stable From 7e008ca73c5ccb24c9bfaddf3d138312f40056eb Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 31 Mar 2020 08:27:28 +0200 Subject: [PATCH 12/42] .github: also generate metadata on kernel-apply-patch --- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index c37d692bc5..90040c554c 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -17,7 +17,12 @@ for pkg in sources modules kernel; do \ popd >/dev/null || exit; \ done -( cd ../../..; exec cork enter -- ebuild "/mnt/host/source/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-${VERSION_NEW}.ebuild" manifest --force ) +function enter() ( cd ../../..; exec cork enter -- $@ ) + +enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-${VERSION_NEW}.ebuild" manifest --force + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. From e10e7e45b7250516d53199f822b4302f6468cf31 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 31 Mar 2020 08:29:24 +0200 Subject: [PATCH 13/42] .github: also update metadata on go-apply-patch --- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index f7cce4a7f3..cbe3c2fdab 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -14,7 +14,12 @@ pushd "dev-lang/go" >/dev/null || exit git mv $(ls -1 go-${versionOld}*.ebuild | sort -ruV | head -n1) "go-${VERSION_NEW}.ebuild" popd >/dev/null || exit -( cd ../../..; exec cork enter -- ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${VERSION_NEW}.ebuild" manifest --force ) +function enter() ( cd ../../..; exec cork enter -- $@ ) + +enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${VERSION_NEW}.ebuild" manifest --force + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. From 8bd2c35747e39b3878910e2c6b93223b48fcbb2e Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 31 Mar 2020 08:52:46 +0200 Subject: [PATCH 14/42] .github: get metadata included in the generated PRs We need to get metadata included in the generated pull requests. --- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index cbe3c2fdab..620af74163 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -23,7 +23,7 @@ enter /mnt/host/source/src/scripts/update_metadata --commit coreos # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. -git add dev-lang/go/go-${VERSION_NEW}* +git add dev-lang/go/go-${VERSION_NEW}* metadata git commit -a -m "dev-lang/go: Upgrade Go ${versionOld} to ${VERSION_NEW}" git format-patch -1 --stdout HEAD > "${branch}".patch popd || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 90040c554c..a79e436576 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -26,7 +26,7 @@ enter /mnt/host/source/src/scripts/update_metadata --commit coreos # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. -git add sys-kernel/coreos-* +git add sys-kernel/coreos-* metadata git commit -a -m "sys-kernel: Upgrade Linux ${versionOld} to ${VERSION_NEW}" git format-patch -1 --stdout HEAD > "${branch}".patch popd || exit From 0f4f3938849894c550bcfedd7778a3c3722dd45c Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 1 Apr 2020 07:55:14 +0200 Subject: [PATCH 15/42] .github: update Kernel to 5.6 for Edge Upgrade the base Kernel version from 5.5 to 5.6 for the Edge channel. --- .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 819c6aaa21..4ba3768415 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_EDGE: 5.5 + KV_EDGE: 5.6 run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux versionEdge=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_EDGE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) @@ -29,7 +29,7 @@ jobs: id: apply-patch-edge env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - KERNEL_VERSION: 5.5 + KERNEL_VERSION: 5.6 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} run: .github/workflows/kernel-apply-patch.sh From 4e33e9667ce74d9b986655725925d5b2bc86587c Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 1 Apr 2020 09:10:48 +0200 Subject: [PATCH 16/42] .github: fix metadata generation for Kernel and Go We need to generate metadata after the main commit was created. Also run git format-patch for both commits, main and metadata. --- .../.github/workflows/go-apply-patch.sh | 12 +++++++----- .../.github/workflows/kernel-apply-patch.sh | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 620af74163..3e6b3cefa3 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -18,14 +18,16 @@ function enter() ( cd ../../..; exec cork enter -- $@ ) enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${VERSION_NEW}.ebuild" manifest --force -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. git add dev-lang/go/go-${VERSION_NEW}* metadata git commit -a -m "dev-lang/go: Upgrade Go ${versionOld} to ${VERSION_NEW}" -git format-patch -1 --stdout HEAD > "${branch}".patch + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos + +# Create 2 patches, one for the main ebuilds, the other for metadata changes. +git format-patch -2 HEAD popd || exit git config user.name 'Flatcar Buildbot' @@ -33,6 +35,6 @@ git config user.email 'buildbot@flatcar-linux.org' git reset --hard HEAD git fetch origin git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/"${branch}".patch +git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch echo ::set-output name=VERSION_OLD::"${versionOld}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index a79e436576..b4c68a54c5 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -21,14 +21,16 @@ function enter() ( cd ../../..; exec cork enter -- $@ ) enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-${VERSION_NEW}.ebuild" manifest --force -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. git add sys-kernel/coreos-* metadata git commit -a -m "sys-kernel: Upgrade Linux ${versionOld} to ${VERSION_NEW}" -git format-patch -1 --stdout HEAD > "${branch}".patch + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos + +# Create 2 patches, one for the main ebuilds, the other for metadata changes. +git format-patch -2 HEAD popd || exit git config user.name 'Flatcar Buildbot' @@ -36,6 +38,6 @@ git config user.email 'buildbot@flatcar-linux.org' git reset --hard HEAD git fetch origin git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/"${branch}".patch +git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch echo ::set-output name=VERSION_OLD::"${versionOld}" From 4efb14c2a3b1ad0cf05ce68f7e009286a9b2fb11 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 2 Apr 2020 10:20:52 +0200 Subject: [PATCH 17/42] .github: check out correct base branches before applying patches Before starting to apply patches inside `coreos-overlay`, we need to check out base branches, also for `scripts` and `portage-stable`. Otherwise, in case of Beta, Alpha, or Edge, `ebuild` commands could fail due to mismatch of ebuild files across multiple repos like `coreos-overlay` and `portage-stable`. --- .../coreos-overlay/.github/workflows/docker-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 6fb563fa83..2591579fb0 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -4,7 +4,10 @@ set -euo pipefail branch="docker-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 3e6b3cefa3..12cf6af095 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -4,7 +4,10 @@ set -euo pipefail branch="go-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" versionOld=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index b4c68a54c5..47e28e29b6 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -4,7 +4,10 @@ set -euo pipefail branch="linux-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" versionOld=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 333ac621fb..28ee335f2a 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -4,7 +4,10 @@ set -euo pipefail branch="runc-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay || exit +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" # Get the original runc version, including official releases and rc versions. From a4b64568063ea48409dc54581f1dfa7fe061d380 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 3 Apr 2020 10:00:29 +0200 Subject: [PATCH 18/42] .github: use correct make.conf when setting up Flatcar SDK When setting up a Flatcar SDK from scratch, we need to also set up correct configs in `/etc/portage/make.conf`. For example we need to set `PORTDIR=/mnt/host/source/src/third_party/portage-stable` instead of the default Gentoo configs like `PORTDIR=/var/gentoo/repos/gentoo`. Otherwise `update_metadata` will fail in some cases, because portage cannot find the correct location of portage-stable. --- .../coreos-overlay/.github/workflows/setup-flatcar-sdk.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh index 6d5b8ea700..6efb0c49a5 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -17,6 +17,14 @@ mkdir -p ~/flatcar-sdk pushd ~/flatcar-sdk || exit cork create || true +sudo tee "./chroot/etc/portage/make.conf" < Date: Fri, 3 Apr 2020 15:15:50 +0200 Subject: [PATCH 19/42] .github: schedule daily Github actions for Rust Schedule daily Github actions for creating PRs for upstream Rust releases. The Github workflow will create pull request for `dev-lang/rust` in `coreos-overlay`. At the same time, it will send a repository dispatch event to `flatcar-linux/portage-stable`, to update also `virtual/rust`. We need to send different event types to distinguish alpha from edge. --- .../.github/workflows/rust-apply-patch.sh | 45 ++++++++++++++++ .../.github/workflows/rust-release-alpha.yml | 52 +++++++++++++++++++ .../.github/workflows/rust-release-edge.yml | 52 +++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh new file mode 100755 index 0000000000..b4748ba704 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -euo pipefail + +branch="rust-${VERSION_NEW}" + +git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + +pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit +git checkout -B "${branch}" "github/${BASE_BRANCH}" + +updateNeeded=1 +VERSION_OLD=$(sed -n "s/^DIST rustc-\(1.[0-9]*.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1) +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Rust, nothing to do" && updateNeeded=0 && exit + +pushd "dev-lang/rust" >/dev/null || exit +git mv $(ls -1 rust-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "rust-${VERSION_NEW}.ebuild" +popd >/dev/null || exit + +function enter() ( cd ../../.. ; exec cork enter -- "$@" ) + +enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/rust/rust-${VERSION_NEW}.ebuild" manifest --force + +# We can only create the actual commit in the actual source directory, not under the SDK. +# So create a format-patch, and apply to the actual source. +git add dev-lang/rust/{rust-${VERSION_NEW},Manifest}* +git commit -a -m "dev-lang/rust: Upgrade Rust ${VERSION_OLD} to ${VERSION_NEW}" + +# Generate metadata after the main commit was done. +enter /mnt/host/source/src/scripts/update_metadata --commit coreos + +# Create 2 patches, one for the main ebuilds, the other for metadata changes. +git format-patch -2 HEAD +popd || exit + +git config user.name 'Flatcar Buildbot' +git config user.email 'buildbot@flatcar-linux.org' +git reset --hard HEAD +git fetch origin +git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch + +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${updateNeeded}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml new file mode 100644 index 0000000000..dfdae832dd --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml @@ -0,0 +1,52 @@ +name: Get the latest Rust release for Alpha +on: + schedule: + - cron: '20 7 * * *' + +jobs: + get-rust-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Rust release + id: fetch-latest-release + run: | + git clone --depth=1 --no-checkout https://github.com/rust-lang/rust + versionAlpha=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) + rm -rf rust + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + run: .github/workflows/rust-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha + - name: Send repository dispatch to portage-stable + uses: peter-evans/repository-dispatch@v1.0.0 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.FLATCAR_PORTAGE_STABLE_ACCESS_TOKEN }} + repository: flatcar-linux/portage-stable + event-type: cargo-pull-request-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml new file mode 100644 index 0000000000..7c140ba6ba --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml @@ -0,0 +1,52 @@ +name: Get the latest Rust release for Edge +on: + schedule: + - cron: '25 7 * * *' + +jobs: + get-rust-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Rust release + id: fetch-latest-release + run: | + git clone --depth=1 --no-checkout https://github.com/rust-lang/rust + versionEdge=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) + rm -rf rust + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + run: .github/workflows/rust-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge + - name: Send repository dispatch to portage-stable + uses: peter-evans/repository-dispatch@v1.0.0 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.FLATCAR_PORTAGE_STABLE_ACCESS_TOKEN }} + repository: flatcar-linux/portage-stable + event-type: cargo-pull-request-edge From e45323dc37581beecc214e0506ee0b808b7ec03b Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 11:14:36 +0200 Subject: [PATCH 20/42] .github: split out from kernel into common.sh To avoid duplicates, we should split out common parts into separate functions in `common.sh`. Make kernel-apply-patch.sh use the helper functions. --- .../.github/workflows/common.sh | 54 +++++++++++++++++++ .../.github/workflows/kernel-apply-patch.sh | 37 ++++--------- 2 files changed, 63 insertions(+), 28 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh new file mode 100644 index 0000000000..7d9a7c8bd8 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -euo pipefail + +readonly SDK_OUTER_TOPDIR="${HOME}/flatcar-sdk" +readonly SDK_OUTER_SRCDIR="${SDK_OUTER_TOPDIR}/src" +readonly SDK_INNER_SRCDIR="/mnt/host/source/src" + +readonly BUILDBOT_USERNAME="Flatcar Buildbot" +readonly BUILDBOT_USEREMAIL="buildbot@flatcar-linux.org" + +function enter() ( cd ../../..; exec cork enter -- $@ ) + +# caller needs to set pass a parameter as a branch name to be created. +function checkout_branches() { + TARGET_BRANCH=$1 + + [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && exit 1 + + git -C "${SDK_OUTER_SRCDIR}/scripts" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + git -C "${SDK_OUTER_SRCDIR}/third_party/portage-stable" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout -B "${TARGET_BRANCH}" "github/${BASE_BRANCH}" +} + +function generate_patches() { + CATEGORY_NAME=$1 + PKGNAME_SIMPLE=$2 + PKGNAME_DESC=$3 + + pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit + + enter ebuild "${SDK_INNER_SRCDIR}/third_party/coreos-overlay/${CATEGORY_NAME}/${PKGNAME_SIMPLE}/${PKGNAME_SIMPLE}-${VERSION_NEW}.ebuild" manifest --force + + # We can only create the actual commit in the actual source directory, not under the SDK. + # So create a format-patch, and apply to the actual source. + git add ${CATEGORY_NAME}/${PKGNAME_SIMPLE} + git commit -a -m "${CATEGORY_NAME}: Upgrade ${PKGNAME_DESC} ${VERSION_OLD} to ${VERSION_NEW}" + + # Generate metadata after the main commit was done. + enter "${SDK_INNER_SRCDIR}/scripts/update_metadata" --commit coreos + + # Create 2 patches, one for the main ebuilds, the other for metadata changes. + git format-patch -2 HEAD + popd || exit +} + +function apply_patches() { + git config user.name "${BUILDBOT_USERNAME}" + git config user.email "${BUILDBOT_USEREMAIL}" + git reset --hard HEAD + git fetch origin + git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" + git am "${SDK_OUTER_SRCDIR}"/third_party/coreos-overlay/0*.patch +} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 47e28e29b6..7c9dbb7f9a 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -2,16 +2,14 @@ set -euo pipefail -branch="linux-${VERSION_NEW}" +. .github/workflows/common.sh -git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" -git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +checkout_branches "linux-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit -git checkout -B "${branch}" "github/${BASE_BRANCH}" +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit -versionOld=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) -[[ "${VERSION_NEW}" = "$versionOld" ]] && echo "already the latest Kernel, nothing to do" && exit +VERSION_OLD=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && exit for pkg in sources modules kernel; do \ pushd "sys-kernel/coreos-${pkg}" >/dev/null || exit; \ @@ -20,27 +18,10 @@ for pkg in sources modules kernel; do \ popd >/dev/null || exit; \ done -function enter() ( cd ../../..; exec cork enter -- $@ ) +popd >/dev/null || exit -enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-${VERSION_NEW}.ebuild" manifest --force +generate_patches sys-kernel coreos-{sources,kernel,modules} Linux -# We can only create the actual commit in the actual source directory, not under the SDK. -# So create a format-patch, and apply to the actual source. -git add sys-kernel/coreos-* metadata -git commit -a -m "sys-kernel: Upgrade Linux ${versionOld} to ${VERSION_NEW}" +apply_patches -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - -# Create 2 patches, one for the main ebuilds, the other for metadata changes. -git format-patch -2 HEAD -popd || exit - -git config user.name 'Flatcar Buildbot' -git config user.email 'buildbot@flatcar-linux.org' -git reset --hard HEAD -git fetch origin -git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch - -echo ::set-output name=VERSION_OLD::"${versionOld}" +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" From a292bdd1bee6a17bd5ed2b549f95618b62be1756 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 13:47:46 +0200 Subject: [PATCH 21/42] .github: rename versionOld to VERSION_OLD To make go-apply-patch.sh work with the new helpers, we need to remove `versionOld` to `VERSION_OLD`. --- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 12cf6af095..3386413e5f 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -10,11 +10,11 @@ git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit git checkout -B "${branch}" "github/${BASE_BRANCH}" -versionOld=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${versionOld}" ]] && echo "already the latest Go, nothing to do" && exit +VERSION_OLD=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && exit pushd "dev-lang/go" >/dev/null || exit -git mv $(ls -1 go-${versionOld}*.ebuild | sort -ruV | head -n1) "go-${VERSION_NEW}.ebuild" +git mv $(ls -1 go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "go-${VERSION_NEW}.ebuild" popd >/dev/null || exit function enter() ( cd ../../..; exec cork enter -- $@ ) @@ -24,7 +24,7 @@ enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${V # We can only create the actual commit in the actual source directory, not under the SDK. # So create a format-patch, and apply to the actual source. git add dev-lang/go/go-${VERSION_NEW}* metadata -git commit -a -m "dev-lang/go: Upgrade Go ${versionOld} to ${VERSION_NEW}" +git commit -a -m "dev-lang/go: Upgrade Go ${VERSION_OLD} to ${VERSION_NEW}" # Generate metadata after the main commit was done. enter /mnt/host/source/src/scripts/update_metadata --commit coreos @@ -40,4 +40,4 @@ git fetch origin git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch -echo ::set-output name=VERSION_OLD::"${versionOld}" +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" From 9575d9251c47eab36b0193aa19d9b3effeeff79f Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 13:06:02 +0200 Subject: [PATCH 22/42] .github: split out from rust into common.sh To avoid duplicates, make rust-apply-patch.sh use the helper functions in `common.sh`. --- .../.github/workflows/rust-apply-patch.sh | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index b4748ba704..7ed611b78a 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -2,13 +2,11 @@ set -euo pipefail -branch="rust-${VERSION_NEW}" +. .github/workflows/common.sh -git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" -git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +checkout_branches "rust-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit -git checkout -B "${branch}" "github/${BASE_BRANCH}" +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit updateNeeded=1 VERSION_OLD=$(sed -n "s/^DIST rustc-\(1.[0-9]*.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1) @@ -18,28 +16,11 @@ pushd "dev-lang/rust" >/dev/null || exit git mv $(ls -1 rust-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "rust-${VERSION_NEW}.ebuild" popd >/dev/null || exit -function enter() ( cd ../../.. ; exec cork enter -- "$@" ) +popd >/dev/null || exit -enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/rust/rust-${VERSION_NEW}.ebuild" manifest --force +generate_patches dev-lang rust Rust -# We can only create the actual commit in the actual source directory, not under the SDK. -# So create a format-patch, and apply to the actual source. -git add dev-lang/rust/{rust-${VERSION_NEW},Manifest}* -git commit -a -m "dev-lang/rust: Upgrade Rust ${VERSION_OLD} to ${VERSION_NEW}" - -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - -# Create 2 patches, one for the main ebuilds, the other for metadata changes. -git format-patch -2 HEAD -popd || exit - -git config user.name 'Flatcar Buildbot' -git config user.email 'buildbot@flatcar-linux.org' -git reset --hard HEAD -git fetch origin -git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch +apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" echo ::set-output name=UPDATE_NEEDED::"${updateNeeded}" From 2957eb592f27c07c86d770cddbfa8de7c5a1af73 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 13:53:33 +0200 Subject: [PATCH 23/42] .github: split out from Go into common.sh To avoid duplicates, make go-apply-patch.sh use the helper functions in `common.sh`. --- .../.github/workflows/go-apply-patch.sh | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 3386413e5f..70dc670fbb 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -2,42 +2,21 @@ set -euo pipefail -branch="go-${VERSION_NEW}" +. .github/workflows/common.sh -git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" -git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +checkout_branches "go-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit -git checkout -B "${branch}" "github/${BASE_BRANCH}" +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && exit -pushd "dev-lang/go" >/dev/null || exit -git mv $(ls -1 go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "go-${VERSION_NEW}.ebuild" +git mv $(ls -1 dev-lang/go/go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "dev-lang/go/go-${VERSION_NEW}.ebuild" + popd >/dev/null || exit -function enter() ( cd ../../..; exec cork enter -- $@ ) +generate_patches dev-lang go Go -enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/dev-lang/go/go-${VERSION_NEW}.ebuild" manifest --force - -# We can only create the actual commit in the actual source directory, not under the SDK. -# So create a format-patch, and apply to the actual source. -git add dev-lang/go/go-${VERSION_NEW}* metadata -git commit -a -m "dev-lang/go: Upgrade Go ${VERSION_OLD} to ${VERSION_NEW}" - -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - -# Create 2 patches, one for the main ebuilds, the other for metadata changes. -git format-patch -2 HEAD -popd || exit - -git config user.name 'Flatcar Buildbot' -git config user.email 'buildbot@flatcar-linux.org' -git reset --hard HEAD -git fetch origin -git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch +apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" From c74c31a83542fd1cd59629130f105b807ea49169 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 14:08:15 +0200 Subject: [PATCH 24/42] .github: split out from docker into common.sh To avoid duplicates, make docker-apply-patch.sh use the helper functions in `common.sh`. --- .../.github/workflows/docker-apply-patch.sh | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 2591579fb0..2b6293f78c 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -2,13 +2,11 @@ set -euo pipefail -branch="docker-${VERSION_NEW}" +. .github/workflows/common.sh -git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" -git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +checkout_branches "docker-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit -git checkout -B "${branch}" "github/${BASE_BRANCH}" +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && exit @@ -32,28 +30,10 @@ versionRunc=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-e runcEbuildFile=$(ls -1 app-emulation/docker-runc/docker-runc-${versionRunc}*.ebuild | sort -ruV | head -n1) sed -i "s/github.com\/docker\/docker-ce\/blob\/v${VERSION_OLD}/github.com\/docker\/docker-ce\/blob\/v${VERSION_NEW}/g" ${runcEbuildFile} -function enter() ( cd ../../..; exec cork enter -- $@ ) +popd >/dev/null || exit -# Update manifest and regenerate metadata -enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/app-emulation/docker/docker-${VERSION_NEW}.ebuild" manifest --force +generate_patches app-emulation docker Docker -# We can only create the actual commit in the actual source directory, not under the SDK. -# So create a format-patch, and apply to the actual source. -git add app-emulation/docker/docker-${VERSION_NEW}* app-torcx metadata -git commit -a -m "app-emulation/docker: Upgrade Docker ${VERSION_OLD} to ${VERSION_NEW}" - -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - -# Create 2 patches, one for the main ebuilds, the other for metadata changes. -git format-patch -2 HEAD -popd || exit - -git config user.name 'Flatcar Buildbot' -git config user.email 'buildbot@flatcar-linux.org' -git reset --hard HEAD -git fetch origin -git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch +apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" From 0d4a0194be9980663476aa6bb2eb3aea9b73c907 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 9 Apr 2020 14:22:32 +0200 Subject: [PATCH 25/42] .github: split out from runc into common.sh To avoid duplicates, make runc-apply-patch.sh use the helper functions in `common.sh`. --- .../.github/workflows/runc-apply-patch.sh | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 28ee335f2a..9c50bd4762 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -2,13 +2,11 @@ set -euo pipefail -branch="runc-${VERSION_NEW}" +. .github/workflows/common.sh -git -C ~/flatcar-sdk/src/scripts checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" -git -C ~/flatcar-sdk/src/third_party/portage-stable checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" +checkout_branches "runc-${VERSION_NEW}" -pushd ~/flatcar-sdk/src/third_party/coreos-overlay >/dev/null || exit -git checkout -B "${branch}" "github/${BASE_BRANCH}" +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit # Get the original runc version, including official releases and rc versions. # We need some sed tweaks like adding underscore, sort, and trim the underscore again, @@ -32,28 +30,10 @@ versionTorcx=${dockerVersion%.*} torcxEbuildFile=$(ls -1 app-torcx/docker/docker-${versionTorcx}*.ebuild | sort -ruV | head -n1) sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" ${torcxEbuildFile} -function enter() ( cd ../../..; exec cork enter -- $@ ) +popd >/dev/null || exit -# Update manifest and regenerate metadata -enter ebuild "/mnt/host/source/src/third_party/coreos-overlay/app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" manifest --force +generate_patches app-emulation docker-runc Runc -# We can only create the actual commit in the actual source directory, not under the SDK. -# So create a format-patch, and apply to the actual source. -git add app-emulation/docker-runc/docker-runc-${VERSION_NEW}* app-torcx metadata -git commit -a -m "app-emulation/docker-runc: Upgrade Runc ${VERSION_OLD} to ${VERSION_NEW}" - -# Generate metadata after the main commit was done. -enter /mnt/host/source/src/scripts/update_metadata --commit coreos - -# Create 2 patches, one for the main ebuilds, the other for metadata changes. -git format-patch -2 HEAD -popd || exit - -git config user.name 'Flatcar Buildbot' -git config user.email 'buildbot@flatcar-linux.org' -git reset --hard HEAD -git fetch origin -git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" -git am ~/flatcar-sdk/src/third_party/coreos-overlay/0*.patch +apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" From f6d9de2f6809c6ec404f9b1699799e5979d2b959 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 17 Apr 2020 10:33:55 +0200 Subject: [PATCH 26/42] .github: detect kernel version correctly `kernel-apply-patch.sh` cannot detect the existing kernel version, if the version does not have a patchlevel, e.g. `5.6`. So the old kernel version variable becomes an empty string, and the final pull request has an empty field after the `from` string. If the Manifest does not have a `patch-` line, try to read a `linux-` line again, to detect the correct kernel version. --- .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 7c9dbb7f9a..3eadc5d5e9 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -9,6 +9,9 @@ checkout_branches "linux-${VERSION_NEW}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) +if [[ -z "${VERSION_OLD}" ]]; then + VERSION_OLD=$(sed -n "s/^DIST linux-\(${KERNEL_VERSION}*\).*/\1/p" sys-kernel/coreos-sources/Manifest) +fi [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && exit for pkg in sources modules kernel; do \ From eba279d24f3431dcfe889e6fd670a4da2a5922c0 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 21 Apr 2020 16:24:04 +0200 Subject: [PATCH 27/42] .github: run weekly once to check for usual packages We do not need to run once in a day to check for updates from ordinary packages. Most releases happen once in more than a week. So schedule the Github actions only once in a week for most packages. Go on Mon, Rust on Tue, Docker on Wed, Runc on Thu. Note, we still need to check for Kernel once in a day, as Kernel releases happen quite often. --- .../coreos-overlay/.github/workflows/docker-releases-alpha.yml | 2 +- .../coreos-overlay/.github/workflows/docker-releases-edge.yml | 2 +- .../coreos-overlay/.github/workflows/go-releases-alpha.yml | 2 +- .../coreos-overlay/.github/workflows/go-releases-edge.yml | 2 +- .../coreos-overlay/.github/workflows/runc-releases-alpha.yml | 2 +- .../coreos-overlay/.github/workflows/runc-releases-edge.yml | 2 +- .../coreos-overlay/.github/workflows/rust-release-alpha.yml | 2 +- .../coreos-overlay/.github/workflows/rust-release-edge.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml index 7bb04351c0..1891ba4b02 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml @@ -1,7 +1,7 @@ name: Get the latest Docker release for Alpha on: schedule: - - cron: '35 7 * * *' + - cron: '35 7 * * 3' jobs: get-docker-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml index 21ab313264..c18d0aa65a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml @@ -1,7 +1,7 @@ name: Get the latest Docker release for Edge on: schedule: - - cron: '40 7 * * *' + - cron: '40 7 * * 3' jobs: get-docker-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index 6a62ef837b..e5a23c0058 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -1,7 +1,7 @@ name: Get the latest Go release for Alpha on: schedule: - - cron: '15 7 * * *' + - cron: '15 7 * * 1' jobs: get-go-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index ba331ff2ab..7b472aaa2e 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -1,7 +1,7 @@ name: Get the latest Go release for Edge on: schedule: - - cron: '20 7 * * *' + - cron: '20 7 * * 1' jobs: get-go-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml index 127b180d55..86781b6a9a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -1,7 +1,7 @@ name: Get the latest Runc release for Alpha on: schedule: - - cron: '50 7 * * *' + - cron: '50 7 * * 4' jobs: get-runc-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml index 3849a4c643..505e264078 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -1,7 +1,7 @@ name: Get the latest Runc release for Edge on: schedule: - - cron: '55 7 * * *' + - cron: '55 7 * * 4' jobs: get-runc-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml index dfdae832dd..d6230313c4 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml @@ -1,7 +1,7 @@ name: Get the latest Rust release for Alpha on: schedule: - - cron: '20 7 * * *' + - cron: '20 7 * * 2' jobs: get-rust-release: diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml index 7c140ba6ba..de88054295 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml @@ -1,7 +1,7 @@ name: Get the latest Rust release for Edge on: schedule: - - cron: '25 7 * * *' + - cron: '25 7 * * 2' jobs: get-rust-release: From 8ae55c6d779559678be5368509aaef7980063790 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 21 Apr 2020 16:40:49 +0200 Subject: [PATCH 28/42] .github: schedule weekly Github actions for containerd To get containerd in sync with upstream, we need to schedule weekly Github actions. It runs on Friday every week, only for Alpha and Edge. Similar to those for Docker, we need to deal with torcx ebuilds as well, as they contain containerd versions. --- .../workflows/containerd-apply-patch.sh | 36 ++++++++++++++ .../workflows/containerd-releases-alpha.yml | 47 +++++++++++++++++++ .../workflows/containerd-releases-edge.yml | 47 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100755 sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh new file mode 100755 index 0000000000..959ea01ed9 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -euo pipefail + +. .github/workflows/common.sh + +checkout_branches "containerd-${VERSION_NEW}" + +pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit + +VERSION_OLD=$(sed -n "s/^DIST containerd-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/containerd/Manifest | sort -ruV | head -n1) +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && exit + +DOCKER_VERSION=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) + +# we need to update not only the main ebuild file, but also its CONTAINERD_COMMIT, +# which needs to point to COMMIT_HASH that matches with $VERSION_NEW from upstream containerd. +containerdEbuildOldSymlink=$(ls -1 app-emulation/containerd/containerd-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) +containerdEbuildNewSymlink="app-emulation/containerd/containerd-${VERSION_NEW}.ebuild" +containerdEbuildMain="app-emulation/containerd/containerd-9999.ebuild" +git mv ${containerdEbuildOldSymlink} ${containerdEbuildNewSymlink} +sed -i "s/CONTAINERD_COMMIT=\"\(.*\)\"/CONTAINERD_COMMIT=\"${COMMIT_HASH}\"/g" ${containerdEbuildMain} +sed -i "s/v${VERSION_OLD}/v${VERSION_NEW}/g" ${containerdEbuildMain} + +# torcx ebuild file has a docker version with only major and minor versions, like 19.03. +versionTorcx=${DOCKER_VERSION%.*} +torcxEbuildFile=$(ls -1 app-torcx/docker/docker-${versionTorcx}*.ebuild | sort -ruV | head -n1) +sed -i "s/containerd-${VERSION_OLD}/containerd-${VERSION_NEW}/g" ${torcxEbuildFile} + +popd >/dev/null || exit + +generate_patches app-emulation containerd Containerd + +apply_patches + +echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml new file mode 100644 index 0000000000..b42ce700b6 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml @@ -0,0 +1,47 @@ +name: Get the latest Containerd release for Alpha +on: + schedule: + - cron: '00 8 * * 5' + +jobs: + get-containerd-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Containerd release + id: fetch-latest-release + run: | + git clone https://github.com/containerd/containerd + versionAlpha=$(git -C containerd ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitAlpha=$(git -C containerd rev-parse v${versionAlpha}) + rm -rf containerd + echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) + echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Alpha + id: apply-patch-alpha + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/containerd-apply-patch.sh + - name: Create pull request for Alpha + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} + branch: containerd-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + commit-message: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + body: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml new file mode 100644 index 0000000000..0989d87a42 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml @@ -0,0 +1,47 @@ +name: Get the latest Containerd release for Edge +on: + schedule: + - cron: '05 8 * * 5' + +jobs: + get-containerd-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Containerd release + id: fetch-latest-release + run: | + git clone https://github.com/containerd/containerd + versionEdge=$(git -C containerd ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitEdge=$(git -C containerd rev-parse v${versionEdge}) + rm -rf containerd + echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) + echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + env: + CORK_VERSION: 0.13.2 + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for Edge + id: apply-patch-edge + env: + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + run: .github/workflows/containerd-apply-patch.sh + - name: Create pull request for Edge + uses: peter-evans/create-pull-request@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + branch: containerd-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + commit-message: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + body: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + labels: edge From 566be32dfdbbc09c1e401fb6d1f42c015c936b56 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 22 Apr 2020 13:15:29 +0200 Subject: [PATCH 29/42] .github: update Kernel version to 5.4 for Alpha Now that Kernel was updated to 5.4 in flatcar-master-alpha, we need to update also Kernel versions for Alpha in Github actions. --- .../.github/workflows/kernel-releases-alpha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index 0d56f5dcb2..e70e3afa5b 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_ALPHA: 4.19 + KV_ALPHA: 5.4 run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux versionAlpha=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_ALPHA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) @@ -29,7 +29,7 @@ jobs: id: apply-patch-alpha env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - KERNEL_VERSION: 4.19 + KERNEL_VERSION: 5.4 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} run: .github/workflows/kernel-apply-patch.sh From 596136827b7f58cddacfc2cdaf7906d7b65337c4 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 27 Apr 2020 11:07:13 +0200 Subject: [PATCH 30/42] .github: detect latest cork version during SDK setup We do not need to specify a cork version from each Github action. Simply detect the latest version in `setup-flatcar-sdk.sh`, before downloading cork binary file from Github. Also remove the env variable for cork version from each Github action. --- .../.github/workflows/containerd-releases-alpha.yml | 2 -- .../.github/workflows/containerd-releases-edge.yml | 2 -- .../coreos-overlay/.github/workflows/docker-releases-alpha.yml | 2 -- .../coreos-overlay/.github/workflows/docker-releases-edge.yml | 2 -- .../coreos-overlay/.github/workflows/go-releases-alpha.yml | 2 -- .../coreos-overlay/.github/workflows/go-releases-edge.yml | 2 -- .../coreos-overlay/.github/workflows/kernel-releases-alpha.yml | 2 -- .../coreos-overlay/.github/workflows/kernel-releases-beta.yml | 2 -- .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 2 -- .../coreos-overlay/.github/workflows/kernel-releases-stable.yml | 2 -- .../coreos-overlay/.github/workflows/runc-releases-alpha.yml | 2 -- .../coreos-overlay/.github/workflows/runc-releases-edge.yml | 2 -- .../coreos-overlay/.github/workflows/rust-release-alpha.yml | 2 -- .../coreos-overlay/.github/workflows/rust-release-edge.yml | 2 -- .../coreos-overlay/.github/workflows/setup-flatcar-sdk.sh | 1 + 15 files changed, 1 insertion(+), 28 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml index b42ce700b6..552b395099 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml index 0989d87a42..1f0ae26ad3 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml index 1891ba4b02..69319df256 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml index c18d0aa65a..61f5f886dc 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index e5a23c0058..2ad919ac5a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index 7b472aaa2e..03fa5973ea 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index e70e3afa5b..75c7a3a9d6 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index 4d906f210e..8772d4cd10 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_BETA::flatcar-master-beta - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Beta id: apply-patch-beta diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 4ba3768415..1f756df34c 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml index 91b7315960..b6c930f31a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -22,8 +22,6 @@ jobs: echo ::set-output name=BASE_BRANCH_STABLE::flatcar-master - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Stable id: apply-patch-stable diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml index 86781b6a9a..ee133cd0ee 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -23,8 +23,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml index 505e264078..9a069482dc 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -23,8 +23,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml index d6230313c4..86f223056b 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml @@ -20,8 +20,6 @@ jobs: echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Alpha id: apply-patch-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml index de88054295..fc79842549 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml @@ -20,8 +20,6 @@ jobs: echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk - env: - CORK_VERSION: 0.13.2 run: .github/workflows/setup-flatcar-sdk.sh - name: Apply patch for Edge id: apply-patch-edge diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh index 6efb0c49a5..4536287bb6 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -2,6 +2,7 @@ set -euo pipefail +CORK_VERSION=$(curl -s https://api.github.com/repos/flatcar-linux/mantle/releases/latest | jq -r .tag_name | sed -e 's/^v//') curl -L -o cork https://github.com/flatcar-linux/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64 curl -L -o cork.sig https://github.com/flatcar-linux/mantle/releases/download/v"${CORK_VERSION}"/cork-"${CORK_VERSION}"-amd64.sig gpg --keyserver keys.gnupg.net --receive-keys 84C8E771C0DF83DFBFCAAAF03ADA89DEC2507883 From ee727b639ff38623af0f064c87af4a085ffe0b77 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 13 May 2020 12:05:23 +0200 Subject: [PATCH 31/42] .github: generate package versions from input values We do not need to specify each version from each workflow yaml file. Make *-apply.patch scripts instead generate `$VERSION_SHORT` from the input version value. --- .../coreos-overlay/.github/workflows/go-apply-patch.sh | 5 ++++- .../coreos-overlay/.github/workflows/go-releases-alpha.yml | 1 - .../coreos-overlay/.github/workflows/go-releases-edge.yml | 1 - .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 7 +++++-- .../.github/workflows/kernel-releases-alpha.yml | 1 - .../.github/workflows/kernel-releases-beta.yml | 1 - .../.github/workflows/kernel-releases-edge.yml | 1 - .../.github/workflows/kernel-releases-stable.yml | 1 - 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 70dc670fbb..260f3be396 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -2,13 +2,16 @@ set -euo pipefail +# trim the 3rd part in the input semver, e.g. from 1.14.3 to 1.14 +VERSION_SHORT=${VERSION_NEW%.*} + . .github/workflows/common.sh checkout_branches "go-${VERSION_NEW}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit -VERSION_OLD=$(sed -n "s/^DIST go\(${GO_VERSION}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) +VERSION_OLD=$(sed -n "s/^DIST go\(${VERSION_SHORT}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && exit git mv $(ls -1 dev-lang/go/go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "dev-lang/go/go-${VERSION_NEW}.ebuild" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index 2ad919ac5a..c959e5b39e 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-alpha env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - GO_VERSION: 1.13 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} run: .github/workflows/go-apply-patch.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index 03fa5973ea..d1e158abae 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-edge env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - GO_VERSION: 1.13 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} run: .github/workflows/go-apply-patch.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 3eadc5d5e9..ba72e53184 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -2,15 +2,18 @@ set -euo pipefail +# trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4 +VERSION_SHORT=${VERSION_NEW%.*} + . .github/workflows/common.sh checkout_branches "linux-${VERSION_NEW}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit -VERSION_OLD=$(sed -n "s/^DIST patch-\(${KERNEL_VERSION}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) +VERSION_OLD=$(sed -n "s/^DIST patch-\(${VERSION_SHORT}.[0-9]*\).*/\1/p" sys-kernel/coreos-sources/Manifest) if [[ -z "${VERSION_OLD}" ]]; then - VERSION_OLD=$(sed -n "s/^DIST linux-\(${KERNEL_VERSION}*\).*/\1/p" sys-kernel/coreos-sources/Manifest) + VERSION_OLD=$(sed -n "s/^DIST linux-\(${VERSION_SHORT}*\).*/\1/p" sys-kernel/coreos-sources/Manifest) fi [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index 75c7a3a9d6..ee8cc77625 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-alpha env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - KERNEL_VERSION: 5.4 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} run: .github/workflows/kernel-apply-patch.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index 8772d4cd10..c72ce7c611 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-beta env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} - KERNEL_VERSION: 4.19 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} run: .github/workflows/kernel-apply-patch.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 1f756df34c..49ea363442 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-edge env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - KERNEL_VERSION: 5.6 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} run: .github/workflows/kernel-apply-patch.sh diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml index b6c930f31a..0adc9ad24f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -27,7 +27,6 @@ jobs: id: apply-patch-stable env: BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} - KERNEL_VERSION: 4.19 PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} run: .github/workflows/kernel-apply-patch.sh From e48aa048a2d517d4fedc8ec1fe46260f7e4c3994 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 13 May 2020 12:07:24 +0200 Subject: [PATCH 32/42] .github: check out with a specific channel name When checking out into a branch name, append `-${CHANNEL}` to the name, so the branch can be distinguished from each other. To do that, make every Github actions yaml file pass in its corresponding `CHANNEL` variable. --- .../coreos-overlay/.github/workflows/containerd-apply-patch.sh | 2 +- .../.github/workflows/containerd-releases-alpha.yml | 1 + .../.github/workflows/containerd-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/docker-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/docker-releases-alpha.yml | 1 + .../coreos-overlay/.github/workflows/docker-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/go-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/go-releases-alpha.yml | 1 + .../coreos-overlay/.github/workflows/go-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/kernel-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/kernel-releases-alpha.yml | 1 + .../coreos-overlay/.github/workflows/kernel-releases-beta.yml | 1 + .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/kernel-releases-stable.yml | 1 + .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/runc-releases-alpha.yml | 1 + .../coreos-overlay/.github/workflows/runc-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/rust-apply-patch.sh | 2 +- .../coreos-overlay/.github/workflows/rust-release-alpha.yml | 1 + .../coreos-overlay/.github/workflows/rust-release-edge.yml | 1 + 20 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index 959ea01ed9..4843a1b0f9 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -4,7 +4,7 @@ set -euo pipefail . .github/workflows/common.sh -checkout_branches "containerd-${VERSION_NEW}" +checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml index 552b395099..9bf8d2d57c 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml index 1f0ae26ad3..212cbf41d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 2b6293f78c..1d0a7d2c96 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -4,7 +4,7 @@ set -euo pipefail . .github/workflows/common.sh -checkout_branches "docker-${VERSION_NEW}" +checkout_branches "docker-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml index 69319df256..660ee0163b 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml index 61f5f886dc..ddd371fc4c 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 260f3be396..7fb5a9fe84 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -7,7 +7,7 @@ VERSION_SHORT=${VERSION_NEW%.*} . .github/workflows/common.sh -checkout_branches "go-${VERSION_NEW}" +checkout_branches "go-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index c959e5b39e..35988ad786 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index d1e158abae..4911e5ccf6 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index ba72e53184..9414b99158 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -7,7 +7,7 @@ VERSION_SHORT=${VERSION_NEW%.*} . .github/workflows/common.sh -checkout_branches "linux-${VERSION_NEW}" +checkout_branches "linux-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index ee8cc77625..c8465586fe 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index c72ce7c611..06405ab41d 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Beta id: apply-patch-beta env: + CHANNEL: beta BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 49ea363442..1c40534932 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml index 0adc9ad24f..282a3cb1d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -26,6 +26,7 @@ jobs: - name: Apply patch for Stable id: apply-patch-stable env: + CHANNEL: stable BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 9c50bd4762..869cab4342 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -4,7 +4,7 @@ set -euo pipefail . .github/workflows/common.sh -checkout_branches "runc-${VERSION_NEW}" +checkout_branches "runc-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml index ee133cd0ee..9b3f086c16 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -27,6 +27,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml index 9a069482dc..f27af03c1f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -27,6 +27,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index 7ed611b78a..e8e2a6c25e 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -4,7 +4,7 @@ set -euo pipefail . .github/workflows/common.sh -checkout_branches "rust-${VERSION_NEW}" +checkout_branches "rust-${VERSION_NEW}-${CHANNEL}" pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml index 86f223056b..40ec4adeb2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml @@ -24,6 +24,7 @@ jobs: - name: Apply patch for Alpha id: apply-patch-alpha env: + CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml index fc79842549..ae86d4c962 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml @@ -24,6 +24,7 @@ jobs: - name: Apply patch for Edge id: apply-patch-edge env: + CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} From 730ae316781a7971d654fa277b7a27876fc18dad Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 13 May 2020 14:13:04 +0200 Subject: [PATCH 33/42] .github: skip branch checkout if it exists In case the target branch already exists, `checkout_branch()` needs to simply `exit 0`, so the subsequent steps could be skipped. In that case, it has to set `UPDATE_NEEDED` to 0, so the Github action could avoiding creating another PR. It resolves occasional issues that happen when subsequent PRs overwrite existing open PRs made on the very same version. It would be no problem if there was no change in the PR. However, if there was any manual change in the previous open PR, the change will be simply overwritten. That would be very unfortunate. --- .../coreos-overlay/.github/workflows/common.sh | 8 +++++++- .../.github/workflows/containerd-apply-patch.sh | 7 +++++-- .../.github/workflows/containerd-releases-alpha.yml | 1 + .../.github/workflows/containerd-releases-edge.yml | 1 + .../.github/workflows/docker-apply-patch.sh | 7 +++++-- .../.github/workflows/docker-releases-alpha.yml | 1 + .../.github/workflows/docker-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/go-apply-patch.sh | 6 ++++-- .../.github/workflows/go-releases-alpha.yml | 1 + .../.github/workflows/go-releases-edge.yml | 1 + .../.github/workflows/kernel-apply-patch.sh | 6 ++++-- .../.github/workflows/kernel-releases-alpha.yml | 1 + .../.github/workflows/kernel-releases-beta.yml | 1 + .../.github/workflows/kernel-releases-edge.yml | 1 + .../.github/workflows/kernel-releases-stable.yml | 1 + .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 7 +++++-- .../.github/workflows/runc-releases-alpha.yml | 1 + .../.github/workflows/runc-releases-edge.yml | 1 + .../coreos-overlay/.github/workflows/rust-apply-patch.sh | 9 +++++---- 19 files changed, 47 insertions(+), 15 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 7d9a7c8bd8..4e898574e2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -15,10 +15,16 @@ function enter() ( cd ../../..; exec cork enter -- $@ ) function checkout_branches() { TARGET_BRANCH=$1 - [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && exit 1 + [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && exit 0 git -C "${SDK_OUTER_SRCDIR}/scripts" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" git -C "${SDK_OUTER_SRCDIR}/third_party/portage-stable" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" + + if git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" show-ref "remotes/github/${TARGET_BRANCH}"; then + echo "Target branch already exists. exit."; + exit 0 + fi + git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout -B "${TARGET_BRANCH}" "github/${BASE_BRANCH}" } diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index 4843a1b0f9..b79ff43e8e 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -2,14 +2,16 @@ set -euo pipefail +UPDATE_NEEDED=1 + . .github/workflows/common.sh -checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}" +checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST containerd-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/containerd/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && UPDATE_NEEDED=0 && exit 0 DOCKER_VERSION=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) @@ -34,3 +36,4 @@ generate_patches app-emulation containerd Containerd apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml index 9bf8d2d57c..cfdef73bb9 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/containerd-apply-patch.sh - name: Create pull request for Alpha uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml index 212cbf41d2..b68fc65bcb 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/containerd-apply-patch.sh - name: Create pull request for Edge uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 1d0a7d2c96..ef440e8ca7 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -2,14 +2,16 @@ set -euo pipefail +UPDATE_NEEDED=1 + . .github/workflows/common.sh -checkout_branches "docker-${VERSION_NEW}-${CHANNEL}" +checkout_branches "docker-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && UPDATE_NEEDED=0 && exit 0 # 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. @@ -37,3 +39,4 @@ generate_patches app-emulation docker Docker apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml index 660ee0163b..f929ab40f9 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/docker-apply-patch.sh - name: Create pull request for Alpha uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml index ddd371fc4c..0073985ddc 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/docker-apply-patch.sh - name: Create pull request for Edge uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 7fb5a9fe84..1ea6abd3eb 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -4,15 +4,16 @@ set -euo pipefail # trim the 3rd part in the input semver, e.g. from 1.14.3 to 1.14 VERSION_SHORT=${VERSION_NEW%.*} +UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "go-${VERSION_NEW}-${CHANNEL}" +checkout_branches "go-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST go\(${VERSION_SHORT}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && UPDATE_NEEDED=0 && exit 0 git mv $(ls -1 dev-lang/go/go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "dev-lang/go/go-${VERSION_NEW}.ebuild" @@ -23,3 +24,4 @@ generate_patches dev-lang go Go apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml index 35988ad786..9f19310512 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/go-apply-patch.sh - name: Create pull request for Alpha uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml index 4911e5ccf6..c4b6950b98 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/go-apply-patch.sh - name: Create pull request for Edge uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 9414b99158..ec471e9bf5 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -4,10 +4,11 @@ set -euo pipefail # trim the 3rd part in the input semver, e.g. from 5.4.1 to 5.4 VERSION_SHORT=${VERSION_NEW%.*} +UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "linux-${VERSION_NEW}-${CHANNEL}" +checkout_branches "linux-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit @@ -15,7 +16,7 @@ VERSION_OLD=$(sed -n "s/^DIST patch-\(${VERSION_SHORT}.[0-9]*\).*/\1/p" sys-kern if [[ -z "${VERSION_OLD}" ]]; then VERSION_OLD=$(sed -n "s/^DIST linux-\(${VERSION_SHORT}*\).*/\1/p" sys-kernel/coreos-sources/Manifest) fi -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && UPDATE_NEEDED=0 && exit 0 for pkg in sources modules kernel; do \ pushd "sys-kernel/coreos-${pkg}" >/dev/null || exit; \ @@ -31,3 +32,4 @@ generate_patches sys-kernel coreos-{sources,kernel,modules} Linux apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml index c8465586fe..41fecdee4f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for Alpha uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index 06405ab41d..053752d206 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for Beta uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-beta.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index 1c40534932..fbb5f10fb2 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for Edge uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml index 282a3cb1d2..00e967b4db 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -33,6 +33,7 @@ jobs: run: .github/workflows/kernel-apply-patch.sh - name: Create pull request for Stable uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-stable.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 869cab4342..5abbc53ece 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -2,9 +2,11 @@ set -euo pipefail +UPDATE_NEEDED=1 + . .github/workflows/common.sh -checkout_branches "runc-${VERSION_NEW}-${CHANNEL}" +checkout_branches "runc-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit @@ -12,7 +14,7 @@ pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit # We need some sed tweaks like adding underscore, sort, and trim the underscore again, # so that sort -V can give the newest version including non-rc versions. VERSION_OLD=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sed '/-/!{s/$/_/}' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Runc, nothing to do" && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Runc, nothing to do" && UPDATE_NEEDED=0 && exit 0 runcEbuildOld=$(ls -1 app-emulation/docker-runc/docker-runc-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) runcEbuildNew="app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" @@ -37,3 +39,4 @@ generate_patches app-emulation docker-runc Runc apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml index 9b3f086c16..b45a94debd 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/runc-apply-patch.sh - name: Create pull request for Alpha uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml index f27af03c1f..8c0297fc8f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -34,6 +34,7 @@ jobs: run: .github/workflows/runc-apply-patch.sh - name: Create pull request for Edge uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index e8e2a6c25e..6fd9376195 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -2,15 +2,16 @@ set -euo pipefail +UPDATE_NEEDED=1 + . .github/workflows/common.sh -checkout_branches "rust-${VERSION_NEW}-${CHANNEL}" +checkout_branches "rust-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit -updateNeeded=1 VERSION_OLD=$(sed -n "s/^DIST rustc-\(1.[0-9]*.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Rust, nothing to do" && updateNeeded=0 && exit +[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Rust, nothing to do" && UPDATE_NEEDED=0 && exit 0 pushd "dev-lang/rust" >/dev/null || exit git mv $(ls -1 rust-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "rust-${VERSION_NEW}.ebuild" @@ -23,4 +24,4 @@ generate_patches dev-lang rust Rust apply_patches echo ::set-output name=VERSION_OLD::"${VERSION_OLD}" -echo ::set-output name=UPDATE_NEEDED::"${updateNeeded}" +echo ::set-output name=UPDATE_NEEDED::"${UPDATE_NEEDED}" From b330d540429e6f4e04981a286d85e7e43feac1c1 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 14 May 2020 16:03:57 +0200 Subject: [PATCH 34/42] .github: update Kernel version to 5.4 for beta Now that we updated Kernel to 5.4 for Beta, we also need to set Kernel version to 5.4 in Github Actions. --- .../coreos-overlay/.github/workflows/kernel-releases-beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml index 053752d206..b5ff239c45 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_BETA: 4.19 + KV_BETA: 5.4 run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux versionBeta=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_BETA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) From e4c1f9b59ae8c6d3b4e83ee33eaed4814c924dd3 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Wed, 20 May 2020 10:42:09 +0200 Subject: [PATCH 35/42] .github: correctly check status of checkout_branches `exit` command will simply fail the whole script, so it would not be possible to check for status of `checkout_branches`. Instead, we need to use `return` for the error checks. --- .../coreos-overlay/.github/workflows/common.sh | 4 ++-- .../.github/workflows/containerd-apply-patch.sh | 11 +++++++++-- .../.github/workflows/docker-apply-patch.sh | 11 +++++++++-- .../.github/workflows/go-apply-patch.sh | 11 +++++++++-- .../.github/workflows/kernel-apply-patch.sh | 11 +++++++++-- .../.github/workflows/runc-apply-patch.sh | 11 +++++++++-- .../.github/workflows/rust-apply-patch.sh | 11 +++++++++-- 7 files changed, 56 insertions(+), 14 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 4e898574e2..da9298aef3 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -15,14 +15,14 @@ function enter() ( cd ../../..; exec cork enter -- $@ ) function checkout_branches() { TARGET_BRANCH=$1 - [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && exit 0 + [[ -z "${TARGET_BRANCH}" ]] && echo "No target branch specified. exit." && return 1 git -C "${SDK_OUTER_SRCDIR}/scripts" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" git -C "${SDK_OUTER_SRCDIR}/third_party/portage-stable" checkout -B "${BASE_BRANCH}" "github/${BASE_BRANCH}" if git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" show-ref "remotes/github/${TARGET_BRANCH}"; then echo "Target branch already exists. exit."; - exit 0 + return 1 fi git -C "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" checkout -B "${TARGET_BRANCH}" "github/${BASE_BRANCH}" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index b79ff43e8e..8d15ec3cc1 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -6,12 +6,19 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST containerd-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/containerd/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Containerd, nothing to do" + UPDATE_NEEDED=0 + exit 0 +fi DOCKER_VERSION=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index ef440e8ca7..52c8c4ab37 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -6,12 +6,19 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "docker-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "docker-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST docker-\([0-9]*.[0-9]*.[0-9]*\).*/\1/p" app-emulation/docker/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Docker, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Docker, nothing to do" + UPDATE_NEEDED=0 + 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. diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 1ea6abd3eb..d021191589 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -8,12 +8,19 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "go-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "go-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST go\(${VERSION_SHORT}.[0-9]*\).*/\1/p" dev-lang/go/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Go, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Go, nothing to do" + UPDATE_NEEDED=0 + exit 0 +fi git mv $(ls -1 dev-lang/go/go-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "dev-lang/go/go-${VERSION_NEW}.ebuild" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index ec471e9bf5..3425a5e366 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -8,7 +8,10 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "linux-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "linux-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit @@ -16,7 +19,11 @@ VERSION_OLD=$(sed -n "s/^DIST patch-\(${VERSION_SHORT}.[0-9]*\).*/\1/p" sys-kern if [[ -z "${VERSION_OLD}" ]]; then VERSION_OLD=$(sed -n "s/^DIST linux-\(${VERSION_SHORT}*\).*/\1/p" sys-kernel/coreos-sources/Manifest) fi -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Kernel, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Kernel, nothing to do" + UPDATE_NEEDED=0 + exit 0 +fi for pkg in sources modules kernel; do \ pushd "sys-kernel/coreos-${pkg}" >/dev/null || exit; \ diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 5abbc53ece..bd3ed10cb9 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -6,7 +6,10 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "runc-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "runc-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit @@ -14,7 +17,11 @@ pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit # We need some sed tweaks like adding underscore, sort, and trim the underscore again, # so that sort -V can give the newest version including non-rc versions. VERSION_OLD=$(sed -n "s/^DIST docker-runc-\([0-9]*.[0-9]*.*\)\.tar.*/\1/p" app-emulation/docker-runc/Manifest | sed '/-/!{s/$/_/}' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Runc, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Runc, nothing to do" + UPDATE_NEEDED=0 + exit 0 +fi runcEbuildOld=$(ls -1 app-emulation/docker-runc/docker-runc-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) runcEbuildNew="app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index 6fd9376195..83d0864630 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -6,12 +6,19 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -checkout_branches "rust-${VERSION_NEW}-${CHANNEL}" || UPDATE_NEEDED=0 && exit 0 +if ! checkout_branches "rust-${VERSION_NEW}-${CHANNEL}"; then + UPDATE_NEEDED=0 + exit 0 +fi pushd "${SDK_OUTER_SRCDIR}/third_party/coreos-overlay" >/dev/null || exit VERSION_OLD=$(sed -n "s/^DIST rustc-\(1.[0-9]*.[0-9]*\).*/\1/p" dev-lang/rust/Manifest | sort -ruV | head -n1) -[[ "${VERSION_NEW}" = "${VERSION_OLD}" ]] && echo "already the latest Rust, nothing to do" && UPDATE_NEEDED=0 && exit 0 +if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then + echo "already the latest Rust, nothing to do" + UPDATE_NEEDED=0 + exit 0 +fi pushd "dev-lang/rust" >/dev/null || exit git mv $(ls -1 rust-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "rust-${VERSION_NEW}.ebuild" From ee7960d64ee7f3b20d4ac5cc23e3a0573eed1285 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 4 Jun 2020 17:24:51 +0200 Subject: [PATCH 36/42] .github: fix version format in docker-runc docker-runc ebuild has lines of runc versions with not only underscore (`_`) but also hyphen (`-`). So when we replace the runc version, we need to also care about versions with hyphen, for example, `1.0.0-rc10`. --- .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index bd3ed10cb9..bc109a075d 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -28,6 +28,12 @@ runcEbuildNew="app-emulation/docker-runc/docker-runc-${VERSION_NEW}.ebuild" git mv ${runcEbuildOld} ${runcEbuildNew} sed -i "s/${VERSION_OLD}/${VERSION_NEW}/g" ${runcEbuildNew} +# docker-runc ebuild file has also lines of runc versions with '-' instead of '_', e.g. '1.0.0-rc10' +VERSION_OLD_HYPHEN=${VERSION_OLD//_/-} +VERSION_NEW_HYPHEN=${VERSION_NEW//_/-} + +sed -i "s/${VERSION_OLD_HYPHEN}/${VERSION_NEW_HYPHEN}/g" ${runcEbuildNew} + # update also runc versions used by docker and containerd sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" app-emulation/docker/docker-9999.ebuild sed -i "s/docker-runc-${VERSION_OLD}/docker-runc-${VERSION_NEW}/g" app-emulation/containerd/containerd-9999.ebuild From faf94bbe2096f3af62d418264cd98a5ccbb9ca4d Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Mon, 22 Jun 2020 12:32:29 +0200 Subject: [PATCH 37/42] .github: update rust versions also in profiles We need to update rust versions also in multiple files in profiles, e.g. `package.accept_keywords`. Otherwise `emerge rust` will fail, due to mismatches between rust versions, in profiles and the actual ebuilds. --- .../coreos-overlay/.github/workflows/rust-apply-patch.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index 83d0864630..f17c80f8ee 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -20,6 +20,9 @@ if [[ "${VERSION_NEW}" = "${VERSION_OLD}" ]]; then exit 0 fi +# replace rust version in profiles/, e.g. package.accept_keywords. +find profiles -name 'package.*' | xargs sed -i "s/=dev-lang\/rust-${VERSION_OLD}/=dev-lang\/rust-${VERSION_NEW}/" + pushd "dev-lang/rust" >/dev/null || exit git mv $(ls -1 rust-${VERSION_OLD}*.ebuild | sort -ruV | head -n1) "rust-${VERSION_NEW}.ebuild" popd >/dev/null || exit From 39b5c5d2e037048db17a01bafe4a1719849790f4 Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Mon, 22 Jun 2020 22:00:06 +0530 Subject: [PATCH 38/42] .github/workflows: Update the kernel release edge version to 5.7 Signed-off-by: Sayan Chowdhury --- .../coreos-overlay/.github/workflows/kernel-releases-edge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml index fbb5f10fb2..a8152c3efc 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml @@ -13,7 +13,7 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_EDGE: 5.6 + KV_EDGE: 5.7 run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux versionEdge=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_EDGE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) From bb6a5945f45b3a06d39af0c45337c46ac1c31daf Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 2 Jul 2020 15:15:00 +0200 Subject: [PATCH 39/42] .github: replace COMMIT_ID in runc ebuilds So far Github actions have not changed existing `COMMIT_ID` variable in runc ebuilds. As a result, the result PRs have correct versions with wrong commit hashes. We need to replace `COMMIT_ID` with one that matches with the new version. To do that, clone the repo completely, since it is not possible to get the commit hash by running `git rev-parse` on a shallow cloned repo. Parse commit from a tag with an original version with `-` as its delimiter, e.g. `v1.0.0-rc91`, because a transformed tag like `v1.0.0_rc91` does not exist in the upstream repo. --- .../coreos-overlay/.github/workflows/runc-apply-patch.sh | 1 + .../.github/workflows/runc-releases-alpha.yml | 8 ++++++-- .../.github/workflows/runc-releases-edge.yml | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index bc109a075d..5e59bfdf95 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -27,6 +27,7 @@ runcEbuildOld=$(ls -1 app-emulation/docker-runc/docker-runc-${VERSION_OLD}*.ebui runcEbuildNew="app-emulation/docker-runc/docker-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} # docker-runc ebuild file has also lines of runc versions with '-' instead of '_', e.g. '1.0.0-rc10' VERSION_OLD_HYPHEN=${VERSION_OLD//_/-} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml index b45a94debd..2d8e72aa09 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml @@ -13,13 +13,16 @@ jobs: - name: Fetch latest Runc release id: fetch-latest-release run: | - git clone --depth=1 --no-checkout https://github.com/opencontainers/runc + git clone https://github.com/opencontainers/runc # Get the newest runc version, including official releases and rc versions. # We need some sed tweaks like adding underscore, sort, and trim the underscore again, # so that sort -V can give the newest version including non-rc versions. - versionAlpha=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') + versionAlpha=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1) + commitAlpha="$(git -C runc rev-parse v${versionAlpha})" + versionAlpha="${versionAlpha//-/_}" rm -rf runc echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) + echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - name: Set up Flatcar SDK id: setup-flatcar-sdk @@ -30,6 +33,7 @@ jobs: CHANNEL: alpha BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} run: .github/workflows/runc-apply-patch.sh - name: Create pull request for Alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml index 8c0297fc8f..ec7b1c9157 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml @@ -13,13 +13,16 @@ jobs: - name: Fetch latest Runc release id: fetch-latest-release run: | - git clone --depth=1 --no-checkout https://github.com/opencontainers/runc + git clone https://github.com/opencontainers/runc # Get the newest runc version, including official releases and rc versions. # We need some sed tweaks like adding underscore, sort, and trim the underscore again, # so that sort -V can give the newest version including non-rc versions. - versionEdge=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1 | tr '-' '_') + versionEdge=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1) + commitEdge="$(git -C runc rev-parse v${versionEdge})" + versionEdge="${versionEdge//-/_}" rm -rf runc echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) + echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - name: Set up Flatcar SDK id: setup-flatcar-sdk @@ -30,6 +33,7 @@ jobs: CHANNEL: edge BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} run: .github/workflows/runc-apply-patch.sh - name: Create pull request for Edge From 4e258345495d3150fec32d8e24d9e2637aa78a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 23 Jul 2020 19:26:09 +0200 Subject: [PATCH 40/42] .github: Only update the new main branch The new main branch is the only branch that should get new software updates with the exception of the maintenance branches that get kernel updates. Only target the main branch with GitHub Actions until we add discovery for all active channel maintenance branches. --- .../workflows/containerd-apply-patch.sh | 2 +- .../workflows/containerd-releases-alpha.yml | 47 ----------------- ...-edge.yml => containerd-releases-main.yml} | 42 +++++++-------- .../.github/workflows/docker-apply-patch.sh | 2 +- .../workflows/docker-releases-alpha.yml | 47 ----------------- ...ases-edge.yml => docker-releases-main.yml} | 42 +++++++-------- .../.github/workflows/go-apply-patch.sh | 2 +- .../.github/workflows/go-releases-alpha.yml | 46 ----------------- ...releases-edge.yml => go-releases-main.yml} | 36 ++++++------- .../.github/workflows/kernel-apply-patch.sh | 2 +- .../workflows/kernel-releases-alpha.yml | 46 ----------------- .../workflows/kernel-releases-beta.yml | 46 ----------------- ...ases-edge.yml => kernel-releases-main.yml} | 36 ++++++------- .../workflows/kernel-releases-stable.yml | 46 ----------------- .../.github/workflows/runc-apply-patch.sh | 2 +- .../.github/workflows/runc-releases-alpha.yml | 51 ------------------- ...leases-edge.yml => runc-releases-main.yml} | 44 ++++++++-------- .../.github/workflows/rust-apply-patch.sh | 2 +- .../.github/workflows/rust-release-alpha.yml | 51 ------------------- ...release-edge.yml => rust-release-main.yml} | 40 +++++++-------- .../.github/workflows/setup-flatcar-sdk.sh | 2 +- 21 files changed, 127 insertions(+), 507 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{containerd-releases-edge.yml => containerd-releases-main.yml} (52%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{docker-releases-edge.yml => docker-releases-main.yml} (52%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{go-releases-edge.yml => go-releases-main.yml} (58%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{kernel-releases-edge.yml => kernel-releases-main.yml} (52%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{runc-releases-edge.yml => runc-releases-main.yml} (56%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml rename sdk_container/src/third_party/coreos-overlay/.github/workflows/{rust-release-edge.yml => rust-release-main.yml} (56%) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index 8d15ec3cc1..a0daef3f19 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -6,7 +6,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "containerd-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "containerd-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml deleted file mode 100644 index cfdef73bb9..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-alpha.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Get the latest Containerd release for Alpha -on: - schedule: - - cron: '00 8 * * 5' - -jobs: - get-containerd-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Containerd release - id: fetch-latest-release - run: | - git clone https://github.com/containerd/containerd - versionAlpha=$(git -C containerd ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) - commitAlpha=$(git -C containerd rev-parse v${versionAlpha}) - rm -rf containerd - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - run: .github/workflows/containerd-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: containerd-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Containerd in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml similarity index 52% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml index b68fc65bcb..fdbb9faefc 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-releases-main.yml @@ -1,7 +1,7 @@ -name: Get the latest Containerd release for Edge +name: Get the latest Containerd release for main on: schedule: - - cron: '05 8 * * 5' + - cron: '00 8 * * 5' jobs: get-containerd-release: @@ -14,34 +14,34 @@ jobs: id: fetch-latest-release run: | git clone https://github.com/containerd/containerd - versionEdge=$(git -C containerd ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) - commitEdge=$(git -C containerd rev-parse v${versionEdge}) + versionMain=$(git -C containerd ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitMain=$(git -C containerd rev-parse v${versionMain}) rm -rf containerd - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=COMMIT_MAIN::$(echo ${commitMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} run: .github/workflows/containerd-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: containerd-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: containerd-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Containerd in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Containerd in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Containerd in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Containerd in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 52c8c4ab37..62a98d5943 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -6,7 +6,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "docker-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "docker-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml deleted file mode 100644 index f929ab40f9..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-alpha.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Get the latest Docker release for Alpha -on: - schedule: - - cron: '35 7 * * 3' - -jobs: - get-docker-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Docker release - id: fetch-latest-release - run: | - git clone https://github.com/docker/docker-ce docker - versionAlpha=$(git -C docker ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) - commitAlpha=$(git -C docker rev-parse --short=7 v${versionAlpha}) - rm -rf docker - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - run: .github/workflows/docker-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: docker-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Docker in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml similarity index 52% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml index 0073985ddc..fe31017e03 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-releases-main.yml @@ -1,7 +1,7 @@ -name: Get the latest Docker release for Edge +name: Get the latest Docker release for main on: schedule: - - cron: '40 7 * * 3' + - cron: '35 7 * * 3' jobs: get-docker-release: @@ -14,34 +14,34 @@ jobs: id: fetch-latest-release run: | git clone https://github.com/docker/docker-ce docker - versionEdge=$(git -C docker ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) - commitEdge=$(git -C docker rev-parse --short=7 v${versionEdge}) + versionMain=$(git -C docker ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*$/s/^refs\/tags\/v//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -n1) + commitMain=$(git -C docker rev-parse --short=7 v${versionMain}) rm -rf docker - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=COMMIT_MAIN::$(echo ${commitMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} run: .github/workflows/docker-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: docker-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: docker-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Docker in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Docker in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Docker in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Docker in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index d021191589..c6efd78d0f 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -8,7 +8,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "go-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "go-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml deleted file mode 100644 index 9f19310512..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-alpha.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Get the latest Go release for Alpha -on: - schedule: - - cron: '15 7 * * 1' - -jobs: - get-go-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Go release - id: fetch-latest-release - env: - GO_VERSION: 1.13 - run: | - git clone --depth=1 --no-checkout https://github.com/golang/go - versionAlpha=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) - rm -rf go - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - run: .github/workflows/go-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: go-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Go in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml similarity index 58% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml index c4b6950b98..2a46bced8b 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-releases-main.yml @@ -1,7 +1,7 @@ -name: Get the latest Go release for Edge +name: Get the latest Go release for main on: schedule: - - cron: '20 7 * * 1' + - cron: '15 7 * * 1' jobs: get-go-release: @@ -16,31 +16,31 @@ jobs: GO_VERSION: 1.13 run: | git clone --depth=1 --no-checkout https://github.com/golang/go - versionEdge=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) + versionMain=$(git -C go ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/go${GO_VERSION}.[0-9]*$/s/^refs\/tags\/go//p" | egrep -v -e '(beta|rc)' | sort -ruV | head -1) rm -rf go - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} run: .github/workflows/go-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: go-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: go-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Go in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Go in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Go in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Go in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index 3425a5e366..0c17dfceea 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -8,7 +8,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "linux-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "linux-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml deleted file mode 100644 index 41fecdee4f..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Get the latest Kernel release for Alpha -on: - schedule: - - cron: '0 7 * * *' - -jobs: - get-kernel-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Kernel release - id: fetch-latest-release - env: - KV_ALPHA: 5.4 - run: | - git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionAlpha=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_ALPHA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) - rm -rf linux - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - run: .github/workflows/kernel-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Linux Kernel in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml deleted file mode 100644 index b5ff239c45..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Get the latest Kernel release for Beta -on: - schedule: - - cron: '50 6 * * *' - -jobs: - get-kernel-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Kernel release - id: fetch-latest-release - env: - KV_BETA: 5.4 - run: | - git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionBeta=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_BETA}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) - rm -rf linux - echo ::set-output name=VERSION_BETA::$(echo ${versionBeta}) - echo ::set-output name=BASE_BRANCH_BETA::flatcar-master-beta - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Beta - id: apply-patch-beta - env: - CHANNEL: beta - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} - run: .github/workflows/kernel-apply-patch.sh - - name: Create pull request for Beta - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-beta.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_BETA }} - branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_BETA }}-beta - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} - commit-message: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} - body: Upgrade Linux Kernel in Beta from ${{ steps.apply-patch-beta.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_BETA }} - labels: beta diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml similarity index 52% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml index a8152c3efc..11df18d52f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml @@ -1,4 +1,4 @@ -name: Get the latest Kernel release for Edge +name: Get the latest Kernel release for main on: schedule: - cron: '0 7 * * *' @@ -13,34 +13,34 @@ jobs: - name: Fetch latest Kernel release id: fetch-latest-release env: - KV_EDGE: 5.7 + KV_MAIN: 5.4 run: | git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionEdge=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_EDGE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + versionMain=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) rm -rf linux - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} run: .github/workflows/kernel-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Linux Kernel in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Linux Kernel in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Linux Kernel in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Linux Kernel in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml deleted file mode 100644 index 00e967b4db..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Get the latest Kernel release for Stable -on: - schedule: - - cron: '40 6 * * *' - -jobs: - get-kernel-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Kernel release - id: fetch-latest-release - env: - KV_STABLE: 4.19 - run: | - git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux - versionStable=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_STABLE}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) - rm -rf linux - echo ::set-output name=VERSION_STABLE::$(echo ${versionStable}) - echo ::set-output name=BASE_BRANCH_STABLE::flatcar-master - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Stable - id: apply-patch-stable - env: - CHANNEL: stable - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} - run: .github/workflows/kernel-apply-patch.sh - - name: Create pull request for Stable - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-stable.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_STABLE }} - branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_STABLE }}-stable - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} - commit-message: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} - body: Upgrade Linux Kernel in Stable from ${{ steps.apply-patch-stable.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_STABLE }} - labels: stable diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 5e59bfdf95..57d7f39829 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -6,7 +6,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "runc-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "runc-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml deleted file mode 100644 index 2d8e72aa09..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-alpha.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Get the latest Runc release for Alpha -on: - schedule: - - cron: '50 7 * * 4' - -jobs: - get-runc-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Runc release - id: fetch-latest-release - run: | - git clone https://github.com/opencontainers/runc - # Get the newest runc version, including official releases and rc versions. - # We need some sed tweaks like adding underscore, sort, and trim the underscore again, - # so that sort -V can give the newest version including non-rc versions. - versionAlpha=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1) - commitAlpha="$(git -C runc rev-parse v${versionAlpha})" - versionAlpha="${versionAlpha//-/_}" - rm -rf runc - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=COMMIT_ALPHA::$(echo ${commitAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - run: .github/workflows/runc-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: runc-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Runc in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml similarity index 56% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml index ec7b1c9157..f029525d30 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-releases-main.yml @@ -1,7 +1,7 @@ -name: Get the latest Runc release for Edge +name: Get the latest Runc release for main on: schedule: - - cron: '55 7 * * 4' + - cron: '50 7 * * 4' jobs: get-runc-release: @@ -17,35 +17,35 @@ jobs: # Get the newest runc version, including official releases and rc versions. # We need some sed tweaks like adding underscore, sort, and trim the underscore again, # so that sort -V can give the newest version including non-rc versions. - versionEdge=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1) - commitEdge="$(git -C runc rev-parse v${versionEdge})" - versionEdge="${versionEdge//-/_}" + versionMain=$(git -C runc ls-remote --tags origin | cut -f2 | sed '/-/!{s/$/_/}' | sed -n "/refs\/tags\/v[0-9]*.[0-9]*.[0-9]*/s/^refs\/tags\/v//p" |grep -v '\{\}$' | sort -ruV | sed 's/_$//' | head -n1) + commitMain="$(git -C runc rev-parse v${versionMain})" + versionMain="${versionMain//-/_}" rm -rf runc - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=COMMIT_EDGE::$(echo ${commitEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=COMMIT_MAIN::$(echo ${commitMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + COMMIT_HASH: ${{ steps.fetch-latest-release.outputs.COMMIT_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} run: .github/workflows/runc-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: runc-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: runc-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Runc in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Runc in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Runc in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Runc in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index f17c80f8ee..644efe4e39 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -6,7 +6,7 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh -if ! checkout_branches "rust-${VERSION_NEW}-${CHANNEL}"; then +if ! checkout_branches "rust-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 fi diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml deleted file mode 100644 index 40ec4adeb2..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-alpha.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Get the latest Rust release for Alpha -on: - schedule: - - cron: '20 7 * * 2' - -jobs: - get-rust-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch latest Rust release - id: fetch-latest-release - run: | - git clone --depth=1 --no-checkout https://github.com/rust-lang/rust - versionAlpha=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) - rm -rf rust - echo ::set-output name=VERSION_ALPHA::$(echo ${versionAlpha}) - echo ::set-output name=BASE_BRANCH_ALPHA::flatcar-master-alpha - - name: Set up Flatcar SDK - id: setup-flatcar-sdk - run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Alpha - id: apply-patch-alpha - env: - CHANNEL: alpha - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - run: .github/workflows/rust-apply-patch.sh - - name: Create pull request for Alpha - uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }} - branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha - author: Flatcar Buildbot - committer: Flatcar Buildbot - title: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - commit-message: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - body: Upgrade Rust in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }} - labels: alpha - - name: Send repository dispatch to portage-stable - uses: peter-evans/repository-dispatch@v1.0.0 - if: steps.apply-patch-alpha.outputs.UPDATE_NEEDED == 1 - with: - token: ${{ secrets.FLATCAR_PORTAGE_STABLE_ACCESS_TOKEN }} - repository: flatcar-linux/portage-stable - event-type: cargo-pull-request-alpha diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml similarity index 56% rename from sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml rename to sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml index ae86d4c962..ea6e45c96a 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-edge.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-release-main.yml @@ -1,7 +1,7 @@ -name: Get the latest Rust release for Edge +name: Get the latest Rust release for main on: schedule: - - cron: '25 7 * * 2' + - cron: '20 7 * * 2' jobs: get-rust-release: @@ -14,38 +14,38 @@ jobs: id: fetch-latest-release run: | git clone --depth=1 --no-checkout https://github.com/rust-lang/rust - versionEdge=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) + versionMain=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) rm -rf rust - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge + echo ::set-output name=VERSION_MAIN::$(echo ${versionMain}) + echo ::set-output name=BASE_BRANCH_MAIN::main - name: Set up Flatcar SDK id: setup-flatcar-sdk run: .github/workflows/setup-flatcar-sdk.sh - - name: Apply patch for Edge - id: apply-patch-edge + - name: Apply patch for main + id: apply-patch-main env: - CHANNEL: edge - BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} + TARGET: main + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} run: .github/workflows/rust-apply-patch.sh - - name: Create pull request for Edge + - name: Create pull request for main uses: peter-evans/create-pull-request@v2 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} - branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - commit-message: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Rust in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: edge + title: Upgrade Rust in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + commit-message: Upgrade Rust in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + body: Upgrade Rust in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} + labels: main - name: Send repository dispatch to portage-stable uses: peter-evans/repository-dispatch@v1.0.0 - if: steps.apply-patch-edge.outputs.UPDATE_NEEDED == 1 + if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 with: token: ${{ secrets.FLATCAR_PORTAGE_STABLE_ACCESS_TOKEN }} repository: flatcar-linux/portage-stable - event-type: cargo-pull-request-edge + event-type: cargo-pull-request-main diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh index 4536287bb6..fed7db3457 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/setup-flatcar-sdk.sh @@ -52,7 +52,7 @@ enter sudo eselect profile set --force "coreos:coreos/amd64/sdk" # make edb directory group-writable to run egencache enter sudo chmod g+w /var/cache/edb -git -C src/third_party/coreos-overlay reset --hard github/flatcar-master +git -C src/third_party/coreos-overlay reset --hard github/main git -C src/third_party/coreos-overlay config user.name 'Flatcar Buildbot' git -C src/third_party/coreos-overlay config user.email 'buildbot@flatcar-linux.org' popd || exit From 0066ee57e0f53252ac015f4efffc2a96871d52ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Fri, 24 Jul 2020 11:48:52 +0200 Subject: [PATCH 41/42] .github: Setup kernel updates for maintenance branches --- .../workflows/kernel-releases-alpha.yml | 48 +++++++++++++++++++ .../workflows/kernel-releases-beta.yml | 48 +++++++++++++++++++ .../workflows/kernel-releases-main.yml | 2 +- .../workflows/kernel-releases-stable.yml | 48 +++++++++++++++++++ 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml create mode 100644 sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml new file mode 100644 index 0000000000..afffda7026 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-alpha.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Alpha maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: alpha + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml new file mode 100644 index 0000000000..562e9ec065 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-beta.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Beta maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: beta + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml index 11df18d52f..351cea0261 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-main.yml @@ -26,7 +26,7 @@ jobs: - name: Apply patch for main id: apply-patch-main env: - TARGET: main + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }} diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml new file mode 100644 index 0000000000..bfba811911 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-releases-stable.yml @@ -0,0 +1,48 @@ +name: Get the latest Kernel release for the Stable maintenance branch +on: + schedule: + - cron: '0 7 * * *' + +jobs: + get-kernel-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Fetch latest Kernel release + id: fetch-latest-release + env: + CHANNEL: stable + run: | + KV_MAIN=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/flatcar_production_image_packages.txt" | grep -o 'coreos-kernel.*' | cut -d '-' -f 3- | cut -d . -f 1-2) + git clone --depth=1 --no-checkout https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux + versionMaintenance=$(git -C linux ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/v${KV_MAIN}.[0-9]*$/s/^refs\/tags\/v//p" | sort -ruV | head -1) + rm -rf linux + maintenanceBranch=$(curl -s -S -f -L "https://${CHANNEL}.release.flatcar-linux.net/amd64-usr/current/version.txt" | grep -m 1 FLATCAR_BUILD= | cut -d = -f 2-) + echo ::set-output name=VERSION_MAINTENANCE::$(echo ${versionMaintenance}) + echo ::set-output name=BASE_BRANCH_MAINTENANCE::$(echo flatcar-${maintenanceBranch}) + - name: Set up Flatcar SDK + id: setup-flatcar-sdk + run: .github/workflows/setup-flatcar-sdk.sh + - name: Apply patch for maintenance branch + id: apply-patch-maintenance + env: + TARGET: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + PATH: ${{ steps.setup-flatcar-sdk.outputs.path }} + VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + run: .github/workflows/kernel-apply-patch.sh + - name: Create pull request for maintenance branch + uses: peter-evans/create-pull-request@v2 + if: steps.apply-patch-maintenance.outputs.UPDATE_NEEDED == 1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + branch: linux-${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }}-${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} + author: Flatcar Buildbot + committer: Flatcar Buildbot + title: Upgrade Linux Kernel for ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + commit-message: Upgrade Linux Kernel in maintenance branch from ${{ steps.apply-patch-maintenance.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + body: Upgrade Linux Kernel in ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAINTENANCE }} + labels: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAINTENANCE }} From a1727654a811c4ed34b0b90c35d28313d0ad4986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Tue, 28 Jul 2020 15:12:58 +0200 Subject: [PATCH 42/42] .github: Do not create metadata/md5-cache commits --- .../third_party/coreos-overlay/.github/workflows/common.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index da9298aef3..0c2e3a140f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -42,11 +42,8 @@ function generate_patches() { git add ${CATEGORY_NAME}/${PKGNAME_SIMPLE} git commit -a -m "${CATEGORY_NAME}: Upgrade ${PKGNAME_DESC} ${VERSION_OLD} to ${VERSION_NEW}" - # Generate metadata after the main commit was done. - enter "${SDK_INNER_SRCDIR}/scripts/update_metadata" --commit coreos - - # Create 2 patches, one for the main ebuilds, the other for metadata changes. - git format-patch -2 HEAD + # Create a patch for the main ebuilds. + git format-patch -1 HEAD popd || exit }