Skip to content

Commit

Permalink
[helm] dagit.logLevel (#7862)
Browse files Browse the repository at this point in the history
  • Loading branch information
alangenfeld committed May 12, 2022
1 parent c0f86a3 commit 042d3d2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [dagster-dbt] The `load_assets_from_dbt_project()` and `load_assets_from_dbt_manifest()` utilities now have a `use_build_command` parameter. If this flag is set, when materializing your dbt assets, Dagster will use the `dbt build` command instead of `dbt run`. Any tests run during this process will be represented with AssetObservation events attached to the relevant assets. For more information on `dbt build`, see the [dbt docs](https://docs.getdbt.com/reference/commands/build).
- [dagster-dbt] If a dbt project successfully runs some models and then fails, AssetMaterializations will now be generated for the successful models.
- [dagster-snowflake] The new Snowflake IO manager, which you can create using `build_snowflake_io_manager` offers a way to store assets and op outputs in Snowflake. The `PandasSnowflakeTypeHandler` stores Pandas `DataFrame`s in Snowflake.
- [helm] `dagit.logLevel` has been added to values.yaml to access the newly added dagit --log-level cli option.

### Bugfixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Dagit(BaseModel):
annotations: kubernetes.Annotations
enableReadOnly: bool
dbStatementTimeout: Optional[int]
logLevel: Optional[str]

class Config:
extra = Extra.forbid
17 changes: 17 additions & 0 deletions helm/dagster/schema/schema_tests/test_dagit.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ def test_dagit_db_statement_timeout(deployment_template: HelmTemplate):
assert f"--db-statement-timeout {db_statement_timeout_ms}" in command


def test_dagit_log_level(deployment_template: HelmTemplate):
log_level = "trace"
helm_values = DagsterHelmValues.construct(dagit=Dagit.construct(logLevel=log_level))

dagit_deployments = deployment_template.render(helm_values)
command = " ".join(dagit_deployments[0].spec.template.spec.containers[0].command)

assert f"--log-level {log_level}" in command

helm_values = DagsterHelmValues.construct(dagit=Dagit.construct())

dagit_deployments = deployment_template.render(helm_values)
command = " ".join(dagit_deployments[0].spec.template.spec.containers[0].command)

assert "--log-level" not in command


def test_dagit_labels(deployment_template: HelmTemplate):
deployment_labels = {"deployment_label": "label"}
pod_labels = {"pod_label": "label"}
Expand Down
1 change: 1 addition & 0 deletions helm/dagster/templates/helpers/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ If release name contains chart name it will be used as a full name.
dagit -h 0.0.0.0 -p {{ .Values.dagit.service.port }}
{{- if $userDeployments.enabled }} -w /dagster-workspace/workspace.yaml {{- end -}}
{{- with .Values.dagit.dbStatementTimeout }} --db-statement-timeout {{ . }} {{- end -}}
{{- with .Values.dagit.logLevel }} --log-level {{ . }} {{- end -}}
{{- if .dagitReadOnly }} --read-only {{- end -}}
{{- end -}}

Expand Down
11 changes: 11 additions & 0 deletions helm/dagster/values.schema.json

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

3 changes: 3 additions & 0 deletions helm/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ dagit:
# The timeout in milliseconds to set on database statements sent to the Dagster instance.
dbStatementTimeout: ~

# The log level of the uvicorn web server, defaults to warning if not set
logLevel: ~

# 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

1 comment on commit 042d3d2

@vercel
Copy link

@vercel vercel bot commented on 042d3d2 May 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.