Hey, is there a way to apply a “global default” `d...
# deployment-kubernetes
r
Hey, is there a way to apply a “global default”
dagster-k8s/config
tag to all the Ops without decorating/editing each
@op
? Seems like the
dagster-k8s/config
tag on the job itself applied to the
dagster-run
K8s job only, and not to every
dagster-step
k8s job being executed. (we’re using
k8s_job_executor
and
k8s_run_launcher
) Also, is there a way to change the job executing binary? we’d like to run DataDog’s tracing utility (
ddtrace_run
) and apply it before the actual Dagster command Thanks 🙂
d
Hi Roei - we don't have a 'global default', but could you do something like this?
Copy code
def op_with_default_tags(*args, **kwargs):
    kwargs["tags"] = {**kwargs.get("tags", {}), **{"foo": "bar"}}
    return op(*args, **kwargs)


@op_with_default_tags()
def your_op(foo):
    return foo + 1
Re: changing the binary - if you have a way of changing 'dagster' to point at some other binary that's an option - it just expected to be able to invoke 'dagster' and eventually hit the Dagster Python command You can also override the ENTRYPOINT of your docker image, dagster only plugs in a different CMD but leaves the ENTRYPOINT untouched
s
in case it helps @Roei Jacobovich, we just implemented a custom
@mycompany_job
decorator that applies default k8s tags, as well as hooks, etc. : https://dagster.slack.com/archives/C01U5LFUZJS/p1654881409811469
r
Hey @daniel and @Stephen Bailey! Sorry for the late response - we implemented exactly that. Regarding
ddtrace-run
for anybody else searching for that: we changed the Dockerfile’s
ENTRYPOINT
(to
ENTRYPOINT ["ddtrace-run"]
) as Daniel suggested, and added
DD_TRACE_ENABLED=FALSE
as env for local development to avoid errors. Thanks 🙂
🎉 1