Alexis
12/14/2023, 12:23 PM[
{
"prefect.deployments.steps.set_working_directory": {
"directory": "/opt/prefect/..."
}
}
]
However using the two previous mentioned methods, it does not work
Could someone shed a light on this pllease ?Emil Christensen
12/14/2023, 1:05 PMflow.deploy
with a custom Docker image, is that what you are looking for?Alexis
12/14/2023, 1:10 PMEmil Christensen
12/14/2023, 1:12 PMAlexis
12/14/2023, 1:13 PMRUN pip install --upgrade pip
RUN pip install poetry
WORKDIR /code
COPY pyproject.toml /code/
RUN apt-get update \
&& apt-get install -y libpq-dev gcc \
&& apt-get update && apt-get install ffmpeg libsm6 libxext6 -y \
&& apt-get install libglib2.0-0 -y
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction \
&& rm -rf /root/.cache/pypoetry
RUN mkdir /opt/prefect/highres-cd-processing
COPY . /opt/prefect/highres-cd-processing
Alexis
12/14/2023, 1:14 PMprefect init
set it to opt/prefect/flowEmil Christensen
12/14/2023, 1:21 PMRUN mkdir /opt/prefect/highres-cd-processing
COPY . /opt/prefect/highres-cd-processing
In other words, as Prefect builds the image, it should inject the code itself. Try removing those lines and maybe also the WORKDIR /code
and see what happens.Alexis
12/14/2023, 1:22 PMAlexis
12/14/2023, 2:04 PMOpening process...
03:02:37 PM
prefect.flow_runs.runner
Downloading flow code from storage at '.'
Alexis
12/14/2023, 2:18 PMalex
12/14/2023, 2:40 PM/opt/prefect/highres-cd-processing
. Prefect will attempt to load your flow code relative to the current working directory when using a custom Dockerfile with flow.deploy
.Alexis
12/14/2023, 3:07 PMalex
12/15/2023, 3:15 PMhighres-cd-processing
processing folder.Alexis
12/15/2023, 3:17 PMrun_images.py:run_highres_analysis
And the run_images.py is at the root of the docker normally (like a main.py)alex
12/15/2023, 3:29 PMpull_steps
look like this?
[
{
"prefect.deployments.steps.set_working_directory": {
"directory": "/opt/prefect/highres-cd-processing"
}
}
]
Alexis
12/15/2023, 3:39 PMAlexis
12/15/2023, 3:40 PMalex
12/15/2023, 4:47 PM/opt/prefect/highres-cd-processing
in your Docker file. What type of infrastructure are you running your flows on?Alexis
12/15/2023, 6:28 PMalex
12/15/2023, 6:32 PMAlexis
12/15/2023, 6:32 PMalex
12/15/2023, 6:34 PMAlexis
12/15/2023, 6:43 PM