https://dagster.io/ logo
Title
c

Craig Austin

10/13/2022, 10:03 PM
Using
op_tags
on
@asset
to configure the k8s job is not working for me, but from looking at the code/docs, it seems like it should be combining anything in the
pod_spec_config
key in
"dagster-k8s/config"
w/ the dagster-generated job/pod config. I'm using the helm chart to install dagster (w/ run launcher
K8sRunLauncher
) + the user-deployment helm chart to keep user code in a separate repo/namespace.
@asset(
	op_tags={
		"dagster-k8s/config": {
			"pod_spec_config": {
                "tolerations": [{
				    "key": "my-key",
				    "operator": "Exists",
				    "effect": "NoSchedule",
			    }],
            },
		},
	},
)
def my_asset(_):
	pass
a

Adam Bloom

10/14/2022, 12:11 AM
I'm curious about this as well! I've made this work for now by using
define_asset_job
and including the tags there
👍 1
c

Craig Austin

10/14/2022, 12:17 AM
The most natural place for me to set these would be on the
@repository
(at least as a default that could be overridden on assets) but that doesn't seem possible.
c

chris

10/18/2022, 9:45 PM
Filed an issue about the repo-level tags - something that we've discussed at times, but haven't had any concrete plans or discussion around. https://github.com/dagster-io/dagster/issues/10081
👍 1
f

Frédéric Kaczynski

11/23/2022, 3:01 PM
I'm encountering the same issue unfortunately, with this code:
@asset(
    op_tags={
        "dagster-k8s/config": {
            "container_config": {
                "volume_mounts": [
                    {"name": "nfs-data", "mount_path": "/data"}
                ]
            },
            "pod_spec_config": {
                "volumes": [
                    {"name": "nfs-data", "nfs": {...}}
                ]
            }
        }
    }
)
def input_csv_data():
  # ...
Having per-op k8s configuration is useful to give resources (RAM, GPU, ...) to a specific op when it's needed.