Open discdiver opened 1 year ago
sorry @madkinsz didn't see you changed the title - feel free to change as you see fit
Hi, @discdiver I would like to work on this issue. The package installer in Dockerfile runs in the image on line #80. It would be very helpful if you could point out the position I should place it in for better caching.
Thank you @zmwaris1 ! I'll let @madkinsz weigh in on the position.
The changes here refer to the prefect-docker
implementation at https://github.com/PrefectHQ/prefect-docker/blob/41810b1773b8f4cad958df11eb438e34a7d91719/prefect_docker/projects/steps.py#L101-L109
We'd likely want to copy / install the requirements before copying the rest of the files similar to https://github.com/PrefectHQ/prefect/blob/0f2e5bf63ef89b452e40381aada4be683d0a79ab/Dockerfile#L109
Hii, i'm new on prefect community. Can i work on this issue?
Sure @raffifu ! Sounds great!
Hii, i can't reproduce this issue due to error while setup the dev environment. I got an error AttributeError: module 'docker' has no attribute 'DockerClient'
when trying to run sample flows on prefect-docker
:
prefect
and prefect-docker
python3 -m venv .venv && source .venv/bin/activate
prefect
and prefect-docker
in development mode with
$ cd prefect && pip install -e ".[dev]"
$ cd prefect-docker && pip install -e ".[dev]"
prefect server start
prefect block register -m prefect_docker
to install docker as block in prefectdownloaded_file.py
Got an error AttributeError: module 'docker' has no attribute 'DockerClient'
I've try several way to fix this issue:
Can you give me a tips to solve this problem? Thank you
First check
Prefect Version
2.x
Describe the current behavior
Currently, the image built in a Prefect Project step installs the packages in requirements.txt last. This leads to having to reinstall the packages - not taking full advantage of caching.
Describe the proposed behavior
Move the package install higher in the Dockerfile to take advantage of caching and save time for developers.
Example Use
No response
Additional context
An attendee at PACC SF raised this issue.