I'd like to use `flyte run` everywhere, but we a...
# flyte-v2-support
e
I'd like to use
flyte run
everywhere, but we are passing a lot of arguments like labels, copy-style, and run-context that would be nice to have a repo default for. Our current solution was to create a wrapping cli that uses the python sdk to launch jobs with all of our defaults. This is not ideal because we lose flexibility and functionality that comes for free with your cli. I looked at the docs and couldn't find an answer on this and I was curious if you had some insight or perhaps I missed something.
b
hi Evan, are you storing those defaults somewhere?
e
Hey! Here is the info dump • Some we just hardcode like
mode
and
copy_style
• Others are dynamic like adding project and user as labels, which maybe we could move out of the CLI and inside our driver task before kicking off the nested training task 🤔 • We pass in a config to all our training workflows and use that to come up with logical name. For training we have a template
t-{config.experiment}-{config.run}
or generate if they are blank.
Copy code
run_context = flyte.with_runcontext(
        name=flyte_run_name, # computed using the inputs
        mode="local" if local else None,
        copy_style="all",
        labels={**attribution_labels, **extra_labels},
        annotations=annotations, 
        ...
    )
I think even hardcoding some things would be valuable!
f
We have settings to add labels etc
🎉 1
b
hey @echoing-pencil-2473, just to get back to this thread: would it makes sense if you can set these defaults via environment variables? e.g.
FLYTE_COPY_STYLE
,
FLYTE_RUN_MODE
, etc? That way you can export a
.env
or env text file for these defaults to kick in on any given session
e
100% yes to
FLYTE_COPY_STYLE
. It's a setting we always have set. Run mode is less important since usually someone decides to run locally or not. My goal is to basically do this and have all our default settings applied.
Copy code
flyte run path/to/file.py --param 1 --local
I followed@freezing-airport-6809’s advice and I have a tiny driver task for most workflows. Those can always add the correct labels and annotations inside a workflow so I can use the flyte cli.
f
Have you tried settings?
e
I'm not sure what that is so no
f
ya i realized we have not published the backend in oss yet
so you can
flyte create / edit settings
this is a way to manage settings for various flyte projects and the entire deployment. things like default labels, etc etc
e
oh that is exactly what I needed!