Michael Warnock
07/27/2021, 2:32 PMflow.run(executor=ex)
as opposed to create_flow_run
on a prefect client. When doing the latter, I get no apparent attempt to start the cluster, and I see task output on my docker agent (which, interestingly, is full of s3 permissions related crashes that don't happen if I don't specify my coiled/dask executor). When running with flow.run
obviously the flow doesn't appear in my dashboard. What's the expected behavior? Am I supposed to have some other kind of agent running?Kevin Kho
flow.run()
does not appear on the dashboard. This is only for local testing. When you’re ready for production, you register the flow.
The client.create_flow_run
takes in a flow id to start so you would need to register first before you can use it.
After registration, you can start a flow by clicking the “Quick Run” button in the UI, that will attempt to pass the flow to an agent. In your case, you want to spin up the local agent that would execute the Flow. Through the CLI it would be prefect agent local start
. This agent will pick up and execute the flow runs. It will also pick up the scheduled flow runs. Just make sure agent labels match the flow labels.Michael Warnock
07/27/2021, 2:47 PMKevin Kho
Michael Warnock
07/27/2021, 2:54 PMcreate_flow_run
I see no attempt to spin up or connect to the dask cluster (which log would that appear in? I also see no indication on the coiled dashboard that a cluster has been started, or any new ec2 instances), and the docker-agent logs are full of errors related to s3 permissions that I don't get if the executor isn't specified.Michael Warnock
07/27/2021, 2:55 PMflow.run
- it actually works, modulo a thread safety issue I'm in the process of fixingKevin Kho
Michael Warnock
07/27/2021, 3:03 PMMichael Warnock
07/27/2021, 3:04 PMKevin Kho
Michael Warnock
07/27/2021, 3:11 PMKevin Kho
flow.run()
will not spin up the container on local to run the flow so I think the environment variables that you have on your local machine are providing that authentication, and those are not in the container with is why the errors are happening.Michael Warnock
07/27/2021, 3:23 PMcreate_flow_task
without the dask-executor. If I fail to provide the credentials, I get an error along the lines of "credentials not found". If I do a flow.run(executor=my-dask-executor)
an image is built by coiled, and run on the cluster it spins up. These tasks access s3 just fine. Something other than my credentials being there is wrong.Zanie
Michael Warnock
07/27/2021, 3:44 PMMichael Warnock
07/27/2021, 3:46 PMMichael Warnock
07/27/2021, 3:48 PMZanie
Michael Warnock
07/27/2021, 3:48 PMMichael Warnock
07/27/2021, 3:49 PMZanie
Zanie
stored_as_script=True
with your Docker storage?Zanie
Michael Warnock
07/27/2021, 3:52 PMMichael Warnock
07/27/2021, 3:53 PMflow = ford.flow
executor = ford.get_coiled_executor(image_uri=image_uri, region_name=worker_config.region_name)
flow.executor = executor
#flow.run_config = ECSRun(image=docker_image)
#flow.run_config = DockerRun()#image=docker_image)
flow_id = flow.register(project_name='feature-generator')
prefect_client = Client()
prefect_client.create_flow_run(
flow_id=flow_id,
parameters=dict(job_spec=job_spec),
)
#flow.run(executor=executor, parameters=dict(job_spec=job_spec))
Michael Warnock
07/27/2021, 3:54 PMflow.storage = Docker(
dockerfile="./Dockerfile",
prefect_directory="/usr/src/app",
stored_as_script=True,
path="/usr/src/app/feature_generator/ford.py"
)
Zanie
Zanie
/usr/src/app/feature_generator/ford.py
then extracting the flow from the variables in the file. Since you are setting the executor in a different file, the executor is never set on your flow run.Michael Warnock
07/27/2021, 3:56 PMZanie
flow.register
and some aren't. Executors are not persisted to allow more customizable options (ie we don't have to know how to serialize/deserialize it)Michael Warnock
07/27/2021, 4:04 PMZanie
executor = ford.get_coiled_executor(image_uri=os.environ.get("IMAGE_URI"), region_name=worker_config.region_name)
flow.executor = executor
Zanie
Michael Warnock
07/27/2021, 4:09 PMMichael Warnock
07/27/2021, 4:10 PMMichael Warnock
07/27/2021, 4:15 PMZanie
Michael Warnock
07/27/2021, 6:14 PMZanie
Zanie
Michael Warnock
07/27/2021, 6:19 PMZanie
Michael Warnock
07/27/2021, 6:21 PMZanie
Zanie
Michael Warnock
07/27/2021, 6:26 PMMichael Warnock
07/27/2021, 6:26 PMZanie
Michael Warnock
07/27/2021, 6:29 PMMichael Warnock
07/27/2021, 6:30 PMZanie
Zanie
RunConfig
with the environment variable set to the URI from CIZanie
Michael Warnock
07/27/2021, 6:35 PMZanie
build()
/ register(build=False)
steps if you're married to Docker storage.Michael Warnock
07/27/2021, 6:42 PMZanie
DockerRun
after you register the flow, it will not be attached to the flowMichael Warnock
07/27/2021, 6:43 PMZanie
Zanie
Michael Warnock
07/27/2021, 6:45 PMMichael Warnock
07/27/2021, 6:46 PMZanie
Michael Warnock
07/27/2021, 8:04 PM