From 4992759f02cc13a40d4173b933cf0c471df88955 Mon Sep 17 00:00:00 2001 From: Jiri Danek Date: Thu, 26 Sep 2024 12:45:09 +0200 Subject: [PATCH] RHOAIENG-9824: gha(odh-nbc): improve the GitHub Actions integration test for odh-notebook-controller to start the controller successfully and run a notebook --- ..._notebook_controller_integration_test.yaml | 200 ++++++++++++++++-- 1 file changed, 181 insertions(+), 19 deletions(-) diff --git a/.github/workflows/odh_notebook_controller_integration_test.yaml b/.github/workflows/odh_notebook_controller_integration_test.yaml index a132b8d7859..2f37bf7afd4 100644 --- a/.github/workflows/odh_notebook_controller_integration_test.yaml +++ b/.github/workflows/odh_notebook_controller_integration_test.yaml @@ -3,11 +3,12 @@ on: push: pull_request: paths: + - .github/workflows/odh_notebook_controller_integration_test.yaml + - components/notebook-controller/** - components/odh-notebook-controller/** workflow_dispatch: env: - IMG: odh-notebook-controller TAG: integration-test jobs: @@ -54,10 +55,19 @@ jobs: cache-dependency-path: components/odh-notebook-controller/go.sum - name: Build Notebook Controller Image + run: | + cd components/notebook-controller + make docker-build + env: + IMG: notebook-controller + CACHE_IMAGE: ghcr.io/${{ github.repository }}/components/notebook-controller/build-cache + + - name: Build ODH Notebook Controller Image run: | cd components/odh-notebook-controller make docker-build env: + IMG: odh-notebook-controller CACHE_IMAGE: ghcr.io/${{ github.repository }}/components/odh-notebook-controller/build-cache - name: Install KinD @@ -66,11 +76,19 @@ jobs: - name: Create KinD Cluster run: kind create cluster --config components/testing/gh-actions/kind-1-25.yaml - - name: Load Images into KinD Cluster + - name: Load image into KinD Cluster run: | - # kind load docker-image localhost/${{env.IMG}}:${{env.TAG}} - podman save -o img.tar localhost/${{env.IMG}}:${{env.TAG}} - kind load image-archive img.tar + podman save -o ${{env.IMG}}.tar localhost/${{env.IMG}}:${{env.TAG}} + kind load image-archive ${{env.IMG}}.tar + env: + IMG: notebook-controller + + - name: Load odh image into KinD Cluster + run: | + podman save -o ${{env.IMG}}.tar localhost/${{env.IMG}}:${{env.TAG}} + kind load image-archive ${{env.IMG}}.tar + env: + IMG: odh-notebook-controller - name: Install kustomize run: ./components/testing/gh-actions/install_kustomize.sh @@ -78,48 +96,192 @@ jobs: - name: Install Istio run: ./components/testing/gh-actions/install_istio.sh + - name: Install fake OpenShift CRDs + run: | + kubectl apply -f - < params.env + export CURRENT_NOTEBOOK_IMG=docker.io/kubeflownotebookswg/notebook-controller + export PR_NOTEBOOK_IMG=localhost/${{env.IMG}}:${{env.TAG}} + kustomize edit set image ${CURRENT_NOTEBOOK_IMG}=${PR_NOTEBOOK_IMG} + # configure culler cat < params.env + + cat <