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

chore : use --no-cache-dir flag to pip in dockerfiles to save space #659

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rajpratik71
Copy link

What this PR does / why we need it:

using --no-cache-dir flag in pip install ,make sure downloaded packages
by pip don't cached on system . This is a best practice which make sure
to fetch from repo instead of using local cached one . Further , in case
of Docker Containers , by restricting 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

Signed-off-by: Pratik Raj [email protected]

Checklist

  • Does this PR have a corresponding GitHub issue?
  • Have you included relevant README for the chaoslib/experiment with details?
  • Have you added debug messages where necessary?
  • Have you added task comments where necessary?
  • Have you tested the changes for possible failure conditions?
  • Have you provided the positive & negative test logs for the e2ebook execution?
  • Does the e2ebook ensure idempotency of cluster state?, i.e., is cluster restored to original state?
  • Have you used non-shell/command modules for Kubernetes tasks?
  • Have you (jinja) templatized custom scripts that is run by the e2ebook, if any?
  • Have you (jinja) templatized Kubernetes deployment manifests used by the e2ebook, if any?
  • Have you reused/created util functions instead of repeating tasks in the e2ebook?
  • Do the artifacts follow the appropriate directory structure?
  • Have you isolated storage (eg: OpenEBS) specific implementations, checks?
  • Have you isolated platform (eg: baremetal kubeadm/openshift/aws/gcloud) specific implementations, checks?
  • Are the ansible facts well defined? Is the scope explicitly set for playbook & included utils?
  • Have you ensured minimum/careful usage of shell utilities (awk, grep, sed, cut, xargs etc.,)?
  • Can the limtusbook be executed both from within & outside a container (configurable paths, no hardcode)?
  • Can you suggest the minimal resource requirements for the e2ebook execution?
  • Does the e2ebook job artifact carry comments/default options/range for the ENV tunables?
  • Has the e2ebooks been linted?

Special notes for your reviewer:

using --no-cache-dir flag in pip install ,make sure downloaded packages
by pip don't cached on system . This is a best practice which make sure
to fetch from repo instead of using local cached one . Further , in case
of Docker Containers , by restricting 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

Signed-off-by: Pratik Raj <[email protected]>
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.

1 participant