From cde7e3c7deccca74f6afa9381bb92048a2165b44 Mon Sep 17 00:00:00 2001 From: Kosuke Morimoto Date: Fri, 13 Dec 2024 14:47:21 +0900 Subject: [PATCH] fix workflow --- .github/actions/setup-e2e/action.yaml | 10 ++++++++++ .github/workflows/e2e.yaml | 2 +- Makefile.d/e2e.mk | 11 +---------- Makefile.d/kind.mk | 19 +++++++++++++++---- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup-e2e/action.yaml b/.github/actions/setup-e2e/action.yaml index 6cf1745809..ca45389d5a 100644 --- a/.github/actions/setup-e2e/action.yaml +++ b/.github/actions/setup-e2e/action.yaml @@ -36,6 +36,10 @@ inputs: description: "If minikube is not required, set this to true and set require_k3d to false" required: false default: "false" + require_kind: + description: "If kind is not required, set this to true and set require_k3d to false" + required: false + default: "false" ingress_port: description: 'If it is not "0", ingress will be exposed to the specified port' required: false @@ -91,6 +95,12 @@ runs: run: | make minikube/install make minikube/start + - name: Setup kind environment + if: ${{ inputs.require_kind == 'true' }} + shell: bash + run: | + make kind/install + make kind/vs/start - name: Check Kubernetes cluster shell: bash run: | diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 774161c298..a5b41c79a4 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -315,7 +315,7 @@ jobs: uses: ./.github/actions/setup-e2e with: require_k3d: "false" - require_minikube: "true" + require_kind: "true" - name: Deploy Vald id: deploy_vald uses: ./.github/actions/e2e-deploy-vald diff --git a/Makefile.d/e2e.mk b/Makefile.d/e2e.mk index fd5f05a7d7..ad38fcda82 100644 --- a/Makefile.d/e2e.mk +++ b/Makefile.d/e2e.mk @@ -145,21 +145,12 @@ e2e/actions/run/job: \ ## run GitHub Actions E2E test (Stream CRUD with read replica ) e2e/actions/run/readreplica: \ hack/benchmark/assets/dataset/$(E2E_DATASET_NAME) \ - kind/vs/restart \ - k8s/metrics/metrics-server/deploy - helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server -n kube-system + kind/vs/restart kubectl wait -n kube-system --for=condition=Available deployment/metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) sleep 2 kubectl wait -n kube-system --for=condition=Ready pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) kubectl wait -n kube-system --for=condition=ContainersReady pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT) sleep 3 - mkdir -p $(TEMP_DIR)/csi-driver-hostpath \ - && curl -fsSL https://github.com/kubernetes-csi/csi-driver-host-path/archive/refs/tags/v1.15.0.tar.gz | tar zxf - -C $(TEMP_DIR)/csi-driver-hostpath --strip-components 1 \ - && cd $(TEMP_DIR)/csi-driver-hostpath \ - && deploy/kubernetes-latest/deploy.sh \ - && kubectl apply -f ./examples/csi-storageclass.yaml \ - && kubectl apply -f ././examples/csi-pvc.yaml \ - && rm -rf $(TEMP_DIR)/csi-driver-hostpath $(MAKE) k8s/vald/deploy \ HELM_VALUES=$(ROOTDIR)/.github/helm/values/values-readreplica.yaml sleep 20 diff --git a/Makefile.d/kind.mk b/Makefile.d/kind.mk index 8eca31511a..271acaf2cd 100644 --- a/Makefile.d/kind.mk +++ b/Makefile.d/kind.mk @@ -50,7 +50,6 @@ kind/restart: \ kind/stop \ kind/start - .PHONY: kind/cluster/start ## start kind (kubernetes in docker) multi node cluster kind/cluster/start: @@ -80,6 +79,7 @@ kind/cluster/restart: \ kind/vs/start: \ $(BINDIR)/docker sed -e 's/apiServerAddress: "127.0.0.1"/apiServerAddress: "$(shell grep host.docker.internal /etc/hosts | cut -f1)"/' $(ROOTDIR)/k8s/debug/kind/e2e.yaml | kind create cluster --name $(NAME)-vs --config - + @make kind/vs/login kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml @@ -87,11 +87,22 @@ kind/vs/start: \ kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml - @make kind/vs/login + mkdir -p $(TEMP_DIR)/csi-driver-hostpath \ + && curl -fsSL https://github.com/kubernetes-csi/csi-driver-host-path/archive/refs/tags/v1.15.0.tar.gz | tar zxf - -C $(TEMP_DIR)/csi-driver-hostpath --strip-components 1 \ + && cd $(TEMP_DIR)/csi-driver-hostpath \ + && deploy/kubernetes-latest/deploy.sh \ + && kubectl apply -f ./examples/csi-storageclass.yaml \ + && kubectl apply -f ././examples/csi-pvc.yaml \ + && rm -rf $(TEMP_DIR)/csi-driver-hostpath + + @make k8s/metrics/metrics-server/deploy + helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server -n kube-system + sleep $(K8S_SLEEP_DURATION_FOR_WAIT_COMMAND) .PHONY: kind/vs/stop ## stop kind (kubernetes in docker) cluster with volume snapshot -kind/vs/stop: +kind/vs/stop: \ + $(BINDIR)/docker kind delete cluster --name $(NAME)-vs .PHONY: kind/vs/login @@ -103,4 +114,4 @@ kind/vs/login: ## restart kind (kubernetes in docker) cluster with volume snapshot kind/vs/restart: \ kind/vs/stop \ - kind/vs/start \ No newline at end of file + kind/vs/start