Philipp Schneider
04/22/2024, 8:45 PM@task
def run_command(c, command):
return c.run(command, hide=HIDE) # command is bash run_my_script.sh (this takes 30 mins)
I call run_command()
like this:
@flow
def my_remote_script_flow():
# connect to the remote machine
c_wd1 = connect_and_test(host, user, password)
cmd = f"""cd /myfolder/path && bash my_script.sh"""
run_command(c_wd1,cmd)
This fails with:
17:01:45.884 | ERROR | Flow run 'bold-ara' - Crash detected! Execution was cancelled by the runtime environment.
17:01:45.887 | DEBUG | Flow run 'bold-ara' - Crash details:
Traceback (most recent call last):
File "/Users/sam/miniconda3/envs/sam/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 327, in aresult
return await asyncio.wrap_future(self.future)
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/sam/miniconda3/envs/sam/lib/python3.10/site-packages/prefect/engine.py", line 2207, in report_flow_run_crashes
yield
File "/Users/sam/miniconda3/envs/sam/lib/python3.10/site-packages/prefect/engine.py", line 718, in create_and_begin_subflow_run
terminal_state = await orchestrate_flow_run(
File "/Users/sam/miniconda3/envs/sam/lib/python3.10/site-packages/prefect/engine.py", line 875, in orchestrate_flow_run
result = await flow_call.aresult()
File "/Users/sam/miniconda3/envs/sam/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 329, in aresult
Jack P
04/22/2024, 10:02 PMrun_command
task, I only see c_wd1
/`run` being run?
Also, I had experiences in past where I needed to past the task runner, SequentialTaskRunner, through the Flow decorator Argument, task_runner
Let me know if that helpsPhilipp Schneider
04/22/2024, 10:51 PMPhilipp Schneider
04/23/2024, 8:08 AM10:04:47.894 | ERROR | Task run 'run_command-0' - Crash detected! Execution was cancelled by the runtime environment.