From ba32190892fa054929d413055e0dc253a44c71f1 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 19:54:45 +0100 Subject: [PATCH 01/13] Create kind-of-e2e.yml --- .github/workflows/kind-of-e2e.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/kind-of-e2e.yml diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml new file mode 100644 index 0000000000000..aa0e37051f95c --- /dev/null +++ b/.github/workflows/kind-of-e2e.yml @@ -0,0 +1,21 @@ +name: Create Cluster + +on: pull_request + +jobs: + create-cluster: + runs-on: ubuntu-latest + container: + image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.3.49 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1.3.0 + + - name: Deploy stackrox + run: MAIN_IMAGE_TAG="3.72.0" ./deploy/k8s/deploy-local.sh From f872d7ce17ade7e803412bccd92256709e578ff9 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 19:59:47 +0100 Subject: [PATCH 02/13] Update kind-of-e2e.yml --- .github/workflows/kind-of-e2e.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml index aa0e37051f95c..32216b46e621d 100644 --- a/.github/workflows/kind-of-e2e.yml +++ b/.github/workflows/kind-of-e2e.yml @@ -5,8 +5,6 @@ on: pull_request jobs: create-cluster: runs-on: ubuntu-latest - container: - image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.3.49 steps: - name: Checkout uses: actions/checkout@v3 @@ -17,5 +15,8 @@ jobs: - name: Create k8s Kind Cluster uses: helm/kind-action@v1.3.0 + - name: Check + run: kubectl get nodes + - name: Deploy stackrox run: MAIN_IMAGE_TAG="3.72.0" ./deploy/k8s/deploy-local.sh From a34f739db701063b845dd1678c1839deeedd7e10 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:03:10 +0100 Subject: [PATCH 03/13] latest --- .github/workflows/kind-of-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml index 32216b46e621d..7d74366ec52b4 100644 --- a/.github/workflows/kind-of-e2e.yml +++ b/.github/workflows/kind-of-e2e.yml @@ -19,4 +19,4 @@ jobs: run: kubectl get nodes - name: Deploy stackrox - run: MAIN_IMAGE_TAG="3.72.0" ./deploy/k8s/deploy-local.sh + run: MAIN_IMAGE_TAG="latest" ./deploy/k8s/deploy-local.sh From 1e72f34089324ba5fcd14f78bd1752f3b89345a2 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:12:55 +0100 Subject: [PATCH 04/13] Update kind-of-e2e.yml --- .github/workflows/kind-of-e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml index 7d74366ec52b4..d0434f7045956 100644 --- a/.github/workflows/kind-of-e2e.yml +++ b/.github/workflows/kind-of-e2e.yml @@ -5,6 +5,7 @@ on: pull_request jobs: create-cluster: runs-on: ubuntu-latest + timeout-minutes: 300 steps: - name: Checkout uses: actions/checkout@v3 From 9707dc661183f1f9d28878b976bb310f2f9dce1e Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:26:12 +0100 Subject: [PATCH 05/13] timeout --- deploy/common/k8sbased.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index e9c4b5d88c5bb..d11a2c829312c 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -258,6 +258,7 @@ function launch_central { # New helm setup flavor helm_args=( + --timeout 10m -f "$unzip_dir/values-public.yaml" -f "$unzip_dir/values-private.yaml" --set-string imagePullSecrets.useExisting="stackrox;stackrox-scanner" From fa286d5187330890b6566bac8ba44dfc6c558951 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:31:36 +0100 Subject: [PATCH 06/13] debug --- deploy/common/k8sbased.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index d11a2c829312c..fa50daaa9d178 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -x + function realpath { [[ -n "$1" ]] || return 0 python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$1" From c07939ea3faecac9178bf490f3e7ee14d8b833d8 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:35:28 +0100 Subject: [PATCH 07/13] Timeout --- scripts/quick-helm-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/quick-helm-install.sh b/scripts/quick-helm-install.sh index 7b643f7a3c366..12ceacf81ab77 100755 --- a/scripts/quick-helm-install.sh +++ b/scripts/quick-helm-install.sh @@ -70,11 +70,11 @@ helm install -n stackrox --create-namespace stackrox-central-services stackrox/s --set central.adminPassword.value="${STACKROX_ADMIN_PASSWORD}" \ "${installflags[@]+"${installflags[@]}"}" -kubectl -n stackrox rollout status deploy/central --timeout=3m +kubectl -n stackrox rollout status deploy/central --timeout=30m echo "Setting up central port-forward" -kubectl -n stackrox port-forward deploy/central --pod-running-timeout=1m0s 8000:8443 > /dev/null 2>&1 & +kubectl -n stackrox port-forward deploy/central --pod-running-timeout=10m0s 8000:8443 > /dev/null 2>&1 & echo "Generating an init bundle with stackrox-secured-cluster-services provisioning secrets" From 5447f419276baaa489cec2fc31c09c59ffb32806 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:35:41 +0100 Subject: [PATCH 08/13] Revert "timeout" This reverts commit 9707dc661183f1f9d28878b976bb310f2f9dce1e. --- deploy/common/k8sbased.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index fa50daaa9d178..7eec8153385c4 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -260,7 +260,6 @@ function launch_central { # New helm setup flavor helm_args=( - --timeout 10m -f "$unzip_dir/values-public.yaml" -f "$unzip_dir/values-private.yaml" --set-string imagePullSecrets.useExisting="stackrox;stackrox-scanner" From a3fae9011fda38d3f9b8bf1e5ef40148a7a71c66 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:41:50 +0100 Subject: [PATCH 09/13] Timeout --- deploy/common/k8sbased.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index 7eec8153385c4..c835bec6f7ee6 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -375,7 +375,7 @@ function launch_central { # On some systems there's a race condition when port-forward connects to central but its pod then gets deleted due # to ongoing modifications to the central deployment. This port-forward dies and the script hangs "Waiting for # Central to respond" until it times out. Waiting for rollout status should help not get into such situation. - rollout_wait_timeout="3m" + rollout_wait_timeout="30m" if [[ "${IS_RACE_BUILD:-}" == "true" ]]; then rollout_wait_timeout="9m" fi From 6cfac1a4e0e3f62768d4990f11c72350b86d2743 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:42:10 +0100 Subject: [PATCH 10/13] Revert "Timeout" This reverts commit c07939ea3faecac9178bf490f3e7ee14d8b833d8. --- scripts/quick-helm-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/quick-helm-install.sh b/scripts/quick-helm-install.sh index 12ceacf81ab77..7b643f7a3c366 100755 --- a/scripts/quick-helm-install.sh +++ b/scripts/quick-helm-install.sh @@ -70,11 +70,11 @@ helm install -n stackrox --create-namespace stackrox-central-services stackrox/s --set central.adminPassword.value="${STACKROX_ADMIN_PASSWORD}" \ "${installflags[@]+"${installflags[@]}"}" -kubectl -n stackrox rollout status deploy/central --timeout=30m +kubectl -n stackrox rollout status deploy/central --timeout=3m echo "Setting up central port-forward" -kubectl -n stackrox port-forward deploy/central --pod-running-timeout=10m0s 8000:8443 > /dev/null 2>&1 & +kubectl -n stackrox port-forward deploy/central --pod-running-timeout=1m0s 8000:8443 > /dev/null 2>&1 & echo "Generating an init bundle with stackrox-secured-cluster-services provisioning secrets" From 1dc3d6534b55b3b904d84ffac6947ab35284cae7 Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 20:57:12 +0100 Subject: [PATCH 11/13] get pods --- .github/workflows/kind-of-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml index d0434f7045956..39f086549c08f 100644 --- a/.github/workflows/kind-of-e2e.yml +++ b/.github/workflows/kind-of-e2e.yml @@ -20,4 +20,4 @@ jobs: run: kubectl get nodes - name: Deploy stackrox - run: MAIN_IMAGE_TAG="latest" ./deploy/k8s/deploy-local.sh + run: MAIN_IMAGE_TAG="latest" ./deploy/k8s/deploy-local.sh || kubectl get pods From 70f289414272bce03c7d27231bec9ff109fa187d Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Wed, 30 Nov 2022 21:14:33 +0100 Subject: [PATCH 12/13] fix --- .github/workflows/kind-of-e2e.yml | 2 +- deploy/common/k8sbased.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kind-of-e2e.yml b/.github/workflows/kind-of-e2e.yml index 39f086549c08f..73b56d185113d 100644 --- a/.github/workflows/kind-of-e2e.yml +++ b/.github/workflows/kind-of-e2e.yml @@ -20,4 +20,4 @@ jobs: run: kubectl get nodes - name: Deploy stackrox - run: MAIN_IMAGE_TAG="latest" ./deploy/k8s/deploy-local.sh || kubectl get pods + run: MAIN_IMAGE_TAG="latest" ./deploy/k8s/deploy-local.sh || kubectl -n stackrox get pods diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index c835bec6f7ee6..7eec8153385c4 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -375,7 +375,7 @@ function launch_central { # On some systems there's a race condition when port-forward connects to central but its pod then gets deleted due # to ongoing modifications to the central deployment. This port-forward dies and the script hangs "Waiting for # Central to respond" until it times out. Waiting for rollout status should help not get into such situation. - rollout_wait_timeout="30m" + rollout_wait_timeout="3m" if [[ "${IS_RACE_BUILD:-}" == "true" ]]; then rollout_wait_timeout="9m" fi From 6910415e9289f706580d93b2d905bbb3f71a50ae Mon Sep 17 00:00:00 2001 From: Tomasz Janiszewski Date: Thu, 1 Dec 2022 16:08:43 +0100 Subject: [PATCH 13/13] timeout --- deploy/common/k8sbased.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/common/k8sbased.sh b/deploy/common/k8sbased.sh index 7eec8153385c4..c835bec6f7ee6 100644 --- a/deploy/common/k8sbased.sh +++ b/deploy/common/k8sbased.sh @@ -375,7 +375,7 @@ function launch_central { # On some systems there's a race condition when port-forward connects to central but its pod then gets deleted due # to ongoing modifications to the central deployment. This port-forward dies and the script hangs "Waiting for # Central to respond" until it times out. Waiting for rollout status should help not get into such situation. - rollout_wait_timeout="3m" + rollout_wait_timeout="30m" if [[ "${IS_RACE_BUILD:-}" == "true" ]]; then rollout_wait_timeout="9m" fi