Owen
04/03/2020, 1:31 PM@pipleine
def my_pipeline():
run_cmd_in_venv = bash_script_solid(
'.../dagster_pipelines/hello_world.sh',
name = 'hello'
)
execute_solid(
run_cmd_in_venv
)
the output on starting dagit is as follows:
Loading repository...
2020-04-03 13:29:16 - dagster - DEBUG - ephemeral_hello_solid_pipeline - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - PIPELINE_START - Started execution of pipeline "ephemeral_hello_solid_pipeline".
2020-04-03 13:29:16 - dagster - DEBUG - ephemeral_hello_solid_pipeline - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - ENGINE_EVENT - Executing steps in process (pid: 29701)
event_specific_data = {"error": null, "marker_end": null, "marker_start": null, "metadata_entries": [["pid", null, ["29701"]], ["step_keys", null, ["['hello.compute']"]]]}
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - DEBUG - ephemeral_hello_solid_pipeline - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - STEP_START - Started execution of step "hello.compute".
solid = "hello"
solid_definition = "hello"
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - INFO - system - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - using temporary directory: /tmp
solid = "hello"
solid_definition = "hello"
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - INFO - system - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - Temporary script location: /tmp/hellop5yj64ld
solid = "hello"
solid_definition = "hello"
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - INFO - system - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - Running command:
echo "Hello"
solid = "hello"
solid_definition = "hello"
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - INFO - system - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - Hello
solid = "hello"
solid_definition = "hello"
step_key = "hello.compute"
2020-04-03 13:29:16 - dagster - INFO - system - ed74cc0e-4ab8-4f0d-ad3f-3a0839c2ab3c - Command exited with return code 0
... you can see that it executes the solid, which is pretty undesirable.
Am I doing something wrong?nate
04/03/2020, 3:41 PM@pipeline
def my_pipeline():
run_cmd_in_venv = bash_script_solid(
'.../dagster_pipelines/hello_world.sh',
name = 'hello'
)
run_cmd_in_venv()
execute_solid()
is an API primarily for running individual solids in a unit testing context; invoking the solid directly will add it to your pipelineOwen
04/03/2020, 3:52 PMnate
04/03/2020, 3:57 PMOwen
04/08/2020, 10:55 AMnate
04/08/2020, 2:06 PMNothing
input: https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-bash/dagster_bash/solids.py
However, I just landed on master a change to extract the core bash solid compute functions to a separate utils module here: https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-bash/dagster_bash/utils.py
so I think you could define your own solid with something like:
from dagster import solid, InputDefinition
from dagster_bash.utils import execute
@solid(input_defs=[InputDefinition('my_input', str)])
def my_solid(context, my_input):
return execute('echo "{my_input}"'.format(my_input=my_input), output_logging='BUFFER', log=context.log)
(not tested, but that should work)Owen
04/08/2020, 2:33 PMnate
04/21/2020, 2:56 PM