|
8 | 8 | # ---------------------------------------------------------------------------------------------------------------------- |
9 | 9 |
|
10 | 10 | # This is the version of the coherence-go-client |
11 | | -VERSION ?=2.3.0-rc1 |
| 11 | +VERSION ?=2.3.0-rc2 |
12 | 12 | CURRDIR := $(shell pwd) |
13 | 13 | USER_ID := $(shell echo "`id -u`:`id -g`") |
14 | 14 |
|
@@ -178,6 +178,7 @@ copyright: getcopyright ## Check copyright headers |
178 | 178 | -X proto/ \ |
179 | 179 | -X /Dockerfile \ |
180 | 180 | -X .Dockerfile \ |
| 181 | + -X runner \ |
181 | 182 | -X go.sum \ |
182 | 183 | -X HEADER.txt \ |
183 | 184 | -X .iml \ |
@@ -277,6 +278,111 @@ show-docs: ## Show the Documentation |
277 | 278 | trivy-scan: gettrivy ## Scan the CLI using trivy |
278 | 279 | $(TOOLS_BIN)/trivy fs --cache-dir ${TRIVY_CACHE} --exit-code 1 --skip-dirs "./java" . |
279 | 280 |
|
| 281 | +# ====================================================================================================================== |
| 282 | +# Targets related to running KinD clusters for testing |
| 283 | +# ====================================================================================================================== |
| 284 | +##@ KinD |
| 285 | + |
| 286 | +KIND_CLUSTER ?= go-client |
| 287 | +KIND_IMAGE ?= "kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2" |
| 288 | +KIND_SCRIPTS := ./scripts/kind |
| 289 | +NAMESPACE ?= coherence-perf |
| 290 | +OPERATOR_VERSION ?= v3.5.0 |
| 291 | +COHERENCE_IMAGE ?= ghcr.io/oracle/coherence-ce:14.1.2-0-2-java17 |
| 292 | +INITIAL_HEAP ?= 1g |
| 293 | +GO_CLIENT_ARCH ?= amd64 |
| 294 | +GO_IMAGE ?= perf-go-client:1.0.0 |
| 295 | + |
| 296 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 297 | +# Start a Kind cluster |
| 298 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 299 | +.PHONY: kind |
| 300 | +kind: ## Run a default KinD cluster |
| 301 | + kind create cluster --name $(KIND_CLUSTER) --wait 10m --config $(KIND_SCRIPTS)/kind-config.yaml --image $(KIND_IMAGE) |
| 302 | + $(KIND_SCRIPTS)/kind-label-node.sh |
| 303 | + |
| 304 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 305 | +# Stop and delete the Kind cluster |
| 306 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 307 | +.PHONY: kind-stop |
| 308 | +kind-stop: ## Stop and delete the KinD cluster |
| 309 | + kind delete cluster --name $(KIND_CLUSTER) |
| 310 | + |
| 311 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 312 | +# Deploy Coherence Operator |
| 313 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 314 | +.PHONY: deploy-operator |
| 315 | +deploy-operator: ## Deploy the Coherence Operator |
| 316 | + kubectl apply -f https://github.com/oracle/coherence-operator/releases/download/$(OPERATOR_VERSION)/coherence-operator.yaml |
| 317 | + kubectl -n coherence wait --timeout=300s --for condition=available deployment/coherence-operator-controller-manager |
| 318 | + |
| 319 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 320 | +# UnDeploy Coherence Operator |
| 321 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 322 | +.PHONY: undeploy-operator |
| 323 | +undeploy-operator: ## UnDeploy the Coherence Operator |
| 324 | + kubectl delete -f https://github.com/oracle/coherence-operator/releases/download/$(OPERATOR_VERSION)/coherence-operator.yaml || true |
| 325 | + |
| 326 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 327 | +# Deploy Coherence Cluster |
| 328 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 329 | +.PHONY: deploy-coherence |
| 330 | +deploy-coherence: ## Deploy the Coherence Cluster |
| 331 | + envsubst < $(KIND_SCRIPTS)/coherence-cluster.yaml | kubectl apply -n $(NAMESPACE) -f - |
| 332 | + sleep 5 |
| 333 | + kubectl -n $(NAMESPACE) wait --timeout=300s --for condition=Ready coherence/perf-cluster |
| 334 | + |
| 335 | +#----------------------------------------------------------------------------------------------------------------------- |
| 336 | +# Deploy Coherence Cluster |
| 337 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 338 | +.PHONY: build-go-client |
| 339 | +build-go-client: ## Make Go Client |
| 340 | + cd test/e2e/kind && CGO_ENABLED=0 GOOS=linux GOARCH=$(GO_CLIENT_ARCH) GO111MODULE=on go build -trimpath -o runner . && docker build --no-cache -t $(GO_IMAGE) . |
| 341 | + kind --name $(KIND_CLUSTER) load docker-image $(GO_IMAGE) |
| 342 | + |
| 343 | +#----------------------------------------------------------------------------------------------------------------------- |
| 344 | +# Load Schools Data |
| 345 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 346 | +.PHONY: load-schools |
| 347 | +load-schools: ## Load Schools |
| 348 | + kubectl -n $(NAMESPACE) apply -f $(KIND_SCRIPTS)/load-schools.yaml |
| 349 | + kubectl wait -n $(NAMESPACE) --timeout=1200s --for condition=Complete job/go-perf-load-schools |
| 350 | + kubectl -n $(NAMESPACE) delete -f $(KIND_SCRIPTS)/load-schools.yaml || true |
| 351 | + |
| 352 | +#----------------------------------------------------------------------------------------------------------------------- |
| 353 | +# Test Schools |
| 354 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 355 | +.PHONY: deploy-test-schools |
| 356 | +deploy-test-schools: ## Deploy Test Schools |
| 357 | + kubectl -n $(NAMESPACE) apply -f $(KIND_SCRIPTS)/test-schools.yaml |
| 358 | + |
| 359 | +#----------------------------------------------------------------------------------------------------------------------- |
| 360 | +# Stop Schools Test |
| 361 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 362 | +.PHONY: undeploy-test-schools |
| 363 | +undeploy-test-schools: ## Undeploy Test Schools |
| 364 | + kubectl -n $(NAMESPACE) delete -f $(KIND_SCRIPTS)/test-schools.yaml |
| 365 | + |
| 366 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 367 | +# UnDeploy Coherence Cluster |
| 368 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 369 | +.PHONY: undeploy-coherence |
| 370 | +undeploy-coherence: ## UnDeploy the Coherence Cluster |
| 371 | + kubectl delete -n $(NAMESPACE) -f $(KIND_SCRIPTS)/coherence-cluster.yaml || true |
| 372 | + |
| 373 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 374 | +# Create Perf namespace |
| 375 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 376 | +.PHONY: create-namespace |
| 377 | +create-namespace: ## Create the perf test namespace |
| 378 | + kubectl create namespace $(NAMESPACE) |
| 379 | + |
| 380 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 381 | +# Delete Perf namespace |
| 382 | +# ---------------------------------------------------------------------------------------------------------------------- |
| 383 | +.PHONY: delete-namespace |
| 384 | +delete-namespace: ## Create the perf test namespace |
| 385 | + kubectl delete namespace $(NAMESPACE) || true |
280 | 386 |
|
281 | 387 | # ====================================================================================================================== |
282 | 388 | # Test targets |
@@ -344,7 +450,6 @@ test-v1-base: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coh |
344 | 450 | test-examples: test-clean gotestsum $(BUILD_PROPS) ## Run examples tests with Coherence |
345 | 451 | ./scripts/run-test-examples.sh |
346 | 452 |
|
347 | | - |
348 | 453 | # ---------------------------------------------------------------------------------------------------------------------- |
349 | 454 | # Startup cluster members via docker compose |
350 | 455 | # ---------------------------------------------------------------------------------------------------------------------- |
|
0 commit comments