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

Merged
merged 2 commits into from
Jan 11, 2025

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 (792b6ee).
Report is 45 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.

@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!

README.md Outdated Show resolved Hide resolved
scripts/entrypoint.sh Show resolved Hide resolved
@luzfcb luzfcb force-pushed the master branch 2 times, most recently from d29654f to 6bd3c19 Compare January 11, 2025 14:28
Dockerfile Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sobolevn The message at the beginning of this Dockerfile is not true, because the latest version of disl on docker hub is 3 years old.

Copy link
Member

Choose a reason for hiding this comment

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

We can ignore this check for now

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.

Please, remove poetry check for now and add 3.13 as the test target.

@luzfcb
Copy link
Contributor Author

luzfcb commented Jan 11, 2025

Done in 806ab04

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! Small nitpicks and it will be ready to be merged!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
scripts/entrypoint.sh Outdated Show resolved Hide resolved
and allow execute it as module via
python -m docker_image_size_limit
@luzfcb
Copy link
Contributor Author

luzfcb commented Jan 11, 2025

Done.

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!

@sobolevn sobolevn merged commit b377924 into wemake-services:master Jan 11, 2025
7 of 8 checks passed
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