Skip to content

Commit

Permalink
Support running Coherence workloads as K8s Jobs (oracle#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegridman committed Jul 13, 2023
1 parent 6e3ee5c commit 63917a1
Show file tree
Hide file tree
Showing 95 changed files with 10,735 additions and 1,739 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ jobs:
shell: bash
run: make test-all

- name: Doc Tests
shell: bash
run: make test-docs

- name: E2E Local Tests
shell: bash
run: make e2e-local-test
Expand Down
37 changes: 21 additions & 16 deletions .github/workflows/compatibility-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,47 @@ jobs:
fail-fast: false
matrix:
compatibilityVersion:
- 3.2.11
- 3.2.10
- 3.2.9
- 3.2.8
# - 3.2.8
- 3.2.7
- 3.2.6
- 3.2.5
- 3.1.5
include:
- compatibilityVersion: 3.2.11
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f
- compatibilityVersion: 3.2.10
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.26.0@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352
k8s: kindest/node:v1.26.3@sha256:61b92f38dff6ccc29969e7aa154d34e38b89443af1a2c14e6cfbd2df6419c66f
- compatibilityVersion: 3.2.9
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
- compatibilityVersion: 3.2.8
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
# - compatibilityVersion: 3.2.8
# coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
# compatibilitySelector: control-plane=coherence
# k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.2.7
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.2.6
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.2.5
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.4"
coherence-image: "ghcr.io/oracle/coherence-ce:22.06.3"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e
k8s: kindest/node:v1.24.12@sha256:1e12918b8bc3d4253bc08f640a231bb0d3b2c5a9b28aa3f2ca1aee93e1e8db16
- compatibilityVersion: 3.1.5
coherence-image: "ghcr.io/oracle/coherence-ce:21.12.4"
compatibilitySelector: control-plane=coherence
k8s: kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
k8s: kindest/node:v1.21.14@sha256:27ef72ea623ee879a25fe6f9982690a3e370c68286f4356bf643467c552a3888

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
docker pull gcr.io/distroless/java11-debian11
docker pull gcr.io/distroless/java17-debian11
- name: Image Scan
- name: Documentation Link Check
shell: bash
run: |
make build-operator
Expand Down
6 changes: 2 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ run:
# - .*/fakes

linters:
enable:
- golint
- gocritic
- gosec

enable-all: true

issues:
# Excluding configuration per-path, per-linter, per-text and per-source
Expand Down
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ VERSION ?= 3.2.12
MVN_VERSION ?= $(VERSION)-SNAPSHOT

# The version number to be replaced by this release
PREV_VERSION ?= 3.2.10
PREV_VERSION ?= 3.2.11

# The operator version to use to run certification tests against
CERTIFICATION_VERSION ?= $(VERSION)

# The previous Operator version used to run the compatibility tests.
COMPATIBLE_VERSION = 3.2.6
COMPATIBLE_VERSION ?= 3.2.11
# The selector to use to find Operator Pods of the COMPATIBLE_VERSION (do not put in double quotes!!)
COMPATIBLE_SELECTOR = control-plane=coherence

Expand Down Expand Up @@ -499,7 +499,7 @@ build-test-images: build-mvn build-client-image build-basic-test-image ## Build
# ----------------------------------------------------------------------------------------------------------------------
.PHONY: build-basic-test-image
build-basic-test-image: build-mvn ## Build the basic Operator test image
./mvnw -B -f java/operator-test package jib:dockerBuild -DskipTests -Djib.to.image=$(TEST_APPLICATION_IMAGE) $(MAVEN_BUILD_OPTS)
./mvnw -B -f java/operator-test clean package jib:dockerBuild -DskipTests -Djib.to.image=$(TEST_APPLICATION_IMAGE) $(MAVEN_BUILD_OPTS) -Dcoherence.version=$(COHERENCE_IMAGE_TAG)

.PHONY: build-client-image
build-client-image: ## Build the test client image
Expand Down Expand Up @@ -588,13 +588,14 @@ $(BUILD_TARGETS)/manifests: $(BUILD_PROPS) config/crd/bases/coherence.oracle.com
config/crd/bases/coherence.oracle.com_coherence.yaml: kustomize $(API_GO_FILES) controller-gen
$(CONTROLLER_GEN) "crd:crdVersions={v1}" \
rbac:roleName=manager-role paths="{./api/...,./controllers/...}" \
output:crd:artifacts:config=config/crd/bases
output:crd:dir=config/crd/bases
cp -R config/crd/ config/crd-small
$(CONTROLLER_GEN) "crd:crdVersions={v1},maxDescLen=0" \
rbac:roleName=manager-role paths="{./api/...,./controllers/...}" \
output:crd:artifacts:config=config/crd-small/bases
output:crd:dir=config/crd-small/bases
cd config/crd && $(KUSTOMIZE) edit add label "app.kubernetes.io/version:$(VERSION)" -f
$(KUSTOMIZE) build config/crd > $(BUILD_ASSETS)/crd_v1.yaml
$(KUSTOMIZE) build config/crd -o $(BUILD_ASSETS)/
cd config/crd-small && $(KUSTOMIZE) edit add label "app.kubernetes.io/version:$(VERSION)" -f

# ----------------------------------------------------------------------------------------------------------------------
# Generate the config.json file used by the Operator for default configuration values
Expand Down Expand Up @@ -756,7 +757,7 @@ run-clean: reset-namespace run ## run the Operator locally after resetting the n
run-debug: export COHERENCE_IMAGE := $(COHERENCE_IMAGE)
run-debug: export OPERATOR_IMAGE := $(OPERATOR_IMAGE)
run-debug: create-namespace ## run the Operator locally with Delve debugger
dlv debug --headless --listen=:2345 --api-version=2 --accept-multiclient \
dlv debug ./runner --headless --listen=:2345 --api-version=2 --accept-multiclient \
-- --skip-service-suspend=true --coherence-dev-mode=true \
--cert-type=self-signed --webhook-service=host.docker.internal

Expand Down Expand Up @@ -1488,6 +1489,14 @@ endef
# ----------------------------------------------------------------------------------------------------------------------
.PHONY: delete-coherence-clusters
delete-coherence-clusters: ## Delete all running Coherence clusters in the test namespace
for i in $$(kubectl -n $(OPERATOR_NAMESPACE) get coherencejob.coherence.oracle.com -o name); do \
kubectl -n $(OPERATOR_NAMESPACE) patch $${i} -p '{"metadata":{"finalizers":[]}}' --type=merge || true ;\
kubectl -n $(OPERATOR_NAMESPACE) delete $${i}; \
done
for i in $$(kubectl -n $(CLUSTER_NAMESPACE) get coherencejob.coherence.oracle.com -o name); do \
kubectl -n $(CLUSTER_NAMESPACE) patch $${i} -p '{"metadata":{"finalizers":[]}}' --type=merge || true ;\
kubectl -n $(CLUSTER_NAMESPACE) delete $${i}; \
done
for i in $$(kubectl -n $(OPERATOR_NAMESPACE) get coherence.coherence.oracle.com -o name); do \
kubectl -n $(OPERATOR_NAMESPACE) patch $${i} -p '{"metadata":{"finalizers":[]}}' --type=merge || true ;\
kubectl -n $(OPERATOR_NAMESPACE) delete $${i}; \
Expand Down Expand Up @@ -2090,7 +2099,7 @@ get-istio: $(BUILD_PROPS)
# ----------------------------------------------------------------------------------------------------------------------
$(TOOLS_BIN)/golangci-lint:
@mkdir -p $(TOOLS_BIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh --header $(GH_AUTH) | sh -s -- -b $(TOOLS_BIN) v1.51.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh --header $(GH_AUTH) | sh -s -- -b $(TOOLS_BIN) v1.52.2

# ----------------------------------------------------------------------------------------------------------------------
# Display the full version string for the artifacts that would be built.
Expand Down
Loading

0 comments on commit 63917a1

Please sign in to comment.