Luke Orland
03/26/2020, 3:00 PMjosh
03/26/2020, 3:01 PMLuke Orland
03/26/2020, 7:56 PM/root/.prefect/my_flow.prefect
within the container to see if it works.
In that context, would it still need to connect to Prefect Cloud to get secrets, or would the
[cloud]
use_local_secrets = true
and all the configs in my ~/.prefect/config.toml
be honored during this local run?josh
03/26/2020, 7:58 PMconfig.toml
inside the container contains your secrets then setting use_local_secrets
to True would use them otherwise it should be fine grabbing the secrets from cloud if set to false. To run your flow inside that container do something like:
from prefect.environments.storage import Docker
flow = Docker().get_flow(flow_location="/root/.prefect/my_flow.prefect")
flow.run()
Luke Orland
03/27/2020, 12:28 AMTraceback (most recent call last):
File "./workflows.py", line 221, in <module>
main()
File "./workflows.py", line 207, in main
flow_location=f'/root/.prefect/{flow.name}.prefect'
File "/home/luke/.pyenv/versions/kepler/lib/python3.7/site-packages/prefect/environments/storage/docker.py", line 214, in get_flow
with open(flow_location, "rb") as f:
PermissionError: [Errno 13] Permission denied: '/root/.prefect/my_flow.prefect'
josh
03/27/2020, 12:43 AMdocker run -it my_image
? Looks like in the image you build you don’t have root accessLuke Orland
03/27/2020, 12:58 AMflow.run()
would run docker run -it ...
for you. I ran that and stopped getting the PermissionError. Now it seems to be failing to find a variable I added to my local prefect config. I'm not copying a config.toml
into the container, so looks like I'll need to figure that out. Thanks for the guidance!