From 5891e4d9ba087a56c64ccb3056b93f717b40b218 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Fri, 1 Jul 2022 17:44:41 +1000 Subject: [PATCH 1/5] chore: update image references --- node-packages/commons/src/tasks.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/node-packages/commons/src/tasks.ts b/node-packages/commons/src/tasks.ts index ce10f578bc..8b73539121 100644 --- a/node-packages/commons/src/tasks.ts +++ b/node-packages/commons/src/tasks.ts @@ -1182,11 +1182,8 @@ export const createMiscTask = async function(taskData: any) { } else if (overwriteActiveStandbyTaskImage) { // allow to overwrite the image we use via OVERWRITE_ACTIVESTANDBY_TASK_IMAGE env variable taskImage = overwriteActiveStandbyTaskImage - } else if (lagoonEnvironmentType == 'production') { - taskImage = `amazeeio/task-activestandby:${lagoonVersion}` } else { - // we are a development enviornment, use the amazeeiolagoon image with the same branch name - taskImage = `amazeeiolagoon/task-activestandby:${lagoonGitSafeBranch}` + taskImage = `uselagoon/task-activestandby:${lagoonVersion}` } miscTaskData.advancedTask.runnerImage = taskImage // miscTaskData.advancedTask.runnerImage = "shreddedbacon/runner:latest" From 00df8a64030ea02c86c34fbe982bfb21578b5951 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Fri, 1 Jul 2022 17:46:42 +1000 Subject: [PATCH 2/5] chore: increase timeout to 30 minutes, add some additional pending messages to indicate something is happening --- taskimages/activestandby/main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/taskimages/activestandby/main.go b/taskimages/activestandby/main.go index fedce2e75e..eee9e2db92 100644 --- a/taskimages/activestandby/main.go +++ b/taskimages/activestandby/main.go @@ -100,8 +100,8 @@ func main() { } // check the status of the crd until we have the status conditions. - // otherwise give up after 10 minutes. 60 retries, 10 seconds apart. - try.MaxRetries = 60 + // otherwise give up after 30 minutes. 180 retries, 10 seconds apart. + try.MaxRetries = 180 err = try.Do(func(attempt int) (bool, error) { var err error if err := c.Get(context.Background(), types.NamespacedName{ @@ -211,16 +211,17 @@ Provide a copy of this entire log to the team.`, err) fmt.Printf("Task failed, error was: no spec found in resource") os.Exit(1) } + fmt.Printf("Task current status is %s, retrying check", mapval["type"].(string)) } } } - // sleep for 5 seconds up to a maximum of 60 times (5 minutes) before finally giving up + // sleep for 10 seconds up to a maximum of 180 times (30 minutes) before finally giving up time.Sleep(10 * time.Second) err = fmt.Errorf("status condition not met yet") - return attempt < 60, err + return attempt < 180, err }) if err != nil { - fmt.Printf("Task failed, timed out after 10 minutes waiting for the job to start: %v", err) + fmt.Printf("Task failed, timed out after 30 minutes waiting for the job to start: %v", err) os.Exit(1) } } From 0a0861bbed0ec0afc956362672c226fd43433844 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Mon, 11 Jul 2022 14:56:52 +1000 Subject: [PATCH 3/5] chore: update to allow overriding the activestandby image with one built --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 58b2802ef6..cc877c3e18 100644 --- a/Makefile +++ b/Makefile @@ -504,7 +504,7 @@ STERN_VERSION = 2.1.20 CHART_TESTING_VERSION = v3.6.0 KIND_IMAGE = kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae TESTS = [nginx,api,features-kubernetes,bulk-deployment,features-kubernetes-2,features-api-variables,active-standby-kubernetes,tasks,drush,drupal-php80,drupal-postgres,python,gitlab,github,bitbucket,node-mongodb,elasticsearch,workflows] -CHARTS_TREEISH = "main" +CHARTS_TREEISH = "active-standby-image" # Symlink the installed kubectl client if the correct version is already # installed, otherwise downloads it. @@ -643,6 +643,7 @@ kind/test: kind/cluster helm/repos $(addprefix local-dev/,$(KIND_TOOLS)) $(addpr HELM=$$(realpath ../local-dev/helm) KUBECTL=$$(realpath ../local-dev/kubectl) \ JQ=$$(realpath ../local-dev/jq) \ OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=$$IMAGE_REGISTRY/kubectl-build-deploy-dind:$(SAFE_BRANCH_NAME) \ + OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=$$IMAGE_REGISTRY/task-activestandby:$(SAFE_BRANCH_NAME) \ IMAGE_REGISTRY=$$IMAGE_REGISTRY \ SKIP_INSTALL_REGISTRY=true \ LAGOON_FEATURE_FLAG_DEFAULT_ISOLATION_NETWORK_POLICY=enabled \ @@ -674,6 +675,7 @@ kind/setup: kind/cluster helm/repos $(addprefix local-dev/,$(KIND_TOOLS)) $(addp HELM=$$(realpath ../local-dev/helm) KUBECTL=$$(realpath ../local-dev/kubectl) \ JQ=$$(realpath ../local-dev/jq) \ OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=$$IMAGE_REGISTRY/kubectl-build-deploy-dind:$(SAFE_BRANCH_NAME) \ + OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=$$IMAGE_REGISTRY/task-activestandby:$(SAFE_BRANCH_NAME) \ IMAGE_REGISTRY=$$IMAGE_REGISTRY # kind/local-dev-patch will build the services in LOCAL_DEV_SERVICES on your machine, and then use kubectl patch to mount the folders into Kubernetes @@ -726,6 +728,7 @@ kind/dev: $(addprefix build/,$(KIND_SERVICES)) HELM=$$(realpath ../local-dev/helm) KUBECTL=$$(realpath ../local-dev/kubectl) \ JQ=$$(realpath ../local-dev/jq) \ OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=$$IMAGE_REGISTRY/kubectl-build-deploy-dind:$(SAFE_BRANCH_NAME) \ + OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=$$IMAGE_REGISTRY/task-activestandby:$(SAFE_BRANCH_NAME) \ IMAGE_REGISTRY=$$IMAGE_REGISTRY # kind/push-images pushes locally build images into the kind cluster registry. @@ -767,6 +770,7 @@ kind/retest: HELM=$$(realpath ../local-dev/helm) KUBECTL=$$(realpath ../local-dev/kubectl) \ JQ=$$(realpath ../local-dev/jq) \ OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=$$IMAGE_REGISTRY/kubectl-build-deploy-dind:$(SAFE_BRANCH_NAME) \ + OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=$$IMAGE_REGISTRY/task-activestandby:$(SAFE_BRANCH_NAME) \ IMAGE_REGISTRY=$$IMAGE_REGISTRY \ SKIP_ALL_DEPS=true \ LAGOON_FEATURE_FLAG_DEFAULT_ISOLATION_NETWORK_POLICY=enabled \ From b7190beb8de0eb3fb089abc7b18ebf9db1b58361 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Tue, 12 Jul 2022 09:38:04 +1000 Subject: [PATCH 4/5] chore: add task_images to push-images --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cc877c3e18..cbe29e39f9 100644 --- a/Makefile +++ b/Makefile @@ -505,6 +505,7 @@ CHART_TESTING_VERSION = v3.6.0 KIND_IMAGE = kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae TESTS = [nginx,api,features-kubernetes,bulk-deployment,features-kubernetes-2,features-api-variables,active-standby-kubernetes,tasks,drush,drupal-php80,drupal-postgres,python,gitlab,github,bitbucket,node-mongodb,elasticsearch,workflows] CHARTS_TREEISH = "active-standby-image" +TASK_IMAGES = task-activestandby # Symlink the installed kubectl client if the correct version is already # installed, otherwise downloads it. @@ -732,7 +733,7 @@ kind/dev: $(addprefix build/,$(KIND_SERVICES)) IMAGE_REGISTRY=$$IMAGE_REGISTRY # kind/push-images pushes locally build images into the kind cluster registry. -IMAGES = $(KIND_SERVICES) $(LOCAL_DEV_SERVICES) +IMAGES = $(KIND_SERVICES) $(LOCAL_DEV_SERVICES) $(TASK_IMAGES) .PHONY: kind/push-images kind/push-images: export KUBECONFIG="$$(pwd)/kubeconfig.kind.$(CI_BUILD_TAG)" && \ From cc1404e8ebd8f2c3075086a0697a19249354b2e0 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Wed, 13 Jul 2022 08:51:51 +1000 Subject: [PATCH 5/5] chore: revert to use main branch for charts --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cbe29e39f9..f605bb2bd7 100644 --- a/Makefile +++ b/Makefile @@ -504,7 +504,7 @@ STERN_VERSION = 2.1.20 CHART_TESTING_VERSION = v3.6.0 KIND_IMAGE = kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae TESTS = [nginx,api,features-kubernetes,bulk-deployment,features-kubernetes-2,features-api-variables,active-standby-kubernetes,tasks,drush,drupal-php80,drupal-postgres,python,gitlab,github,bitbucket,node-mongodb,elasticsearch,workflows] -CHARTS_TREEISH = "active-standby-image" +CHARTS_TREEISH = "main" TASK_IMAGES = task-activestandby # Symlink the installed kubectl client if the correct version is already