Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefect fIle not found error using local externally built docker image #43

Open
cakir-enes opened this issue Apr 6, 2023 · 0 comments

Comments

@cakir-enes
Copy link

So agent and server is running locally, not inside the docker
I've updated client_docker/Dockerfile to this

FROM prefecthq/prefect:2-python3.11
RUN mkdir -p /usr/app
COPY ./app/ /usr/app
WORKDIR /usr/app

Then changed client_docker/app/weather.py to this

if __name__ == "__main__":
    flow_identifier = datetime.today().strftime("%Y%m%d%H%M%S-") + str(uuid.uuid4())

    docker_block = DockerContainer(
        image="plzwerk:2",
    )

    b = docker_block.save("plzdocki", overwrite=True)
    deployment = Deployment.build_from_flow(
        name="idk",
        flow=get_paris_weather,
        work_queue_name="ecs",
        path="/usr/app",
        apply=True,
        infrastructure=docker_block,  
    )

When agent picks up this flow it throws

 raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at '../prefect-docker-compose/client_docker/app/weather.py' encountered an exception: FileNotFoundError(2, 'No such file or directory')

Im calling weather.py to deploy the flow from somewhere else on host, why would prefect use host relative fs path to find the flow shouldnt it just use path argument and get_paris_weather (flow functions name) to get it? How to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant