From 82911a240adcc052a17963e2c21f8fdf236e9b6f Mon Sep 17 00:00:00 2001 From: gene-redpanda <123959009+gene-redpanda@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:09:03 -0600 Subject: [PATCH 1/5] feat: add license to testing --- .buildkite/pipeline.yml | 10 ++++++++++ Makefile | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a3c36f2..599b247 100755 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -33,6 +33,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: aws ubuntu tiered large key: aws-up-ubuntu-ts-large @@ -49,6 +50,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: aws fedora key: aws-up-fedora @@ -98,6 +100,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: aws fedora tiered connect key: aws-up-fed-cts @@ -131,6 +134,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: gcp ubuntu basic key: gcp-up-ubuntu @@ -161,6 +165,7 @@ steps: pre-exit: make destroy-gcp environment: - GCP_CREDS + - REDPANDA_LICENSE - label: gcp fedora basic key: gcp-up-fedora concurrency_group: gcp-fd @@ -189,6 +194,7 @@ steps: image: glrp/atgt:latest environment: - GCP_CREDS + - REDPANDA_LICENSE - label: unstable aws fedora tiered key: aws-us-fedora-tiered concurrency_group: unstable @@ -204,6 +210,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: unstable aws fedora tiered large key: aws-us-fedora-ts-large @@ -220,6 +227,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: unstable aws ubuntu tiered key: aws-us-ubuntu-tiered @@ -236,6 +244,7 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION - label: unstable aws ubuntu tiered large key: aws-us-ubuntu-ts-large @@ -252,4 +261,5 @@ steps: environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY + - REDPANDA_LICENSE - AWS_DEFAULT_REGION diff --git a/Makefile b/Makefile index 3736944..1bb266b 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ BUCKET_NAME := $(subst _,-,$(DEPLOYMENT_ID))-bucket DISTRO ?= ubuntu-focal IS_USING_UNSTABLE ?= false CA_CRT ?= $(PWD)/ansible/tls/ca/ca.crt +REDPANDA_LICENSE ?= empty # RPK RPK_PATH ?= $(ARTIFACT_DIR)/bin/rpk @@ -380,7 +381,7 @@ CLOUD_STORAGE_CREDENTIALS_SOURCE ?= "aws_instance_metadata" .PHONY: cluster-tiered-storage cluster-tiered-storage: ansible-prereqs @mkdir -p $(ARTIFACT_DIR)/logs - ansible-playbook ansible/provision-cluster-tiered-storage.yml --private-key $(PRIVATE_KEY) --extra-vars is_using_unstable=$(IS_USING_UNSTABLE) --extra-vars segment_upload_interval=$(SEGMENT_UPLOAD_INTERVAL) --extra-vars cloud_storage_credentials_source=$(CLOUD_STORAGE_CREDENTIALS_SOURCE) + ansible-playbook ansible/provision-cluster-tiered-storage.yml --private-key $(PRIVATE_KEY) --extra-vars is_using_unstable=$(IS_USING_UNSTABLE) --extra-vars segment_upload_interval=$(SEGMENT_UPLOAD_INTERVAL) --extra-vars cloud_storage_credentials_source=$(CLOUD_STORAGE_CREDENTIALS_SOURCE) --extra-vars redpanda_license=$(REDPANDA_LICENSE) GOOGLE_APPLICATION_CREDENTIALS ?= "/tmp/gcp_creds.json" SIMPLE_BUCKET_NAME=$(shell echo $(BUCKET_NAME) | sed 's/-bucket$$//') From d0c62609ee534e15094acb0c1c0e1dff6987da3d Mon Sep 17 00:00:00 2001 From: gene-redpanda <123959009+gene-redpanda@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:52:13 -0600 Subject: [PATCH 2/5] feat: add license operation --- ansible/operation-apply-license.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ansible/operation-apply-license.yml diff --git a/ansible/operation-apply-license.yml b/ansible/operation-apply-license.yml new file mode 100644 index 0000000..c3bc496 --- /dev/null +++ b/ansible/operation-apply-license.yml @@ -0,0 +1,34 @@ +--- +- name: Apply Redpanda License + hosts: redpanda + become: true + vars: + rpk_bin: rpk + + tasks: + - name: Check cluster health + ansible.builtin.shell: | + {{ rpk_bin }} cluster health | grep -i 'healthy:' | tr -d '[:space:]' | awk -F ':' '{print tolower($2)}' + register: health_check + run_once: true + failed_when: "health_check.stdout != 'true'" + changed_when: false + + - name: Set Redpanda license (string) + ansible.builtin.command: rpk cluster license set {{ redpanda_license }} + run_once: true + when: + - redpanda_license is defined + + - name: Set Redpanda license (path) + ansible.builtin.command: rpk cluster license set --path {{ redpanda_license_path }} + run_once: true + when: + - redpanda_license_path is defined + + - name: Check broker status + ansible.builtin.shell: | + {{ rpk_bin }} redpanda admin brokers list | grep -q 'active.*true' + register: broker_status + changed_when: false + failed_when: broker_status.rc != 0 From ba1d725e146bcc2040f8ffd0aa2a94cfbcbb23f2 Mon Sep 17 00:00:00 2001 From: gene-redpanda <123959009+gene-redpanda@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:23:53 -0600 Subject: [PATCH 3/5] fix: add changed when: false --- ansible/operation-apply-license.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/operation-apply-license.yml b/ansible/operation-apply-license.yml index c3bc496..e05b9e0 100644 --- a/ansible/operation-apply-license.yml +++ b/ansible/operation-apply-license.yml @@ -17,11 +17,13 @@ - name: Set Redpanda license (string) ansible.builtin.command: rpk cluster license set {{ redpanda_license }} run_once: true + changed_when: false when: - redpanda_license is defined - name: Set Redpanda license (path) ansible.builtin.command: rpk cluster license set --path {{ redpanda_license_path }} + changed_when: false run_once: true when: - redpanda_license_path is defined From 2787f8f62ebf7ecf1bc510533ed752d81acd81b6 Mon Sep 17 00:00:00 2001 From: gene-redpanda <123959009+gene-redpanda@users.noreply.github.com> Date: Tue, 3 Dec 2024 05:23:08 -0600 Subject: [PATCH 4/5] ci: change concurrency group --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 599b247..8254c85 100755 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -70,7 +70,7 @@ steps: - AWS_DEFAULT_REGION - label: aws fedora connect key: aws-up-fed-con - concurrency_group: aws-fd + concurrency_group: aws-fd-cn concurrency: 1 command: make ci-aws-rp-connect -e DEPLOYMENT_ID=ci-cn-fd-`tr -dc a-z0-9 Date: Tue, 3 Dec 2024 10:20:27 -0600 Subject: [PATCH 5/5] fix: missing license var --- .buildkite/pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 8254c85..56026e0 100755 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -118,6 +118,7 @@ steps: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - AWS_DEFAULT_REGION + - REDPANDA_LICENSE - CONNECT_RPM_TOKEN - label: aws fedora tiered large key: aws-up-fedora-ts-large