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

optimize size and time using "--no-cache-dir" #70

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

Rajpratik71
Copy link
Contributor

Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rajpratik71 - thank you for the contribution - this looks good. As you can see from my comments, you've stumbled upon some very out of date code and we should go ahead and take the opportunity to make the appropriate updates. Thank you.

all-spark-kernels/Dockerfile Outdated Show resolved Hide resolved
node_client_example/Dockerfile.kg Outdated Show resolved Hide resolved
python_client_example/Dockerfile.kg Outdated Show resolved Hide resolved
@@ -3,7 +3,7 @@
FROM jupyter/all-spark-notebook:dbb9c7b50531

# Install Kernel Gateway
RUN pip install git+https://github.com/jupyter-incubator/kernel_gateway.git
RUN pip install --no-cache-dir git+https://github.com/jupyter-incubator/kernel_gateway.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert to straight pip install like the others - incubator is no longer required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as requested

@@ -3,7 +3,7 @@
FROM jupyter/all-spark-notebook:dbb9c7b50531

# Install Kernel Gateway
RUN pip install git+https://github.com/jupyter-incubator/kernel_gateway.git
RUN pip install --no-cache-dir git+https://github.com/jupyter-incubator/kernel_gateway.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto previous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as requested

@Rajpratik71 Rajpratik71 force-pushed the optimization/pip-no-cache branch from c77f45e to f64ee88 Compare July 27, 2020 15:21
Some version restriction dropped and  further Using "--no-cache-dir"
flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6
@Rajpratik71 Rajpratik71 force-pushed the optimization/pip-no-cache branch from f64ee88 to f15a9a6 Compare July 27, 2020 15:24
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

@kevin-bates kevin-bates merged commit 13628ce into jupyter:master Jul 27, 2020
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

Successfully merging this pull request may close these issues.

2 participants