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

Extend starter values to configure starter app #184

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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