Emma Rizzi
04/14/2023, 8:19 AMpush:True
to a private registry ?
Right now, my flow is built and push, the flow.py
is inside the docker image, and I tried to configure the pull step with prefect.projects.steps.set_working_directory
but I get
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flow'
It seems that the pull step is executed outside of the docker container ? my code in threadFROM xxx/prefect:base-3.10-0.1
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY ./* /opt/prefect/flow/
name: flow
prefect-version: 2.10.4
build:
- prefect_docker.projects.steps.build_docker_image:
requires: prefect-docker>0.1.0
image_name: xxx/orion
tag: test-1.0
dockerfile: Dockerfile
push: True
credentials: "{{ prefect.blocks.docker-registry-credentials.docker-hub }}"
pull:
- prefect.projects.steps.set_working_directory:
directory: /opt/prefect/flow
# base metadata
name: hello-world-deploy
version: null
tags: []
description: null
schedule: null
# flow-specific fields
#flow_name: check
entrypoint: flow.py:check
path: null
parameters: {}
parameter_openapi_schema: null
# infra-specific fields
work_pool:
name: wekeo-pool
work_queue_name: default
job_variables: {}
Chris White
04/17/2023, 7:36 PM--recipe
flag on prefect project init
which will guide you to a proper setup (in your case, prefect project init --recipe docker
is probably what you want). The reason this error is happening is because you haven't configured your image to get used anywhere; assuming you are using either a docker or kubernetes worker, you can add the following to deployment.yaml
and it should begin working:
# infra-specific fields
work_pool:
name: wekeo-pool
work_queue_name: default
job_variables:
image: "{{ image_name }}"
the image name variable comes from your build_docker_image
stepEmma Rizzi
04/18/2023, 6:29 AM