i'm trying to deploy the Prefect agent to GKE. I n...
# prefect-community
t
i'm trying to deploy the Prefect agent to GKE. I need a specific version of Python (3.9.13) on the image so I changed the Dockerfile as follows:
Copy code
FROM python:3.9.13

COPY requirements.txt .

RUN pip install -r requirements.txt
Prefect is included in the requirements. When the job is launched, I get the following error:
Copy code
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/prefect/engine.py", line 247, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/usr/local/lib/python3.9/site-packages/prefect/client/utilities.py", line 47, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/prefect/deployments.py", line 159, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=deployment.path, local_path=".")
  File "/usr/local/lib/python3.9/site-packages/prefect/filesystems.py", line 144, in get_directory
    shutil.copytree(from_path, local_path, dirs_exist_ok=True)
  File "/usr/local/lib/python3.9/shutil.py", line 566, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flows'
How do I resolve this?
1
I can see the path attribute at the bottom of the generated deployment file:
Copy code
path: /opt/prefect/flows
j
Hi Tony. The Prefect Docker image has a few more steps, such as changing the workdir. You can see here.
👀 1