feat(images): add apt_sources_mirror() chainable method for Debian builds - #5668
Open
Goutham-Annem wants to merge 1 commit into
Open
feat(images): add apt_sources_mirror() chainable method for Debian builds#5668Goutham-Annem wants to merge 1 commit into
Goutham-Annem wants to merge 1 commit into
Conversation
…ilds Add a new chainable method `apt_sources_mirror(url)` to the `Image` class that inserts a `sed` command before `apt-get update` to swap the default Debian mirror URL (http://deb.debian.org/debian) with a user-supplied URL. The command handles both Debian 12+ (debian.sources format) and older Debian releases (sources.list format) via a fallback OR expression. Closes bentoml#5374
Author
|
Hi — the Veracode SCA and Static Analysis failures appear to be pre-existing and unrelated to this PR's changes (they fire on all recent PRs). Could a maintainer confirm whether these are expected to pass before merge, or if they can be waived? Happy to address any actual code feedback! |
This file contains hidden or 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
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.
Summary
Adds a new chainable
apt_sources_mirror(url: str)method to theImagebuilder class (closes #5374)..apt_sources_mirror("https://...")on their image to swap the defaulthttp://deb.debian.org/debianURL before anyapt-getinvocation.sedcommand that tries the Debian 12+debian.sourcesfile first, then falls back to the legacysources.list, so it works across Debian releases without any extra configuration.tests/unit/_bentoml_sdk/test_images.pyto verify the generated command and that the method returnsselffor chaining.Usage example:
Test plan
pytest tests/unit/_bentoml_sdk/test_images.py— all three tests pass (existing + two new ones).sedline beforeapt-get install.