Andy H
04/01/2022, 2:33 PMdagster.cli.pipeline.execute_launch_command
. We are moving the codebase to execute via JobDefinition.execute_in_process
. One blocker we are seeing is that we cannot pass a run_id
into execute_in_process
. Is there some other way for us to configure the run_id
, or an equivalent to execute_launch_command
that we should now be using to kick off a job?
I notice that the run_id is grabbed from the return value of create_run_for_pipeline
, in /dagster/core/execution/execute_in_process.py:50
. Thanks in advance!johann
04/04/2022, 5:41 PMchris
04/04/2022, 6:12 PMexecute_launch_command
? I don't believe getting rid of that CLI was intentionaldagster job
cli, which should have all the same functionality, but arguments are targeted in terms of the new APIs: https://docs.dagster.io/_apidocs/cli#dagster-jobAndy H
04/04/2022, 6:31 PMexecute_launch_command
from a python script entrypoint. It is essentially a rest endpoint which will kick off a dagster run. This endpoint receives a run-id which is generated upstream by another service to group together all assets before and including the job run. Is there a programmatic (from the python side of things) way using the new API to launch a job with run_id?execute_launch_command
but I think there are some problems surrounding usage of mode definitions, which we've converted to mode-specific jobs in our repo.chris
04/04/2022, 6:33 PMAndy H
04/04/2022, 6:33 PMchris
04/04/2022, 6:41 PMdefault
.Andy H
04/04/2022, 6:42 PMdagster.cli.pipeline.*
? I perhaps mistakenly assumed we should move away from "pipeline"
based stuff and embrace jobs/graph/`JobDefinition`chris
04/04/2022, 6:42 PMAndy H
04/04/2022, 6:43 PMchris
04/04/2022, 6:43 PMpipeline
based stuffexecute_launch_command
isn't pipeline specific, that's just an unfortunately un-updated module pathAndy H
04/04/2022, 6:46 PMpipeline -> job
in the config arument.
# build run_config dictionary
run_config = json.dumps({
'loggers': {
'console': {},
'webservice': {
'config': {
'endpoint': settings.LOGGING_ENDPOINT,
},
},
},
})
# launch pipeline with run configuration
result = execute_launch_command(instance, {
'mode': settings.PIPELINE_MODE,
'repository': 'main_repository',
'run_id': queue_id,
'location': (
'jobs.main_job'
),
'pipeline': 'main_pipeline',
'config_json': run_config,
})
chris
04/04/2022, 6:48 PMpipeline
and change the value to the job's nameAndy H
04/04/2022, 6:49 PMchris
04/04/2022, 6:50 PMexecute_launch_command
? A lot of the pain here is a result of this being an internal API, I don't think it's exposed in our API docs anywhereAndy H
04/04/2022, 6:54 PMrun_id
injection was part of it, and the other part seems to have been that there was no good way for us to kick off a run programmatically in the background/asynchronously.chris
04/04/2022, 6:58 PMexecute_launch_command
isn't an external facing API, there's no guarantees of support for itexecute_in_process
should be fine for your use case. I've created https://github.com/dagster-io/dagster/issues/7284, I think this should be pretty easily resolvableAndy H
04/04/2022, 7:00 PMchris
04/04/2022, 7:02 PMAndy H
04/04/2022, 7:03 PMexecute_in_process
method is a huge help.chris
04/04/2022, 7:05 PMAndy H
04/04/2022, 7:05 PMchris
04/04/2022, 7:06 PMAndy H
04/04/2022, 7:07 PMchris
04/06/2022, 7:34 PMrun_id
on `execute_in_process`made it into the coming release for tomorrow.Andy H
04/06/2022, 7:35 PM