Skip to content

Commit

Permalink
ci, e2e tests: provide crio target
Browse files Browse the repository at this point in the history
minikube 1.26.1 has CRI-O 1.24.X according to its release notes - [0].

[0] - https://github.com/kubernetes/minikube/releases/tag/v1.26.1

Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Oct 26, 2022
1 parent 17b3b93 commit 6413897
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 23 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/e2e-crio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: e2e tests - crio

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.x

- run: |
pip3 install --user --upgrade j2cli
j2 --version
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18

- name: Start minikube
uses: medyagh/setup-minikube@master
with:
minikube-version: 1.26.1
container-runtime: cri-o
kubernetes-version: v1.24.3
cni: bridge

- name: Deploy multus & the PRs contents
run: hack/e2e-crio-cluster-setup.sh

- name: Test - provisioning the examples
run: e2e/test-provisioning-examples.sh

- name: Test - execute golang based e2e tests
env:
KUBECONFIG: /home/runner/.kube/config
run: make e2e/test

- name: Cleanup cluster
run: |
minikube delete
33 changes: 10 additions & 23 deletions hack/e2e-crio-cluster-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,34 @@ IMAGE_REPO=${IMG_REPO:-maiqueb}
IMAGE_NAME="multus-dynamic-networks-controller"
IMAGE_TAG="latest"

setup_cluster() {
export KUBEVIRTCI_TAG=`curl -L -Ss https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirtci/latest`
git clone https://github.com/kubevirt/kubevirtci/
trap "popd" RETURN SIGINT
pushd kubevirtci
KUBEVIRT_PROVIDER="k8s-$K8S_VERSION" KUBEVIRT_NUM_SECONDARY_NICS=1 make cluster-up
export KUBECONFIG="$(pwd)/_ci-configs/k8s-1.24/.kubeconfig"
}

push_local_image() {
OCI_BIN="$OCI_BIN" IMAGE_REGISTRY="registry:5000/$IMAGE_REPO" make manifests
OCI_BIN="$OCI_BIN" IMAGE_REGISTRY="$IMG_REGISTRY" make img-build
"$OCI_BIN" push --tls-verify=false "$IMG_REGISTRY/$IMAGE_NAME:$IMAGE_TAG"
}

publish_kubeconfig() {
local kube_config_dir="${HOME}/.kube/"
mkdir -p "$kube_config_dir"
cp kubevirtci/_ci-configs/k8s-1.24/.kubeconfig "$kube_config_dir/config"
echo "###"
echo " Repo kubeconfig moved to $kube_config_dir/config"
echo "###"
setup_registry() {
# https://minikube.sigs.k8s.io/docs/handbook/registry/
minikube addons enable registry
"$OCI_BIN" run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
}

cleanup() {
rm -rf kubevirtci
git checkout -- manifests/
echo "=============="
echo " minikube logs:"
echo "=============="
minikube logs
}

trap "cleanup" EXIT
setup_cluster

registry_port=$(kubevirtci/cluster-up/cli.sh ports registry | tr -d '\r')
registry="localhost:$registry_port/$IMAGE_REPO"
setup_registry

IMG_REGISTRY="$registry" push_local_image
IMG_REGISTRY="localhost:5000/$IMAGE_REPO" push_local_image

kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml
kubectl wait -nkube-system --for=condition=ready --timeout=180s -l app=multus pods

publish_kubeconfig

kubectl apply -f manifests/dynamic-networks-controller.yaml
kubectl wait -nkube-system --for=condition=ready --timeout=180s -l app=dynamic-networks-controller pods

0 comments on commit 6413897

Please sign in to comment.