From 124cca5117f872233e0ffbca04796cdba45f83d4 Mon Sep 17 00:00:00 2001 From: Nikolaos Loukas Date: Thu, 30 Jun 2022 17:21:16 +0300 Subject: [PATCH] Test that each component can be applied in a K8s 1.22 cluster (#2230) * Add GH action for testing JWA manifests. * Update permissions. * Add GH actions for PodDefaults. * Add GH actions for PodDefaults fix typo. * Add GH actions for applying manifests in KinD for each component. * Fix cert manager installation in all Actions. * Address review comments for all GH actions. (cherry picked from commit 76f3cf27c6b820d1f29dbe075f8feb820dd4115a) --- .github/workflows/centraldb_kind_test.yaml | 31 ++++++++++++++++ .github/workflows/jwa_kind_test.yaml | 31 ++++++++++++++++ .github/workflows/katib_kind_test.yaml | 34 ++++++++++++++++++ .github/workflows/kserve_kind_test.yaml | 35 +++++++++++++++++++ .../workflows/nb_controller_kind_test.yaml | 31 ++++++++++++++++ .github/workflows/pipeline_kind_test.yaml | 34 ++++++++++++++++++ .github/workflows/poddefaults_kind_test.yaml | 34 ++++++++++++++++++ .github/workflows/profiles_kind_test.yaml | 31 ++++++++++++++++ .../workflows/tb_controller_kind_test.yaml | 31 ++++++++++++++++ .../workflows/train_operator_kind_test.yaml | 31 ++++++++++++++++ .github/workflows/twa_kind_test.yaml | 31 ++++++++++++++++ .github/workflows/vwa_kind_test.yaml | 31 ++++++++++++++++ testing/gh-actions/install_cert_manager.sh | 9 +++++ testing/gh-actions/install_istio.sh | 7 ++++ testing/gh-actions/install_kind.sh | 10 ++++++ testing/gh-actions/install_kustomize.sh | 5 +++ testing/gh-actions/kind-1-22.yaml | 24 +++++++++++++ 17 files changed, 440 insertions(+) create mode 100644 .github/workflows/centraldb_kind_test.yaml create mode 100644 .github/workflows/jwa_kind_test.yaml create mode 100644 .github/workflows/katib_kind_test.yaml create mode 100644 .github/workflows/kserve_kind_test.yaml create mode 100644 .github/workflows/nb_controller_kind_test.yaml create mode 100644 .github/workflows/pipeline_kind_test.yaml create mode 100644 .github/workflows/poddefaults_kind_test.yaml create mode 100644 .github/workflows/profiles_kind_test.yaml create mode 100644 .github/workflows/tb_controller_kind_test.yaml create mode 100644 .github/workflows/train_operator_kind_test.yaml create mode 100644 .github/workflows/twa_kind_test.yaml create mode 100644 .github/workflows/vwa_kind_test.yaml create mode 100755 testing/gh-actions/install_cert_manager.sh create mode 100755 testing/gh-actions/install_istio.sh create mode 100755 testing/gh-actions/install_kind.sh create mode 100755 testing/gh-actions/install_kustomize.sh create mode 100644 testing/gh-actions/kind-1-22.yaml diff --git a/.github/workflows/centraldb_kind_test.yaml b/.github/workflows/centraldb_kind_test.yaml new file mode 100644 index 000000000..739c5d6d2 --- /dev/null +++ b/.github/workflows/centraldb_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply CentralDashboard manifests in KinD +on: + pull_request: + paths: + - apps/centraldashboard/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/centraldashboard/upstream + kubectl create ns kubeflow + kustomize build overlays/kserve | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/jwa_kind_test.yaml b/.github/workflows/jwa_kind_test.yaml new file mode 100644 index 000000000..8c8d3ceb8 --- /dev/null +++ b/.github/workflows/jwa_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply JWA manifests in KinD +on: + pull_request: + paths: + - apps/jupyter/jupyter-web-app/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/jupyter/jupyter-web-app/upstream + kubectl create ns kubeflow + kustomize build overlays/istio | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/katib_kind_test.yaml b/.github/workflows/katib_kind_test.yaml new file mode 100644 index 000000000..e67e3592f --- /dev/null +++ b/.github/workflows/katib_kind_test.yaml @@ -0,0 +1,34 @@ +name: Build & Apply Katib manifests in KinD +on: + pull_request: + paths: + - apps/katib/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Install cert-manager + run: ./testing/gh-actions/install_cert_manager.sh + + - name: Build & Apply manifests + run: | + cd apps/katib/upstream + kubectl create ns kubeflow + kustomize build installs/katib-with-kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/kserve_kind_test.yaml b/.github/workflows/kserve_kind_test.yaml new file mode 100644 index 000000000..d778dd19b --- /dev/null +++ b/.github/workflows/kserve_kind_test.yaml @@ -0,0 +1,35 @@ +name: Build & Apply KServe manifests in KinD +on: + pull_request: + paths: + - contrib/kserve/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Install cert-manager + run: ./testing/gh-actions/install_cert_manager.sh + + - name: Build & Apply manifests + run: | + cd contrib/kserve + kubectl create ns kubeflow + kustomize build kserve | kubectl apply -f - + kustomize build models-web-app/overlays/kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/nb_controller_kind_test.yaml b/.github/workflows/nb_controller_kind_test.yaml new file mode 100644 index 000000000..007de0a56 --- /dev/null +++ b/.github/workflows/nb_controller_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply Notebook Controller manifests in KinD +on: + pull_request: + paths: + - apps/jupyter/notebook-controller/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/jupyter/notebook-controller/upstream + kubectl create ns kubeflow + kustomize build overlays/kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/pipeline_kind_test.yaml b/.github/workflows/pipeline_kind_test.yaml new file mode 100644 index 000000000..d6ad29e8b --- /dev/null +++ b/.github/workflows/pipeline_kind_test.yaml @@ -0,0 +1,34 @@ +name: Build & Apply Kubeflow Pipelines manifests in KinD +on: + pull_request: + paths: + - apps/pipeline/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Install cert-manager + run: ./testing/gh-actions/install_cert_manager.sh + + - name: Build & Apply manifests + run: | + cd apps/pipeline/upstream + kubectl create ns kubeflow + kustomize build env/cert-manager/platform-agnostic-multi-user | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/poddefaults_kind_test.yaml b/.github/workflows/poddefaults_kind_test.yaml new file mode 100644 index 000000000..fa99e1f32 --- /dev/null +++ b/.github/workflows/poddefaults_kind_test.yaml @@ -0,0 +1,34 @@ +name: Build & Apply PodDefaults manifests in KinD +on: + pull_request: + paths: + - apps/admission-webhook/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Install cert-manager + run: ./testing/gh-actions/install_cert_manager.sh + + - name: Build & Apply manifests + run: | + cd apps/admission-webhook/upstream + kubectl create ns kubeflow + kustomize build overlays/cert-manager | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/profiles_kind_test.yaml b/.github/workflows/profiles_kind_test.yaml new file mode 100644 index 000000000..fb07207b9 --- /dev/null +++ b/.github/workflows/profiles_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply Profiles manifests in KinD +on: + pull_request: + paths: + - apps/profiles/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/profiles/upstream + kubectl create ns kubeflow + kustomize build overlays/kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/tb_controller_kind_test.yaml b/.github/workflows/tb_controller_kind_test.yaml new file mode 100644 index 000000000..8ab37301c --- /dev/null +++ b/.github/workflows/tb_controller_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply Tensorboard Controller manifests in KinD +on: + pull_request: + paths: + - apps/tensorboard/tensorboard-controller/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/tensorboard/tensorboard-controller/upstream + kubectl create ns kubeflow + kustomize build overlays/kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/train_operator_kind_test.yaml b/.github/workflows/train_operator_kind_test.yaml new file mode 100644 index 000000000..4dbaa6e18 --- /dev/null +++ b/.github/workflows/train_operator_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply Training Operator manifests in KinD +on: + pull_request: + paths: + - apps/training-operator/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/training-operator/upstream + kubectl create ns kubeflow + kustomize build overlays/kubeflow | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/twa_kind_test.yaml b/.github/workflows/twa_kind_test.yaml new file mode 100644 index 000000000..afb74e6af --- /dev/null +++ b/.github/workflows/twa_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply TWA manifests in KinD +on: + pull_request: + paths: + - apps/tensorboard/tensorboards-web-app/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/tensorboard/tensorboards-web-app/upstream + kubectl create ns kubeflow + kustomize build overlays/istio | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/.github/workflows/vwa_kind_test.yaml b/.github/workflows/vwa_kind_test.yaml new file mode 100644 index 000000000..b5822d2f9 --- /dev/null +++ b/.github/workflows/vwa_kind_test.yaml @@ -0,0 +1,31 @@ +name: Build & Apply VWA manifests in KinD +on: + pull_request: + paths: + - apps/volumes-web-app/upstream/** + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install KinD + run: ./testing/gh-actions/install_kind.sh + + - name: Create KinD Cluster + run: kind create cluster --config testing/gh-actions/kind-1-22.yaml + + - name: Install kustomize + run: ./testing/gh-actions/install_kustomize.sh + + - name: Install Istio + run: ./testing/gh-actions/install_istio.sh + + - name: Build & Apply manifests + run: | + cd apps/volumes-web-app/upstream + kubectl create ns kubeflow + kustomize build overlays/istio | kubectl apply -f - + kubectl wait --for=condition=Ready pods --all --all-namespaces --timeout 180s diff --git a/testing/gh-actions/install_cert_manager.sh b/testing/gh-actions/install_cert_manager.sh new file mode 100755 index 000000000..dcb855abc --- /dev/null +++ b/testing/gh-actions/install_cert_manager.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e +echo "Installing cert-manager ..." +cd common/cert-manager +kubectl create namespace cert-manager +kustomize build cert-manager/base | kubectl apply -f - +echo "Waiting for cert-manager to be ready ..." +kubectl wait --for=condition=ready pod -l 'app in (cert-manager,webhook)' --timeout=180s -n cert-manager +kustomize build kubeflow-issuer/base | kubectl apply -f - \ No newline at end of file diff --git a/testing/gh-actions/install_istio.sh b/testing/gh-actions/install_istio.sh new file mode 100755 index 000000000..7513c882c --- /dev/null +++ b/testing/gh-actions/install_istio.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +echo "Installing Istio ..." +cd common/istio-1-11 +kustomize build istio-crds/base | kubectl apply -f - +kustomize build istio-namespace/base | kubectl apply -f - +kustomize build istio-install/base | kubectl apply -f - \ No newline at end of file diff --git a/testing/gh-actions/install_kind.sh b/testing/gh-actions/install_kind.sh new file mode 100755 index 000000000..2c7f9eedc --- /dev/null +++ b/testing/gh-actions/install_kind.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +echo "Fetching KinD executable ..." +sudo swapoff -a +sudo rm -f /swapfile +sudo mkdir -p /tmp/etcd +sudo mount -t tmpfs tmpfs /tmp/etcd +curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64 +chmod +x ./kind +sudo mv kind /usr/local/bin \ No newline at end of file diff --git a/testing/gh-actions/install_kustomize.sh b/testing/gh-actions/install_kustomize.sh new file mode 100755 index 000000000..45196faf6 --- /dev/null +++ b/testing/gh-actions/install_kustomize.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e +curl --silent --location --remote-name "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.2.3/kustomize_kustomize.v3.2.3_linux_amd64" +chmod a+x kustomize_kustomize.v3.2.3_linux_amd64 +sudo mv kustomize_kustomize.v3.2.3_linux_amd64 /usr/local/bin/kustomize \ No newline at end of file diff --git a/testing/gh-actions/kind-1-22.yaml b/testing/gh-actions/kind-1-22.yaml new file mode 100644 index 000000000..bd4eaa69a --- /dev/null +++ b/testing/gh-actions/kind-1-22.yaml @@ -0,0 +1,24 @@ +apiVersion: kind.x-k8s.io/v1alpha4 +kind: Cluster +# Configure registry for KinD. +containerdConfigPatches: +- |- + [plugins."io.containerd.grpc.v1.cri".registry.mirrors."$REGISTRY_NAME:$REGISTRY_PORT"] + endpoint = ["http://$REGISTRY_NAME:$REGISTRY_PORT"] +# This is needed in order to support projected volumes with service account tokens. +# See: https://kubernetes.slack.com/archives/CEKK1KTN2/p1600268272383600 +kubeadmConfigPatches: + - | + apiVersion: kubeadm.k8s.io/v1beta2 + kind: ClusterConfiguration + metadata: + name: config + apiServer: + extraArgs: + "service-account-issuer": "kubernetes.default.svc" + "service-account-signing-key-file": "/etc/kubernetes/pki/sa.key" +nodes: +- role: control-plane + image: kindest/node:1.22.9@sha256:ad5b8404c4052781365a4e70bb7d17c5331e4177bd4a7cd214339316cd6193b6 +- role: worker + image: kindest/node:1.22.9@sha256:ad5b8404c4052781365a4e70bb7d17c5331e4177bd4a7cd214339316cd6193b6