Jon
11/02/2023, 3:24 PMflow.deploy
wants to build a net new image each time i run it. docs here
2. when i run a deployment, what command is getting called? i'm getting this error, which to me indicates that the command is not pointing to the flow's file:
docker.errors.APIError: 500 Server Error for <http+docker://localhost/v1.43/containers/44bd63ec74d08ad90a13770b140a149b3f7163491dcca3401242457cae2c7db4/start>: Internal Server Error ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "prefect": cannot run executable found relative to current directory: unknown")
alex
11/02/2023, 3:30 PMprefect flow-run execute
. Do you have prefect
installed in your image?Jon
11/02/2023, 3:32 PMJon
11/02/2023, 3:32 PMalex
11/02/2023, 3:34 PMimage
in the job_variables
for a deployment and not including a build_docker_image
step.Jon
11/02/2023, 3:35 PM.
|- .venv
|- namespace/project/flow.py
alex
11/02/2023, 3:36 PMprefect
installed in a venv in your image?Jon
11/02/2023, 3:36 PMJon
11/02/2023, 3:37 PMdocker run --rm -it --entrypoint bash _my-image_
Jon
11/02/2023, 3:37 PMJon
11/02/2023, 3:38 PMprefect
, i get the CLI optionsJon
11/02/2023, 3:38 PMJon
11/02/2023, 3:38 PMJon
11/02/2023, 3:39 PMalex
11/02/2023, 3:40 PMdocker run --rm my-image prefect --help
?Jon
11/02/2023, 3:40 PMdocker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "prefect": cannot run executable found relative to current directory: unknown.
alex
11/02/2023, 3:41 PMJon
11/02/2023, 3:42 PMJon
11/02/2023, 3:43 PMalex
11/02/2023, 3:43 PMbash
. You could try docker run --rm --entrypoint bash my-image prefect --help
Jon
11/02/2023, 3:43 PMJon
11/02/2023, 3:44 PMโ data-capture git:(main) docker run --rm --entrypoint bash dc-pipelines prefect --help
./.venv/bin/prefect: line 3: import: command not found
./.venv/bin/prefect: line 4: import: command not found
./.venv/bin/prefect: line 5: from: command not found
./.venv/bin/prefect: prefect: line 7: syntax error near unexpected token `('
./.venv/bin/prefect: prefect: line 7: ` sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])'
alex
11/02/2023, 3:46 PMJon
11/02/2023, 3:48 PMJon
11/02/2023, 3:52 PMFROM python:3.11-slim AS runtime
WORKDIR /app
ARG PROJECT_NAME
ARG PROJECT_PATH
ENV PATH ./.venv/bin:$PATH
COPY --from=build-envconsul /usr/local/bin/envconsul /usr/local/bin/envconsul
COPY --from=build-project /app/projects/${PROJECT_NAME}/.venv/ ./.venv/
COPY ./data-capture/projects/${PROJECT_NAME}/dc/ ./dc/
Jon
11/02/2023, 3:52 PMFROM prefecthq/prefect:2-python3.11 AS runtime
WORKDIR /app
ARG PROJECT_NAME
ARG PROJECT_PATH
ENV PATH ./.venv/bin:$PATH
COPY --from=build-envconsul /usr/local/bin/envconsul /usr/local/bin/envconsul
COPY --from=build-project /app/projects/${PROJECT_NAME}/.venv/ ./.venv/
COPY ./data-capture/projects/${PROJECT_NAME}/dc/ ./dc/
Jon
11/02/2023, 3:52 PMJon
11/02/2023, 3:52 PMโ data-capture git:(main) โ docker run --rm --entrypoint bash dc-pipelines prefect --help
./.venv/bin/prefect: line 3: import: command not found
./.venv/bin/prefect: line 4: import: command not found
./.venv/bin/prefect: line 5: from: command not found
./.venv/bin/prefect: prefect: line 7: syntax error near unexpected token `('
./.venv/bin/prefect: prefect: line 7: ` sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])'
alex
11/02/2023, 3:53 PMbash
entrypoint? I think we need to find the right incantation to make sure the path update is respected.Jon
11/02/2023, 3:55 PMalex
11/02/2023, 3:56 PMdocker run --rm my-image prefect --help
when using the prefect base image.Jon
11/02/2023, 3:58 PMdocker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "prefect": cannot run executable found relative to current directory: unknown.
alex
11/02/2023, 4:06 PMprefect
executable in the container. Can you try setting using an absolute path when setting PATH
? Like this ENV PATH /app/.venv/bin:$PATH
Jon
11/02/2023, 4:09 PMJon
11/02/2023, 4:09 PMJon
11/02/2023, 4:10 PMJon
11/02/2023, 4:11 PMJon
11/02/2023, 4:15 PMalex
11/02/2023, 4:16 PM