-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add the --current-size and --exit-zero to optionally show current docker image size and avoid stop the CI even if exceed max_size and max-layers #319
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you! I proposed several better names :)
3e8f93c
to
b76c142
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #319 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 3 +1
Lines 33 58 +25
Branches 1 5 +4
=========================================
+ Hits 33 58 +25 ☔ View full report in Codecov by Sentry. |
and allow execute it as module via python -m docker_image_size_limit
@sobolevn done. Docker is failing because it tries to install version 2.1.0, however it has not been released yet. |
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.
Thanks!
your-image-name:label size is 414.4 MiB | ||
your-image-name:label exceeds 300MiB limit by 114.4 MiB | ||
|
||
$ disl your-image-name:label 300MiB --max-layers=5 --current-size |
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.
I would say that the first example is redundant
@@ -2,18 +2,33 @@ | |||
|
|||
# Default values: | |||
: "${INPUT_MAX_LAYERS:=-1}" | |||
: "${INPUT_SHOW_CURRENT_SIZE:=false}" |
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.
This needs two steps to be properly initialized: see https://github.com/wemake-services/wemake-python-styleguide/blob/fa815ebfb3fd1457712812597de4c1320f83e1b9/scripts/entrypoint.sh#L3-L16
--current-size
to display the current size of the docker image. Maybe partially fix Running without a size parameter should only display current size #224--exit-zero
to Exit with 0 even if docker image size/layers exceedmax_size
andmax-layers
__main__.py
entrypoint to be able execute via module, that itpython -m docker_image_size_limit
files
argument instead offile
argument in thecodecov
github action since it deprecate thefile
argument in favor offiles
2.1.0
It Maybe introduce a breaking change since the
_check_image
function now return 3 values instead of 2