mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
kata-deploy: Ensure we test HEAD with /test_kata_deploy
Is the past few releases we ended up hitting issues that could be easily avoided if `/test_kata_deploy` would use HEAD instead of a specific tarball. By the end of the day, we want to ensure kata-deploy works, but before we cut a release we also want to ensure that the binaries used in that release are in a good shape. If we don't do that we end up either having to roll a release back, or to cut a second release in a really short time (and that's time consuming). Note: there's code duplication here that could and should be avoided,b but I sincerely would prefer treating it in a different PR. Fixes: #3001 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
c01189d4a6
commit
3c9ae7fb4b
111
.github/workflows/kata-deploy-test.yaml
vendored
111
.github/workflows/kata-deploy-test.yaml
vendored
@ -5,46 +5,91 @@ on:
|
|||||||
name: test-kata-deploy
|
name: test-kata-deploy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-and-test-container:
|
build-asset:
|
||||||
if: |
|
runs-on: ubuntu-latest
|
||||||
github.event.issue.pull_request
|
strategy:
|
||||||
&& github.event_name == 'issue_comment'
|
matrix:
|
||||||
&& github.event.action == 'created'
|
asset:
|
||||||
&& startsWith(github.event.comment.body, '/test_kata_deploy')
|
- cloud-hypervisor
|
||||||
|
- firecracker
|
||||||
|
- kernel
|
||||||
|
- qemu
|
||||||
|
- rootfs-image
|
||||||
|
- rootfs-initrd
|
||||||
|
- shim-v2
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install docker
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://test.docker.com -o test-docker.sh
|
||||||
|
sh test-docker.sh
|
||||||
|
|
||||||
|
- name: Build ${{ matrix.asset }}
|
||||||
|
run: |
|
||||||
|
make "${KATA_ASSET}-tarball"
|
||||||
|
build_dir=$(readlink -f build)
|
||||||
|
# store-artifact does not work with symlink
|
||||||
|
sudo cp -r "${build_dir}" "kata-build"
|
||||||
|
env:
|
||||||
|
KATA_ASSET: ${{ matrix.asset }}
|
||||||
|
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
|
||||||
|
|
||||||
|
- name: store-artifact ${{ matrix.asset }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: kata-artifacts
|
||||||
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
create-kata-tarball:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-asset
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: get-artifacts
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: kata-artifacts
|
||||||
|
path: kata-artifacts
|
||||||
|
- name: merge-artifacts
|
||||||
|
run: |
|
||||||
|
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts
|
||||||
|
- name: store-artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: kata-static-tarball
|
||||||
|
path: kata-static.tar.xz
|
||||||
|
|
||||||
|
kata-deploy:
|
||||||
|
needs: create-kata-tarball
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: get-PR-ref
|
- uses: actions/checkout@v2
|
||||||
id: get-PR-ref
|
- name: get-kata-tarball
|
||||||
run: |
|
uses: actions/download-artifact@v2
|
||||||
ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#')
|
|
||||||
echo "reference for PR: " ${ref}
|
|
||||||
echo "##[set-output name=pr-ref;]${ref}"
|
|
||||||
|
|
||||||
- name: check out
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.get-PR-ref.outputs.pr-ref }}
|
name: kata-static-tarball
|
||||||
|
- name: build-and-push-kata-deploy-ci
|
||||||
- name: build-container-image
|
id: build-and-push-kata-deploy-ci
|
||||||
id: build-container-image
|
|
||||||
run: |
|
run: |
|
||||||
PR_SHA=$(git log --format=format:%H -n1)
|
tag=$(echo $GITHUB_REF | cut -d/ -f3-)
|
||||||
VERSION="2.0.0"
|
pushd $GITHUB_WORKSPACE
|
||||||
ARTIFACT_URL="https://github.com/kata-containers/kata-containers/releases/download/${VERSION}/kata-static-${VERSION}-x86_64.tar.xz"
|
git checkout $tag
|
||||||
wget "${ARTIFACT_URL}" -O tools/packaging/kata-deploy/kata-static.tar.xz
|
pkg_sha=$(git rev-parse HEAD)
|
||||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:${PR_SHA} -t quay.io/kata-containers/kata-deploy-ci:${PR_SHA} ./tools/packaging/kata-deploy
|
popd
|
||||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
mv kata-static.tar.xz $GITHUB_WORKSPACE/tools/packaging/kata-deploy/kata-static.tar.xz
|
||||||
docker push katadocker/kata-deploy-ci:$PR_SHA
|
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t quay.io/kata-containers/kata-deploy-ci:$pkg_sha $GITHUB_WORKSPACE/tools/packaging/kata-deploy
|
||||||
docker login -u ${{ secrets.QUAY_DEPLOYER_USERNAME }} -p ${{ secrets.QUAY_DEPLOYER_PASSWORD }} quay.io
|
docker login -u ${{ secrets.QUAY_DEPLOYER_USERNAME }} -p ${{ secrets.QUAY_DEPLOYER_PASSWORD }} quay.io
|
||||||
docker push quay.io/kata-containers/kata-deploy-ci:$PR_SHA
|
docker push quay.io/kata-containers/kata-deploy-ci:$pkg_sha
|
||||||
echo "##[set-output name=pr-sha;]${PR_SHA}"
|
mkdir -p packaging/kata-deploy
|
||||||
|
ln -s $GITHUB_WORKSPACE/tools/packaging/kata-deploy/action packaging/kata-deploy/action
|
||||||
|
echo "::set-output name=PKG_SHA::${pkg_sha}"
|
||||||
- name: test-kata-deploy-ci-in-aks
|
- name: test-kata-deploy-ci-in-aks
|
||||||
uses: ./tools/packaging/kata-deploy/action
|
uses: ./packaging/kata-deploy/action
|
||||||
with:
|
with:
|
||||||
packaging-sha: ${{ steps.build-container-image.outputs.pr-sha }}
|
packaging-sha: ${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}}
|
||||||
env:
|
env:
|
||||||
PKG_SHA: ${{ steps.build-container-image.outputs.pr-sha }}
|
PKG_SHA: ${{steps.build-and-push-kata-deploy-ci.outputs.PKG_SHA}}
|
||||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||||
|
Loading…
Reference in New Issue
Block a user