mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-06 12:52:07 +00:00
Compare commits
27 Commits
1.9.0-rc0
...
1.9.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e56dbf7f9 | ||
|
|
3a752dbf9b | ||
|
|
d9892c04e2 | ||
|
|
e4dfb0f90e | ||
|
|
05d02d9a25 | ||
|
|
60876979f9 | ||
|
|
0eae776de3 | ||
|
|
072cee7cd3 | ||
|
|
fe4121d77e | ||
|
|
0fa9922f99 | ||
|
|
5aded0eb2a | ||
|
|
2945939e6e | ||
|
|
7db4224719 | ||
|
|
98fad2c1ec | ||
|
|
8618218b01 | ||
|
|
70dd1d1530 | ||
|
|
7e3f695c67 | ||
|
|
10c21925a3 | ||
|
|
4cf761c941 | ||
|
|
46c583f0cd | ||
|
|
0d4a7ad717 | ||
|
|
481f528533 | ||
|
|
72ee460cf0 | ||
|
|
86d83d4165 | ||
|
|
4f00e551ca | ||
|
|
6c91bc0aaa | ||
|
|
26be8836da |
14
.github/kata-artifacts-action/Dockerfile
vendored
Normal file
14
.github/kata-artifacts-action/Dockerfile
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
LABEL version="0.0.0"
|
||||
LABEL maintainer="Kata folks"
|
||||
LABEL com.github.actions.name="Prepare artifacts for Kata release page"
|
||||
LABEL com.github.actions.description="Create and upload static binaries and Kata images to release page for a given release"
|
||||
|
||||
ENV GITHUB_ACTION_NAME="Prepare artifacts for Kata release"
|
||||
ENV NEW_VERSION="1.8.2"
|
||||
ENV BRANCH="master"
|
||||
|
||||
RUN git clone https://github.com/kata-containers/packaging.git && cd packaging
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
22
.github/kata-artifacts-action/entrypoint.sh
vendored
Executable file
22
.github/kata-artifacts-action/entrypoint.sh
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
die() {
|
||||
msg="$*"
|
||||
echo "ERROR: $msg" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Entrypoint for the container image, we know that the AKS and Kata setup/testing
|
||||
# scripts are located at root.
|
||||
|
||||
cd obs-packaging
|
||||
bash -x ./gen_versions_txt.sh ${BRANCH}
|
||||
cd ../release
|
||||
bash -x ./publish-kata-image.sh -p ${NEW_VERSION}
|
||||
bash -x ./kata-deploy-binaries.sh -p ${NEW_VERSION}
|
||||
|
||||
echo "maybe it worked"
|
||||
24
.github/kata-deploy-action/Dockerfile
vendored
Normal file
24
.github/kata-deploy-action/Dockerfile
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM microsoft/azure-cli:2.0.47
|
||||
|
||||
LABEL version="0.0.0"
|
||||
LABEL maintainer="eric and sai"
|
||||
LABEL com.github.actions.name="Test kata-deploy in an AKS cluster"
|
||||
LABEL com.github.actions.description="Wow. Where do i start. Create an AKS cluster with containerd+runtimeclass, then deploys kata onto it and even might start a workload. nbd"
|
||||
|
||||
ARG AKS_ENGINE_VER="v0.36.4"
|
||||
|
||||
ENV GITHUB_ACTION_NAME="Test kata-deploy in an AKS cluster"
|
||||
|
||||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
|
||||
&& chmod +x ./kubectl \
|
||||
&& mv ./kubectl /usr/local/bin/kubectl
|
||||
|
||||
RUN curl -LO https://github.com/Azure/aks-engine/releases/download/${AKS_ENGINE_VER}/aks-engine-${AKS_ENGINE_VER}-linux-amd64.tar.gz \
|
||||
&& tar xvf aks-engine-${AKS_ENGINE_VER}-linux-amd64.tar.gz \
|
||||
&& mv aks-engine-${AKS_ENGINE_VER}-linux-amd64/aks-engine /usr/local/bin/aks-engine \
|
||||
&& rm aks-engine-${AKS_ENGINE_VER}-linux-amd64.tar.gz
|
||||
|
||||
COPY kubernetes-containerd.json /
|
||||
COPY setup-aks.sh test-kata.sh entrypoint.sh /
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
22
.github/kata-deploy-action/entrypoint.sh
vendored
Executable file
22
.github/kata-deploy-action/entrypoint.sh
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
die() {
|
||||
msg="$*"
|
||||
echo "ERROR: $msg" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Since this is the entrypoint for the container image, we know that the AKS and Kata setup/testing
|
||||
# scripts are located at root.
|
||||
source /setup-aks.sh
|
||||
source /test-kata.sh
|
||||
|
||||
trap destroy_aks EXIT
|
||||
|
||||
setup_aks
|
||||
|
||||
test_kata
|
||||
41
.github/kata-deploy-action/kubernetes-containerd.json
vendored
Normal file
41
.github/kata-deploy-action/kubernetes-containerd.json
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"apiVersion": "vlabs",
|
||||
"properties": {
|
||||
"orchestratorProfile": {
|
||||
"orchestratorType": "Kubernetes",
|
||||
"orchestratorVersion": "1.14.1",
|
||||
"kubernetesConfig": {
|
||||
"networkPlugin": "flannel",
|
||||
"containerRuntime": "containerd",
|
||||
"containerdVersion": "1.2.4"
|
||||
}
|
||||
},
|
||||
"masterProfile": {
|
||||
"count": 1,
|
||||
"dnsPrefix": "",
|
||||
"vmSize": "Standard_D2_v2"
|
||||
},
|
||||
"agentPoolProfiles": [
|
||||
{
|
||||
"name": "agentpool",
|
||||
"count": 1,
|
||||
"vmSize": "Standard_D4s_v3",
|
||||
"availabilityProfile": "AvailabilitySet"
|
||||
}
|
||||
],
|
||||
"linuxProfile": {
|
||||
"adminUsername": "azureuser",
|
||||
"ssh": {
|
||||
"publicKeys": [
|
||||
{
|
||||
"keyData": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"servicePrincipalProfile": {
|
||||
"clientId": "",
|
||||
"secret": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
44
.github/kata-deploy-action/setup-aks.sh
vendored
Executable file
44
.github/kata-deploy-action/setup-aks.sh
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
export AZURE_HTTP_USER_AGENT="GITHUBACTIONS_${GITHUB_ACTION_NAME}_${GITHUB_REPOSITORY}"
|
||||
|
||||
LOCATION=${LOCATION:-westus2}
|
||||
DNS_PREFIX=${DNS_PREFIX:-kata-deploy-${GITHUB_SHA:0:10}}
|
||||
CLUSTER_CONFIG=${CLUSTER_CONFIG:-/kubernetes-containerd.json}
|
||||
|
||||
function die() {
|
||||
msg="$*"
|
||||
echo "ERROR: $msg" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function destroy_aks() {
|
||||
set +x
|
||||
az login --service-principal -u "$AZ_APPID" -p "$AZ_PASSWORD" --tenant "$AZ_TENANT_ID"
|
||||
az group delete --name "$DNS_PREFIX" --yes --no-wait
|
||||
az logout
|
||||
}
|
||||
|
||||
function setup_aks() {
|
||||
|
||||
[[ -z "$AZ_APPID" ]] && die "no Azure service principal ID provided"
|
||||
[[ -z "$AZ_PASSWORD" ]] && die "no Azure service principal secret provided"
|
||||
[[ -z "$AZ_SUBSCRIPTION_ID" ]] && die "no Azure subscription ID provided"
|
||||
[[ -z "$AZ_TENANT_ID" ]] && die "no Azure tenant ID provided"
|
||||
|
||||
# check cluster config existence
|
||||
# TODO
|
||||
|
||||
# Give it a try
|
||||
|
||||
aks-engine deploy --subscription-id "$AZ_SUBSCRIPTION_ID" \
|
||||
--client-id "$AZ_APPID" --client-secret "$AZ_PASSWORD" \
|
||||
--location "$LOCATION" --dns-prefix "$DNS_PREFIX" \
|
||||
--api-model "$CLUSTER_CONFIG" --force-overwrite
|
||||
|
||||
export KUBECONFIG="_output/$DNS_PREFIX/kubeconfig/kubeconfig.$LOCATION.json"
|
||||
}
|
||||
112
.github/kata-deploy-action/test-kata.sh
vendored
Executable file
112
.github/kata-deploy-action/test-kata.sh
vendored
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
|
||||
function waitForProcess() {
|
||||
wait_time="$1"
|
||||
sleep_time="$2"
|
||||
cmd="$3"
|
||||
while [ "$wait_time" -gt 0 ]; do
|
||||
if eval "$cmd"; then
|
||||
return 0
|
||||
else
|
||||
sleep "$sleep_time"
|
||||
wait_time=$((wait_time-sleep_time))
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
function run_test() {
|
||||
YAMLPATH="https://raw.githubusercontent.com/egernst/kata-deploy/$GITHUB_SHA/kata-deploy"
|
||||
echo "verify connectivity with a pod using Kata"
|
||||
|
||||
deployment=""
|
||||
busybox_pod="test-nginx"
|
||||
busybox_image="busybox"
|
||||
cmd="kubectl get pods | grep $busybox_pod | grep Completed"
|
||||
wait_time=120
|
||||
sleep_time=3
|
||||
|
||||
for deployment in "nginx-deployment-qemu" "nginx-deployment-nemu"; do
|
||||
# start the kata pod:
|
||||
kubectl apply -f "$YAMLPATH/examples/${deployment}.yaml"
|
||||
kubectl wait --timeout=5m --for=condition=Available deployment/${deployment}
|
||||
kubectl wait --timeout=5m --for=condition=Available deployment/${deployment}
|
||||
kubectl expose deployment/${deployment}
|
||||
|
||||
# test pod connectivity:
|
||||
kubectl run $busybox_pod --restart=Never --image="$busybox_image" -- wget --timeout=5 "$deployment"
|
||||
waitForProcess "$wait_time" "$sleep_time" "$cmd"
|
||||
kubectl logs "$busybox_pod" | grep "index.html"
|
||||
kubectl describe pod "$busybox_pod"
|
||||
|
||||
kubectl delete deployment "$deployment"
|
||||
kubectl delete service "$deployment"
|
||||
kubectl delete pod "$busybox_pod"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function test_kata() {
|
||||
set -x
|
||||
#kubectl all the things
|
||||
kubectl get pods --all-namespaces
|
||||
|
||||
YAMLPATH="https://raw.githubusercontent.com/egernst/kata-deploy/$GITHUB_SHA/kata-deploy"
|
||||
|
||||
kubectl apply -f "$YAMLPATH/kata-rbac.yaml"
|
||||
kubectl apply -f "$YAMLPATH/k8s-1.14/kata-nemu-runtimeClass.yaml"
|
||||
kubectl apply -f "$YAMLPATH/k8s-1.14/kata-qemu-runtimeClass.yaml"
|
||||
kubectl apply -f "$YAMLPATH/k8s-1.14/kata-fc-runtimeClass.yaml"
|
||||
|
||||
sleep 5
|
||||
|
||||
kubectl get runtimeclasses
|
||||
|
||||
wget "$YAMLPATH/kata-deploy.yaml"
|
||||
wget "$YAMLPATH/kata-cleanup.yaml"
|
||||
|
||||
# update deployment daemonset to utilize the container under test:
|
||||
sed -i "s#katadocker/kata-deploy#katadocker/kata-deploy-ci:${GITHUB_SHA}#g" kata-deploy.yaml
|
||||
sed -i "s#katadocker/kata-deploy#katadocker/kata-deploy-ci:${GITHUB_SHA}#g" kata-cleanup.yaml
|
||||
|
||||
cat kata-deploy.yaml
|
||||
|
||||
sleep 100
|
||||
|
||||
# deploy kata:
|
||||
kubectl apply -f kata-deploy.yaml
|
||||
|
||||
sleep 1
|
||||
|
||||
#wait for kata-deploy to be up
|
||||
kubectl -n kube-system wait --timeout=5m --for=condition=Ready -l name=kata-deploy pod
|
||||
|
||||
#Do I see this?
|
||||
kubectl get pods --all-namespaces --show-labels
|
||||
kubectl get node --show-labels
|
||||
|
||||
run_test
|
||||
|
||||
# remove kata (yeah, we are about to destroy, but good to test this flow as well):
|
||||
kubectl delete -f kata-deploy.yaml
|
||||
kubectl -n kube-system wait --timeout=5m --for=delete -l name=kata-deploy pod
|
||||
kubectl apply -f kata-cleanup.yaml
|
||||
kubectl -n kube-system wait --timeout=5m --for=condition=Ready -l name=kubelet-kata-cleanup pod
|
||||
|
||||
kubectl get pods --all-namespaces --show-labels
|
||||
kubectl get node --show-labels
|
||||
|
||||
kubectl delete -f kata-cleanup.yaml
|
||||
|
||||
rm kata-cleanup.yaml
|
||||
rm kata-deploy.yaml
|
||||
|
||||
set +x
|
||||
}
|
||||
4
.github/kata-deploy-action/trigger
vendored
Executable file
4
.github/kata-deploy-action/trigger
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
VERSION=1.8.0-alpha1
|
||||
git tag --delete $VERSION
|
||||
git push origin :$VERSION
|
||||
git tag -a $VERSION -m "test tag - $VERSION" && git push origin $VERSION
|
||||
1
.github/workflows/README.md
vendored
Normal file
1
.github/workflows/README.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
adding a readme
|
||||
47
.github/workflows/dedup-jobs.yaml
vendored
47
.github/workflows/dedup-jobs.yaml
vendored
@@ -1,47 +0,0 @@
|
||||
on:
|
||||
push
|
||||
|
||||
jobs:
|
||||
get-artifact-list:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: get the list
|
||||
run: |
|
||||
git clone https://github.com/kata-containers/packaging kata-packaging
|
||||
pushd kata-packaging
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout master
|
||||
popd
|
||||
./kata-packaging/artifact-list.sh > artifact-list.txt
|
||||
cat artifact-list.txt
|
||||
- name: save-artifact-list
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
path: artifact-list.txt
|
||||
build-kernel:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- run: |
|
||||
sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables
|
||||
- name: build-kernel
|
||||
run: |
|
||||
if grep -q "install_kernel" ./artifact-list/artifact-list.txt; then
|
||||
$GITHUB_WORKSPACE/.github/workflows/generate-artifact-tarball.sh "install_kernel" $GITHUB_REF
|
||||
echo ::set-env name=artifact-built::true
|
||||
ls -la $GITHUB_WORKSPACE
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-static-kernel.tar.gz
|
||||
61
.github/workflows/generate-artifact-tarball.sh
vendored
61
.github/workflows/generate-artifact-tarball.sh
vendored
@@ -1,61 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
[ -z "${DEBUG}" ] || set -x
|
||||
set -o errexit
|
||||
#set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
|
||||
main() {
|
||||
artifact_stage=${1:-}
|
||||
artifact=$(echo ${artifact_stage} | sed -n -e 's/^install_//p' | sed -r 's/_/-/g')
|
||||
if [ -z "${artifact}" ]; then
|
||||
"Scripts needs artifact name to build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
github_ref=${2:-}
|
||||
if [ -z "${github_ref}" ]; then
|
||||
"Scripts needs github reference to build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag=`echo ${github_ref} | cut -d/ -f3-`
|
||||
export GOPATH=$HOME/go
|
||||
|
||||
echo tag: "$tag"
|
||||
echo artifact "$artifact"
|
||||
echo artifact_stage "$artifact_stage"
|
||||
#tag="1.9.0-rc0"
|
||||
|
||||
export GOPATH=$HOME/go
|
||||
#go get github.com/kata-containers/packaging || true
|
||||
go get github.com/amshinde/kata-packaging || true
|
||||
#pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
pushd $GOPATH/src/github.com/amshinde/kata-packaging/release >>/dev/null
|
||||
git checkout $tag
|
||||
#git checkout master
|
||||
pushd ../obs-packaging
|
||||
echo "Running gen_versions_txt.sh with tag $tag"
|
||||
./gen_versions_txt.sh $tag
|
||||
popd
|
||||
|
||||
echo Directory for running deploy script: $pwd
|
||||
ls -la
|
||||
source ./kata-deploy-binaries.sh
|
||||
${artifact_stage}
|
||||
echo "Dir while doing final pop:" $pwd
|
||||
popd
|
||||
|
||||
echo "Done installing"
|
||||
echo PWD, should be top dir: $pwd
|
||||
ls -la
|
||||
#mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-kernel.tar.gz .
|
||||
mv $HOME/go/src/github.com/amshinde/kata-packaging/release/kata-static-${artifact}.tar.gz .
|
||||
}
|
||||
|
||||
main $@
|
||||
29
.github/workflows/hacking.yml
vendored
Normal file
29
.github/workflows/hacking.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# When a release page is published, start the release artifact process
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
name: Build, Test, and Publish kata-deploy
|
||||
|
||||
jobs:
|
||||
# create image and upload to release page (can we get branch information from release tag?
|
||||
publish-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name : the ok ok
|
||||
run: |
|
||||
echo "hello worold"
|
||||
#sudo apt-get update
|
||||
#sudo apt-get install -y curl git
|
||||
echo "still?"
|
||||
# for test development:
|
||||
git clone https://github.com/egernst/packaging-1
|
||||
cd packaging-1/release
|
||||
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
echo `pwd`
|
||||
echo `ls`
|
||||
|
||||
bash -x ./build-artifacts.sh $tag
|
||||
|
||||
echo "done...."
|
||||
34
.github/workflows/kata-deploy.yaml
vendored
34
.github/workflows/kata-deploy.yaml
vendored
@@ -1,34 +0,0 @@
|
||||
#on: push
|
||||
|
||||
name: Build, Test, and Publish kata-deploy
|
||||
|
||||
jobs:
|
||||
kata-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: build-and-push-kata-deploy-ci
|
||||
run: |
|
||||
git clone https://github.com/amshinde/kata-packaging
|
||||
pushd ./kata-packaging
|
||||
git checkout 1.9.0-rc0
|
||||
pkg_sha=$(git rev-parse HEAD)
|
||||
popd
|
||||
wget -q https://github.com/kata-containers/runtime/releases/download/1.9.0-rc0/kata-static-1.9.0-rc0-x86_64.tar.xz
|
||||
mv kata-static-1.9.0-rc0-x86_64.tar.xz ./kata-packaging/kata-deploy/kata-static.tar.xz
|
||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:$pkg_sha ./kata-packaging/kata-deploy
|
||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker push katadocker/kata-deploy-ci:$pkg_sha
|
||||
echo ::set-env name=PKG_SHA::$pkg_sha
|
||||
- name: test-kata-deploy-ci-in-aks
|
||||
uses: ./kata-packaging/kata-deploy/action
|
||||
with:
|
||||
packaging-sha: env.PKG_SHA
|
||||
env:
|
||||
PKG_SHA: ${{ env.PKG_SHA }}
|
||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
||||
- name: did-we-make-it
|
||||
run: |
|
||||
echo "weeee"
|
||||
67
.github/workflows/kata-release.noworking
vendored
Normal file
67
.github/workflows/kata-release.noworking
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
# When a release page is published, start the release artifact process
|
||||
on: release
|
||||
name: Build, Test, and Publish kata-deploy
|
||||
|
||||
jobs:
|
||||
# create image and upload to release page (can we get branch information from release tag?
|
||||
publish-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: install-dependencies
|
||||
- run: |
|
||||
apt-get upate
|
||||
apt-get install -y docker-ce git
|
||||
git clone https://github.com/kata-containers/packaging
|
||||
cd packaging/obs-packages
|
||||
./gen_versions_file.txt
|
||||
cd ../release
|
||||
echo "maybe it worked"
|
||||
tree
|
||||
- name: publish-images
|
||||
- run : wget all the things
|
||||
- name: publish-images
|
||||
- run : ./publish-images.sh
|
||||
with:
|
||||
args: tag? sha?
|
||||
- name: create-static-binaries
|
||||
- uses: TBD
|
||||
with: tag?
|
||||
|
||||
# test the artifacts
|
||||
kata-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: tag-filter
|
||||
uses: actions/bin/filter@master
|
||||
with:
|
||||
args: tag
|
||||
- name: docker-build
|
||||
uses: actions/docker/cli@master
|
||||
with:
|
||||
args: build --build-arg KATA_VER=${GITHUB_REF##*/} -t katadocker/kata-deploy-ci:${{
|
||||
github.sha }} ./kata-deploy
|
||||
- name: docker-login
|
||||
uses: actions/docker/login@master
|
||||
env:
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
- name: docker-push-sha
|
||||
uses: actions/docker/cli@master
|
||||
with:
|
||||
args: push katadocker/kata-deploy-ci:${{ github.sha }}
|
||||
- name: aks-test
|
||||
uses: ./kata-deploy/action
|
||||
env:
|
||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
||||
- name: docker-tag-ref
|
||||
uses: actions/docker/cli@master
|
||||
with:
|
||||
args: tag katadocker/kata-deploy-ci:${{ github.sha }} katadocker/kata-deploy:${GITHUB_REF##*/}
|
||||
- name: docker-push-ref
|
||||
uses: actions/docker/cli@master
|
||||
with:
|
||||
args: push katadocker/kata-deploy:${GITHUB_REF##*/}
|
||||
374
.github/workflows/main.yaml
vendored
374
.github/workflows/main.yaml
vendored
@@ -1,374 +0,0 @@
|
||||
#on:
|
||||
# push:
|
||||
# tags:
|
||||
# - '*'
|
||||
|
||||
jobs:
|
||||
get-artifact-list:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: get the list
|
||||
run: |
|
||||
git clone https://github.com/kata-containers/packaging
|
||||
pushd kata-packaging
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
popd
|
||||
./kata-packaging/artifact-list.sh > artifact-list.txt
|
||||
- name: save-artifact-list
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
path: artifact-list.txt
|
||||
build-kernel:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-kernel
|
||||
run: |
|
||||
if grep -q "install_kernel" ./artifact-list/artifact-list.txt; then
|
||||
# install kernel dependencies
|
||||
sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
pushd ../obs-packaging
|
||||
./gen_versions_txt.sh $tag
|
||||
popd
|
||||
# Build the kernel:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_kernel
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-kernel.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-kernel.tar.gz
|
||||
|
||||
build-experimental-kernel:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-experimental-kernel
|
||||
run: |
|
||||
if grep -q "install_experimental_kernel" ./artifact-list/artifact-list.txt; then
|
||||
# install kernel dependencies
|
||||
sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
../obs-packaging/gen_versions_txt.sh $tag
|
||||
# Build the kernel:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_experimental_kernel
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-kernel-experimental.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-kernel-experimental.tar.gz
|
||||
|
||||
# Job for building the QEMU binaries
|
||||
build-qemu:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-qemu
|
||||
run: |
|
||||
if grep -q "install_qemu" ./artifact-list/artifact-list.txt; then
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
../obs-packaging/gen_versions_txt.sh $tag
|
||||
# Build the VMM:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_qemu
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-qemu-static.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-qemu-static.tar.gz
|
||||
|
||||
# Job for building the QEMU binaries with virtiofs support
|
||||
build-qemu-virtiofsd:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-qemu-virtiofsd
|
||||
run: |
|
||||
if grep -q "install_qemu_virtiofsd" ./artifact-list/artifact-list.txt; then
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
../obs-packaging/gen_versions_txt.sh $tag
|
||||
# Build the VMM:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_qemu_virtiofsd
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-qemu-virtiofs-static.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-qemu-virtiofs-static.tar.gz
|
||||
|
||||
# Job for building the image
|
||||
build-image:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-image
|
||||
run: |
|
||||
if grep -q "install_image" ./artifact-list/artifact-list.txt; then
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
pushd ../obs-packaging
|
||||
./gen_versions_txt.sh $tag
|
||||
popd
|
||||
# Build the VMM:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_image $tag
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-image.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-image.tar.gz
|
||||
|
||||
# Job for building firecracker hypervisor
|
||||
build-firecracker:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-firecracker
|
||||
run: |
|
||||
if grep -q "install_firecracker" ./artifact-list/artifact-list.txt; then
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
../obs-packaging/gen_versions_txt.sh $tag
|
||||
# Build the VMM:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_firecracker
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-firecracker-static.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-firecracker-static.tar.gz
|
||||
|
||||
# Job for building kata components
|
||||
build-kata-components:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: get-artifact-list
|
||||
steps:
|
||||
- name: get-artifact-list
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: artifact-list
|
||||
- name: build-kata-components
|
||||
run: |
|
||||
if grep -q "install_kata_components" ./artifact-list/artifact-list.txt; then
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git checkout $tag
|
||||
../obs-packaging/gen_versions_txt.sh $tag
|
||||
# Build the VMM:
|
||||
source ./kata-deploy-binaries.sh
|
||||
install_kata_components $tag
|
||||
echo ::set-env name=artifact-built::true
|
||||
popd >>/dev/null
|
||||
mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-components.tar.gz .
|
||||
else
|
||||
echo ::set-env name=artifact-built::false
|
||||
fi
|
||||
- name: store-artifacts
|
||||
if: env.artifact-built == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
path: kata-components.tar.gz
|
||||
|
||||
gather-artifacts:
|
||||
runs-on: ubuntu-16.04
|
||||
needs: [build-kernel, build-qemu, build-qemu-virtiofsd, build-image, build-firecracker, build-kata-components]
|
||||
steps:
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: kata-artifacts
|
||||
- name: colate-artifacts
|
||||
run: |
|
||||
export GOPATH=$HOME/go
|
||||
go get github.com/kata-containers/packaging || true
|
||||
pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null
|
||||
# Get versions information
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
popd >>/dev/null
|
||||
pushd kata-artifacts >>/dev/null
|
||||
for c in ./*.tar.gz
|
||||
do
|
||||
echo "untarring tarball $c"
|
||||
tar -xvf $c
|
||||
done
|
||||
ls ./opt/kata/bin
|
||||
ls ./opt/kata/share
|
||||
tar cfJ ../kata-static.tar.xz ./opt
|
||||
popd >>/dev/null
|
||||
ls -l && ls kata-artifacts
|
||||
- name: store-artifacts
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: release-candidate
|
||||
path: kata-static.tar.xz
|
||||
|
||||
kata-deploy:
|
||||
needs: gather-artifacts
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: release-candidate
|
||||
- name: build-and-push-kata-deploy-ci
|
||||
run: |
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git clone https://github.com/kata-containers/packaging
|
||||
pushd kata-packaging
|
||||
git checkout $tag
|
||||
pkg_sha=$(git rev-parse HEAD)
|
||||
popd
|
||||
mv release-candidate/kata-static.tar.xz ./kata-packaging/kata-deploy/kata-static.tar.xz
|
||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:$pkg_sha ./kata-packaging/kata-deploy
|
||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||
docker push katadocker/kata-deploy-ci:$pkg_sha
|
||||
echo ::set-env name=PKG_SHA::$pkg_sha
|
||||
echo ::set-env name=TAG::$tag
|
||||
- name: test-kata-deploy-ci-in-aks
|
||||
uses: ./kata-packaging/kata-deploy/action
|
||||
with:
|
||||
packaging-sha: env.PKG_SHA
|
||||
env:
|
||||
PKG_SHA: ${{ env.PKG_SHA }}
|
||||
AZ_APPID: ${{ secrets.AZ_APPID }}
|
||||
AZ_PASSWORD: ${{ secrets.AZ_PASSWORD }}
|
||||
AZ_SUBSCRIPTION_ID: ${{ secrets.AZ_SUBSCRIPTION_ID }}
|
||||
AZ_TENANT_ID: ${{ secrets.AZ_TENANT_ID }}
|
||||
- name: push-tarball
|
||||
run: |
|
||||
# tag the container image we created and push to DockerHub
|
||||
docker tag katadocker/kata-deploy-ci:${{ env.PKG_SHA }} katadocker/kata-deploy:${{ env.TAG }}
|
||||
docker push katadocker/kata-deploy:${{ env.TAG }}
|
||||
|
||||
upload-static-tarball:
|
||||
needs: gather-artifacts
|
||||
needs: kata-deploy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout code
|
||||
uses: actions/checkout@master
|
||||
- name: install-go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.13.x'
|
||||
- name: get-artifacts
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: release-candidate
|
||||
- name: install hub
|
||||
run: |
|
||||
git clone \
|
||||
--config transfer.fsckobjects=false \
|
||||
--config receive.fsckobjects=false \
|
||||
--config fetch.fsckobjects=false \
|
||||
https://github.com/github/hub.git
|
||||
cd hub
|
||||
sudo make install prefix=/usr/local
|
||||
- name: push static tarball to github
|
||||
run: |
|
||||
tag=`echo $GITHUB_REF | cut -d/ -f3-`
|
||||
git clone https://github.com/kata-containers/runtime.git
|
||||
cd runtime
|
||||
GITHUB_TOKEN=${{ secrets.GIT_UPLOAD_TOKEN }} hub release edit -m "" -a ../release-candidate/kata-static.tar.xz "${tag}"
|
||||
10
.github/workflows/trigger
vendored
10
.github/workflows/trigger
vendored
@@ -1,10 +0,0 @@
|
||||
VERSION=1.9.0-rc0
|
||||
|
||||
pushd ~/go/src/github.com/kata-containers/packaging
|
||||
git tag --delete $VERSION
|
||||
git push origin :$VERSION
|
||||
git tag -a $VERSION -m "test tag - $VERSION" && git push origin $VERSION
|
||||
popd
|
||||
git tag --delete $VERSION
|
||||
git push amshinde :$VERSION
|
||||
git tag -a $VERSION -m "test tag - $VERSION" && git push amshinde $VERSION
|
||||
6
trigger-tags.sh
Normal file
6
trigger-tags.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
tag=1.9.0-alpha2
|
||||
git tag -d "${tag}"
|
||||
git push egernst HEAD :"${tag}"
|
||||
|
||||
git tag -a "${tag}" -m "test push"
|
||||
git push egernst HEAD "${tag}"
|
||||
Reference in New Issue
Block a user