Skip to content

Commit

Permalink
Merge pull request #184 from zeebe-io/ck-configure-starter
Browse files Browse the repository at this point in the history
Extend starter values to configure starter app
  • Loading branch information
ChrisKujawa authored Sep 2, 2024
2 parents b375bdc + a560a01 commit dd5cb71
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 2 deletions.
16 changes: 15 additions & 1 deletion charts/zeebe-benchmark/templates/starter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,23 @@ spec:
-Dapp.starter.rate={{ .Values.starter.rate }}
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
{{- if .Values.starter.bpmnXmlPath }}
-Dapp.starter.bpmnXmlPath= {{ .Values.starter.bpmnXmlPath | quote }}
{{- end }}
{{- if .Values.starter.extraResources }}
-Dapp.starter.extraBpmnModels=[{{ join "," .Values.starter.extraResources }}]
{{- end }}
{{- if .Values.starter.businessKey }}
-Dapp.starter.businessKey={{ .Values.starter.businessKey | quote }}
{{- end }}
{{- if .Values.starter.payloadPath }}
-Dapp.starter.payloadPath={{ .Values.starter.payloadPath | quote }}
{{- end }}
-XX:+HeapDumpOnOutOfMemoryError
{{- if .Values.starter.logLevel }}
- name: LOG_LEVEL
value: "warn"
value: {{ .Values.starter.logLevel | quote }}
{{- end }}
envFrom:
- configMapRef:
name: starter-config
Expand Down
52 changes: 52 additions & 0 deletions charts/zeebe-benchmark/test/golden/starter-extended.golden.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# Source: zeebe-benchmark/templates/starter.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: starter
labels:
app: starter
spec:
selector:
matchLabels:
app: starter
replicas: 1
template:
metadata:
labels:
app: starter
app.kubernetes.io/component: zeebe-client
spec:
containers:
- name: starter
image: "gcr.io/zeebe-io/starter:SNAPSHOT"
imagePullPolicy: Always
env:
- name: JDK_JAVA_OPTIONS
value: >-
-Dconfig.override_with_env_vars=true
-Dapp.brokerUrl=benchmark-test-zeebe-gateway:26500
-Dapp.starter.rate=150
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
-Dapp.starter.bpmnXmlPath= "bpmn/real.bpmn"
-Dapp.starter.extraBpmnModels=[bpmn/extra.bpmn,bpmn/extra.dmn]
-Dapp.starter.businessKey="customerId"
-Dapp.starter.payloadPath="empty.json"
-XX:+HeapDumpOnOutOfMemoryError
- name: LOG_LEVEL
value: "INFO"
envFrom:
- configMapRef:
name: starter-config
optional: true
resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 250m
memory: 256Mi
ports:
- containerPort: 9600
name: "http"
5 changes: 4 additions & 1 deletion charts/zeebe-benchmark/test/golden/starter.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ spec:
-Dapp.starter.rate=150
-Dapp.starter.durationLimit=0
-Dzeebe.client.requestTimeout=62000
-Dapp.starter.bpmnXmlPath= "bpmn/one_task.bpmn"
-Dapp.starter.businessKey="businessKey"
-Dapp.starter.payloadPath="bpmn/big_payload.json"
-XX:+HeapDumpOnOutOfMemoryError
- name: LOG_LEVEL
value: "warn"
value: "WARN"
envFrom:
- configMapRef:
name: starter-config
Expand Down
26 changes: 26 additions & 0 deletions charts/zeebe-benchmark/test/golden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,29 @@ func TestGoldenWorkers(t *testing.T) {
})
}
}

func TestGoldenExtendedStarter(t *testing.T) {
chartPath, err := filepath.Abs("../")
require.NoError(t, err)
templateNames := []string{"starter"}

values := map[string]string{
"starter.logLevel": "INFO",
"starter.payloadPath": "empty.json",
"starter.bpmnXmlPath": "bpmn/real.bpmn",
"starter.extraResources[0]": "bpmn/extra.bpmn",
"starter.extraResources[1]": "bpmn/extra.dmn",
"starter.businessKey": "customerId",
}

for _, name := range templateNames {
suite.Run(t, &golden.TemplateGoldenTest{
ChartPath: chartPath,
Release: "benchmark-test",
Namespace: "benchmark-" + strings.ToLower(random.UniqueId()),
GoldenFileName: name + "-extended",
Templates: []string{"templates/" + name + ".yaml"},
SetValues: values,
})
}
}
12 changes: 12 additions & 0 deletions charts/zeebe-benchmark/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ starter:
replicas: 1
# Starter.rate defines with which rate process instances should be created by the starter
rate: 150
# Starter.logLevel defines the logging level for the benchmark starter
logLevel: "WARN"
# Starter.payloadPath defines the path (inside the starter app) to the payload resource
# that should be used to create the corresponding process instance
payloadPath: "bpmn/big_payload.json"
# Starter.bpmnXmlPath defines the path (inside the starter app) to the main bpmn XML resource that should be deployed
bpmnXmlPath: "bpmn/one_task.bpmn"
# Starter.extraBpmnModels can be used to specify paths (inside the starter app) to extra resources that should be deployed
extraResources: []
# Starter.businessKey can be used to specify a businessKey variable, inside a unique identifier is stored for
# each created process instance
businessKey: "businessKey"

# Publisher configuration for the to be deployed publisher application
publisher:
Expand Down

0 comments on commit dd5cb71

Please sign in to comment.