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

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

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

Conversation

luzfcb
Copy link
Contributor

@luzfcb luzfcb commented Dec 26, 2024

  • Add the new --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
  • Add the new --exit-zero to Exit with 0 even if docker image size/layers exceed max_size and max-layers
  • Add the the __main__.py entrypoint to be able execute via module, that it python -m docker_image_size_limit
  • Use files argument instead of file argument in the codecov github action since it deprecate the file argument in favor of files
  • Increase version to 2.1.0

It Maybe introduce a breaking change since the _check_image function now return 3 values instead of 2

Copy link
Member

@sobolevn sobolevn left a 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 :)

README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
docker_image_size_limit/__init__.py Outdated Show resolved Hide resolved
@luzfcb luzfcb marked this pull request as ready for review December 26, 2024 22:53
@luzfcb luzfcb force-pushed the master branch 2 times, most recently from 3e8f93c to b76c142 Compare December 26, 2024 23:17
@luzfcb luzfcb changed the title WIP - Add the --current and --dry-run to optionally show current docker image size and avoid stop the CI even if exceed max_size and max-layers 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 Dec 26, 2024
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1d67f26) to head (3a32127).
Report is 42 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

and allow execute it as module via
python -m docker_image_size_limit
@luzfcb
Copy link
Contributor Author

luzfcb commented Dec 26, 2024

@sobolevn done. Docker is failing because it tries to install version 2.1.0, however it has not been released yet.

Copy link
Member

@sobolevn sobolevn left a 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
Copy link
Member

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}"
Copy link
Member

Choose a reason for hiding this comment

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

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.

Running without a size parameter should only display current size
2 participants