-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update python image version and reduce size for gallery docker image #4686
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
Conversation
Update python image to 3.13 Reduce size by adding `--no-install-recommands` and removing `/var/lib/apt/lists/*`
cooperlees
left a comment
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! All makes sense to me.
Will merge if CI is happy. Don't think we really test it here tho.
gallery/Dockerfile
Outdated
| @@ -1,11 +1,12 @@ | |||
| FROM python:3.8.2-slim | |||
| FROM python:3.13-slim | |||
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 can go either way here - I wonder if we want to just follow python:3-slim here if it exists? I guess ti depends how recent it's kept - I would hope latest stable major - i.e. 3.13 at the moment ...
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.
python:3-slim exists and it is kept up-to-date, but I haven't found an explicit statement on whether it follows the latest stable minor or major version.
I think in this case it might be worth it to use python:3-slim. It would have prevented the image from not working due to the type hinting. My guess is that it would prevent more issues than pinning a specific version would prevent(especially since this image does not appear to be used very often.)
|
O, let's add a change log for this please. |
Use python:3-slim instead of python:3.13-slim as base image for the gallery Dockerfile
Added a line to the Changes.md |
cooperlees
left a comment
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 - Will merge should CI pass.
|
CI passes (barring 3.12.4 Fuzz which is failing on main) |
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [black](https://github.com/psf/black) ([changelog](https://github.com/psf/black/blob/main/CHANGES.md)) | `<25.2.0,>=25.1.0` -> `<25.9.1,>=25.9.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>psf/black (black)</summary> ### [`v25.9.0`](https://github.com/psf/black/blob/HEAD/CHANGES.md#2590) [Compare Source](psf/black@25.1.0...25.9.0) ##### Highlights - Remove support for pre-python 3.7 `await/async` as soft keywords/variable names ([#​4676](psf/black#4676)) ##### Stable style - Fix crash while formatting a long `del` statement containing tuples ([#​4628](psf/black#4628)) - Fix crash while formatting expressions using the walrus operator in complex `with` statements ([#​4630](psf/black#4630)) - Handle `# fmt: skip` followed by a comment at the end of file ([#​4635](psf/black#4635)) - Fix crash when a tuple appears in the `as` clause of a `with` statement ([#​4634](psf/black#4634)) - Fix crash when tuple is used as a context manager inside a `with` statement ([#​4646](psf/black#4646)) - Fix crash when formatting a `\` followed by a `\r` followed by a comment ([#​4663](psf/black#4663)) - Fix crash on a `\\r\n` ([#​4673](psf/black#4673)) - Fix crash on `await ...` (where `...` is a literal `Ellipsis`) ([#​4676](psf/black#4676)) - Fix crash on parenthesized expression inside a type parameter bound ([#​4684](psf/black#4684)) - Fix crash when using line ranges excluding indented single line decorated items ([#​4670](psf/black#4670)) ##### Preview style - Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` would still be formatted ([#​4552](psf/black#4552)) - Improve `multiline_string_handling` with ternaries and dictionaries ([#​4657](psf/black#4657)) - Fix a bug where `string_processing` would not split f-strings directly after expressions ([#​4680](psf/black#4680)) - Wrap the `in` clause of comprehensions across lines if necessary ([#​4699](psf/black#4699)) - Remove parentheses around multiple exception types in `except` and `except*` without `as`. ([#​4720](psf/black#4720)) - Add `\r` style newlines to the potential newlines to normalize file newlines both from and to ([#​4710](psf/black#4710)) ##### Parser - Rewrite tokenizer to improve performance and compliance ([#​4536](psf/black#4536)) - Fix bug where certain unusual expressions (e.g., lambdas) were not accepted in type parameter bounds and defaults. ([#​4602](psf/black#4602)) ##### Performance - Avoid using an extra process when running with only one worker ([#​4734](psf/black#4734)) ##### Integrations - Fix the version check in the vim file to reject Python 3.8 ([#​4567](psf/black#4567)) - Enhance GitHub Action `psf/black` to read Black version from an additional section in pyproject.toml: `[project.dependency-groups]` ([#​4606](psf/black#4606)) - Build gallery docker image with python3-slim and reduce image size ([#​4686](psf/black#4686)) ##### Documentation - Add FAQ entry for windows emoji not displaying ([#​4714](psf/black#4714)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTYuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0MS4xMTYuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInR5cGUvZGVwZW5kZW5jaWVzIl19--> Reviewed-on: https://git.tainton.uk/repos/roboluke/pulls/376 Co-authored-by: Renovate [BOT] <[email protected]> Co-committed-by: Renovate [BOT] <[email protected]>
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [black](https://github.com/psf/black) ([changelog](https://github.com/psf/black/blob/main/CHANGES.md)) | `<25.2.0,>=25.1.0` -> `<25.9.1,>=25.9.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>psf/black (black)</summary> ### [`v25.9.0`](https://github.com/psf/black/blob/HEAD/CHANGES.md#2590) [Compare Source](psf/black@25.1.0...25.9.0) ##### Highlights - Remove support for pre-python 3.7 `await/async` as soft keywords/variable names ([#​4676](psf/black#4676)) ##### Stable style - Fix crash while formatting a long `del` statement containing tuples ([#​4628](psf/black#4628)) - Fix crash while formatting expressions using the walrus operator in complex `with` statements ([#​4630](psf/black#4630)) - Handle `# fmt: skip` followed by a comment at the end of file ([#​4635](psf/black#4635)) - Fix crash when a tuple appears in the `as` clause of a `with` statement ([#​4634](psf/black#4634)) - Fix crash when tuple is used as a context manager inside a `with` statement ([#​4646](psf/black#4646)) - Fix crash when formatting a `\` followed by a `\r` followed by a comment ([#​4663](psf/black#4663)) - Fix crash on a `\\r\n` ([#​4673](psf/black#4673)) - Fix crash on `await ...` (where `...` is a literal `Ellipsis`) ([#​4676](psf/black#4676)) - Fix crash on parenthesized expression inside a type parameter bound ([#​4684](psf/black#4684)) - Fix crash when using line ranges excluding indented single line decorated items ([#​4670](psf/black#4670)) ##### Preview style - Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` would still be formatted ([#​4552](psf/black#4552)) - Improve `multiline_string_handling` with ternaries and dictionaries ([#​4657](psf/black#4657)) - Fix a bug where `string_processing` would not split f-strings directly after expressions ([#​4680](psf/black#4680)) - Wrap the `in` clause of comprehensions across lines if necessary ([#​4699](psf/black#4699)) - Remove parentheses around multiple exception types in `except` and `except*` without `as`. ([#​4720](psf/black#4720)) - Add `\r` style newlines to the potential newlines to normalize file newlines both from and to ([#​4710](psf/black#4710)) ##### Parser - Rewrite tokenizer to improve performance and compliance ([#​4536](psf/black#4536)) - Fix bug where certain unusual expressions (e.g., lambdas) were not accepted in type parameter bounds and defaults. ([#​4602](psf/black#4602)) ##### Performance - Avoid using an extra process when running with only one worker ([#​4734](psf/black#4734)) ##### Integrations - Fix the version check in the vim file to reject Python 3.8 ([#​4567](psf/black#4567)) - Enhance GitHub Action `psf/black` to read Black version from an additional section in pyproject.toml: `[project.dependency-groups]` ([#​4606](psf/black#4606)) - Build gallery docker image with python3-slim and reduce image size ([#​4686](psf/black#4686)) ##### Documentation - Add FAQ entry for windows emoji not displaying ([#​4714](psf/black#4714)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTYuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0MS4xMTYuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInR5cGUvZGVwZW5kZW5jaWVzIl19--> Reviewed-on: https://git.tainton.uk/repos/epage/pulls/158 Co-authored-by: Renovate [BOT] <[email protected]> Co-committed-by: Renovate [BOT] <[email protected]>
Description
Update python image to 3.13:
Python version 3.8 is EOL and the gallery.py script depends on type hinting functionality introduced in version 3.9.
Reduce size by adding
--no-install-recommendsand removing/var/lib/apt/lists/*:This reduces the size of the resulting docker image by not installing of keeping unneeded files.
Checklist - did you ...
CHANGES.mdif necessary?I don't believe this change warrants an entry in
CHANGES.mdor an updated test or documentation and should get the magical label to silence the CHANGELOG entry check.