fix(agent): keep a single pip in the docker image (INT-497) - #517
Merged
Conversation
… pip over the base's (INT-497)
unlisted
requested review from
MicahParks,
davidlanouette,
grant-nbl,
jajeffries,
leoparente,
manrodrigues,
mfiedorowicz,
paulstuart and
samiura
as code owners
August 7, 2026 19:36
Contributor
There was a problem hiding this comment.
Pull request overview
Resolves a broken pip3 in the published netboxlabs/orb-agent:develop container image by ensuring only a single, consistent pip installation exists in the final runtime layer, avoiding cross-stage file merges that can mix pip module layouts.
Changes:
- Removes the pip version pin/upgrade from the
python-builderstage and uninstalls pip after installing the in-repo Python backends so pip cannot leak into the final image viaCOPY. - Installs a single pinned runtime pip (
pip==26.2.1) in the final stage (and removes the bundled ensurepip wheel) before copying application site-packages/console scripts from the builder.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Vulnerability Scan: Failed — blocking vulnerabilities detectedImage:
Commit: 2a31d13 |
leoparente
approved these changes
Aug 7, 2026
samiura
approved these changes
Aug 7, 2026
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.
Fixes INT-497.
Motivation
The published
netboxlabs/orb-agent:developimage ships a broken pip: everypip3invocation dies withImportError: cannot import name 'get_runnable_pip' from 'pip._internal.utils.misc'. This has all controller-integrations e2e jobs red since Aug 6/7 (the entrypoint'sINSTALL_DRIVERS_PATHinstall fails) and breaks orb-agent-pro image builds outright (they runpip3 installagainst this base at build time).Root cause: the python-builder stage upgrades pip to a pinned 26.1.2, and the site-packages COPY into the final stage merges that pip file-by-file over the base image's own pip. The
python:3.14-alpinebase recently moved its bundled pip to 26.2.1, which restructuredpip/_internal/build_envinto a package. The shipped image ends up with both dist-infos and a mix of both versions' modules, and imports across them fail. Nothing in this repo changed; an upstream base refresh flipped it, and it will keep flipping whenever the base's pip and the builder pin drift apart.Change
Keep exactly one pip in the image, owned by the stage that ships it:
pip==26.2.1), which cleanly removes the base's copy first, and takes over the ensurepip wheel removal.The builder no longer pins pip at all: its pip is throwaway tooling that never ships, so there is no version pair to keep in sync.
Testing
pip-26.1.2.dist-infoandpip-26.2.1.dist-infopresent,pip3 --versionthrows the ImportError above.pip-26.2.1.dist-info,pip3 --versionworks, ensurepip wheel gone,orb-workeranddevice-discoveryconsole scripts intact.pip3 installinside the built container succeeds (this is what the controller-integrations e2e entrypoint does).AGENT_TAG=pip-fix-local): build succeeds, all 11 nbl-* integration packages install from CodeArtifact, and the pro image inherits the single working pip.