Raffaele Scarano
01/19/2024, 3:03 PMmy-poll
on Google Cloud run using the newly released prefect official cli command.
I'm trying then to deploy a sample hello flow within the prefect.yaml file, following official docs.
Everything works fine until I try to use the prefect conda image.
My dockerfile is:
FROM prefecthq/prefect:2-python3.10-conda
COPY flows opt/prefect/flows
Deploying flow works well, but when I run it I encounter in:
/opt/conda/bin/python: Error while finding module specification for 'prefect.engine' (ModuleNotFoundError: No module named 'prefect')
If I try my dockerfile locally it works well.
I don't know why and how to make a conda image working on google cloud run.
Prefect did a very good work on supporting serverless infrastructures but I can't find any advice on how to use conda env...
I have added this into pull section but nothing changes...
pull:
- prefect.deployments.steps.run_shell_script:
id: conda-env-setup
script: /bin/bash --login -c
stream_output: true
- prefect.deployments.steps.run_shell_script:
id: conda-env-setup1
script: source /opt/conda/etc/profile.d/conda.sh
stream_output: true
- prefect.deployments.steps.run_shell_script:
id: conda-env-setup2
script: conda activate prefect
stream_output: true