Skip to content

Commit

Permalink
Run retries helm config (#8369)
Browse files Browse the repository at this point in the history
### Summary & Motivation

### How I Tested These Changes
  • Loading branch information
johannkm committed Jun 13, 2022
1 parent 142cd80 commit 56fa984
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Daemon(BaseModel):
startupProbe: kubernetes.StartupProbe
annotations: kubernetes.Annotations
runMonitoring: Dict[str, Any]
runRetries: Dict[str, Any]

class Config:
extra = Extra.forbid
16 changes: 16 additions & 0 deletions helm/dagster/schema/schema_tests/test_dagster_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@ def test_run_monitoring(
assert instance["run_monitoring"]["enabled"] == True


def test_run_retries(
instance_template: HelmTemplate,
): # pylint: disable=redefined-outer-name
helm_values = DagsterHelmValues.construct(
dagsterDaemon=Daemon.construct(runRetries={"enabled": True})
)

configmaps = instance_template.render(helm_values)

assert len(configmaps) == 1

instance = yaml.full_load(configmaps[0].data["dagster.yaml"])

assert instance["run_retries"]["enabled"] == True


def test_daemon_labels(template: HelmTemplate):
deployment_labels = {"deployment_label": "label"}
pod_labels = {"pod_label": "label"}
Expand Down
9 changes: 9 additions & 0 deletions helm/dagster/templates/configmap-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,14 @@ data:
poll_interval_seconds: {{ $runMonitoring.pollIntervalSeconds }}
{{- end }}
{{- if and (.Values.dagsterDaemon.enabled) (.Values.dagsterDaemon.runRetries.enabled) }}
{{- $runRetries := .Values.dagsterDaemon.runRetries }}
run_retries:
enabled: {{ $runRetries.enabled }}
{{- if $runRetries.maxRetries }}
max_retries: {{ $runRetries.maxRetries }}
{{- end }}
{{- end }}
telemetry:
enabled: {{ .Values.telemetry.enabled }}
7 changes: 6 additions & 1 deletion helm/dagster/values.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions helm/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ dagsterDaemon:
# run launcher supports resuming runs, otherwise defaults to 0.
maxResumeRunAttempts: ~

runRetries:
enabled: false
maxRetries: 0

# Additional environment variables to set.
# A Kubernetes ConfigMap will be created with these environment variables. See:
# https://kubernetes.io/docs/concepts/configuration/configmap/
Expand Down

0 comments on commit 56fa984

Please sign in to comment.