-
Notifications
You must be signed in to change notification settings - Fork 10
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
Docker dependencies cache #39
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Aniket Singh Rawat <[email protected]>
Signed-off-by: Aniket Singh Rawat <[email protected]>
@dikwickley I'm unable to run the container with Maybe you can look into something like |
@VallariAg What if copy |
Signed-off-by: Aniket Singh Rawat <[email protected]>
0e1e397
to
e80951e
Compare
@VallariAg I have made the suggested changes and it works now, the container starts up. Though I suggest we move to a conda-based env. Thoughts on this? |
I'm not sure if that would work (it didn't when I tested that) - you can explore more ways to install dependencies before copying other project content for a pyscaffold packaged python project if you want.
This project is structured using pyscaffold. They added instructions to use conda in https://github.com/ceph/teuthology-api/blob/main/CONTRIBUTING.md#create-an-environment I'm curious to know what prompted this? |
Those instructions are just for creating a blank environment, in which install all dependencies from
I also tried this, and this didn't work out. I compiled requirements.txt using |
@@ -18,9 +18,13 @@ RUN apt-get update && \ | |||
lsb-release && \ | |||
apt-get clean all | |||
|
|||
COPY setup.py . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just copy requirements.txt and install dependencies with that, I don't think copying setup.py is required
also copying requirements.txt to /teuthology_api would be better, maybe something like:
COPY .teuthology.yaml /root
WORKDIR /teuthology_api
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY . /teuthology_api/
RUN pip3 install -e .
@dikwickley I'm looking at ways to cache pip3 packages like suggested here https://docs.docker.com/build/cache/#use-the-dedicated-run-cache I think this might be a good direction to go from here. |
Moving the pip install command above copying /teuthology_api to take advantage of docker caching.
Fixes: #37
running locally:
@VallariAg can you please review.