Skip to content

Commit

Permalink
fix(helm): allow max concurrent runs to be 0 (#7618)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Apr 27, 2022
1 parent 0cbc38b commit cc2060a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions helm/dagster/schema/schema_tests/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ def test_celery_k8s_run_launcher_config(template: HelmTemplate):


@pytest.mark.parametrize("enabled", [True, False])
def test_queued_run_coordinator_config(template: HelmTemplate, enabled: bool):
max_concurrent_runs = 50
@pytest.mark.parametrize("max_concurrent_runs", [0, 50])
def test_queued_run_coordinator_config(
template: HelmTemplate, enabled: bool, max_concurrent_runs: int
):
tag_concurrency_limits = [TagConcurrencyLimit(key="key", value="value", limit=10)]
dequeue_interval_seconds = 50
helm_values = DagsterHelmValues.construct(
Expand Down
4 changes: 3 additions & 1 deletion helm/dagster/templates/helpers/instance/_run-coordinator.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ module: dagster.core.run_coordinator
class: QueuedRunCoordinator
{{- if not (empty (compact (values $queuedRunCoordinatorConfig))) }}
config:
{{- if $queuedRunCoordinatorConfig.maxConcurrentRuns }}
# Workaround to prevent 0 from being interpreted as falsey:
# https://github.com/helm/helm/issues/3164#issuecomment-709537506
{{- if not (kindIs "invalid" $queuedRunCoordinatorConfig.maxConcurrentRuns) }}
max_concurrent_runs: {{ $queuedRunCoordinatorConfig.maxConcurrentRuns }}
{{- end }}

Expand Down

0 comments on commit cc2060a

Please sign in to comment.