Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running Coherence workloads as K8s Jobs #600

Merged
merged 30 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
89b4a0c
Support running as a Job instead of a StatefulSet
thegridman May 5, 2023
336afc5
Fix broken code
thegridman May 5, 2023
7e59800
Fixing broken tests
thegridman May 5, 2023
a9ad770
Fix code-review
thegridman May 5, 2023
fd952b8
Fixing update patching
thegridman May 6, 2023
7ee41fc
Fixing doc links
thegridman May 6, 2023
9d64a4d
Fixing copyright years
thegridman May 6, 2023
3542c76
Adding tests
thegridman May 7, 2023
46e07ea
Fix tests
thegridman May 7, 2023
2ee6a27
Fixing bugs
thegridman May 10, 2023
a63e674
Fix copyright date
thegridman May 10, 2023
83749b8
Adding CoherenceJob CRD
thegridman May 12, 2023
734dde5
Fix CRD patch
thegridman May 12, 2023
ae8f5b8
Fix bugs
thegridman May 12, 2023
4891022
Fix tests
thegridman May 12, 2023
be37201
Add Job tests
thegridman May 12, 2023
d726811
Fix RBAC roles in Helm chart
thegridman May 12, 2023
1b3d417
Refactor
thegridman May 13, 2023
15aaa50
Fix compatibility tests
thegridman May 13, 2023
3f65e10
Add CoherenceJob test
thegridman May 13, 2023
162515a
Fixing build
thegridman May 14, 2023
5dd7eb7
Add Job test
thegridman May 15, 2023
d82e64f
Fixing test assertion
thegridman May 16, 2023
ddbb39f
Adding Job tests
thegridman May 18, 2023
9aeedfb
Fix code review errors
thegridman May 18, 2023
7857533
Fix Coherence compatibility build
thegridman May 18, 2023
c384563
Use Coherence 22.06.4
thegridman May 20, 2023
282c319
Add job probe status
thegridman May 22, 2023
4b41ce3
Add job ready action test
thegridman May 22, 2023
726b51d
Merge branch 'oracle:main' into jobs
thegridman May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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