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
MBS-13358 (II), MBS-13546: Upgrade Perl version to 5.38 #3239
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This method will work even if installing a more recent Perl from source.
This method will work even if installing a more recent Perl from source.
Our (MetaBrainz) base image is based on Phusion base image which in turn is based on Ubuntu Jammy that comes with Perl 5.34.0 (using apt). To upgrade Perl with the same base image, we have to install from source.
Previously rhe cpanm cache for root user was cleaned up only when building the tests image. This patch cleans it up for other images too.
Split installing Perl and other MusicBrainz Server’s back-end runtime prerequisites from installing MBS’ Perl module dependencies. It avoids rebuilding Perl and prerequisites when cpanfile (or snapshot) changes.
Previously those were installed in one RUN for all images but tests.
Previously, it was set this way for all images but test-database/tests.
Previously, an additional image layer was created because of COPY, and files weren’t always removed afterwards. Reference: https://docs.docker.com/develop/develop-images/instructions/#add-or-copy
Previously, it was set this way for all Docker images but test-database.
When possible, use --chmod/--chown options to COPY instead of RUN chmod/chown instructions. It creates one image layer less each time. Note: chmod isn’t needed when the host is Linux and the file permissions are set in the Git repository and preserved in the Git working copy. Reference: https://docs.docker.com/reference/dockerfile/#copy---chown---chmod
Use RUN --mount=type=bind to create one image layer less. Reference: https://docs.docker.com/develop/develop-images/instructions/#add-or-copy
It follows Unicode CLDR 44.1.0 which brings no change to locales.json
Use a faster and safer drop-in replacement. This is even encouraged by the author of Email::Address. It is already used in Email::MIME (1.943+) and Email::Sender (2.600+). The changes in tests are expected when you compare both module dependencies. References: * https://metacpan.org/release/RJBS/Email-Address-1.900/view/lib/Email/Address.pm * https://metacpan.org/release/PALI/Email-Address-XS-1.05/view/lib/Email/Address/XS.pm
./docker/generate_cpanfile_snapshot.sh ./docker/generate_cpanfile_snapshot.sh docker/musicbrainz-test-database/cpanfile All of these updates are minor and expected to be impactless.
yvanzo
changed the title
MBS-13358 (II): Upgrade Perl version to 5.38
MBS-13358 (II), MBS-13546: Upgrade Perl version to 5.38
Apr 16, 2024
mwiencek
approved these changes
Apr 16, 2024
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.
Looks great, the commits were well documented and it's reassuring to see that all of the tests pass. Like #3211 this contains many useful improvements to the Dockerfiles. Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MBS-13358 (II)
This patch upgrades Perl version to 5.38.2 for the MusicBrainz Server for production, CI tests, and test database.
See commit messages for the details of the implementation which is adapted from the official docker-perl.
It comes after metabrainz/musicbrainz-docker#273 (I) that was for the development setup only.
Additional changes
DateTime::Locale
version to 1.41 (with no change on our list of locales)Email::Address
withEmail::Address::XS
(and update email-related dependencies)v-2024-04.perl5.38
(built and pushed)Note
I tried to update all Perl module dependencies but some conflicts showed up, moreover I noticed that some updates may require additional code change/review, so I gave it up for now and only made a few updates instead. We may update some more Perl module dependencies by the schema change release, as upgrading the required version of Perl is the best opportunity to also upgrade the required versions of our Perl module dependencies.
Testing
Documenting
Markdown files are updated in this PR. (There is no other source of documentation to be updated.)
Further action
The last step (III) will be to upgrade Perl for mirrors as well, and I intend to prebuild those images from this repository.