Repository navigation
Add pluggable optimizer adapter framework (WIP) - #23943
Open
czifrushanna wants to merge 8 commits into
Open
czifrushanna wants to merge 8 commits into
czifrushanna wants to merge 8 commits into
Conversation
…strations and dockerfile optimization storage Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
…ptimization UI Signed-off-by: Hanna Czifrus <czifrus.hanna@gmail.com>
This branch has not been deployed
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.
Work in progress - opening early for feedback on the shape of the framework,
not as a merge-ready change.
Adds an optimizer adapter framework modelled on the existing pluggable scanner
adapters: Harbor hands an artifact to an external service and gets back an
optimized Dockerfile, recovered from the image's BuildKit provenance and informed
by its Trivy scan report. Harbor takes on no LLM dependency - it only speaks the
adapter contract.
optimizer_registration+ versioned adapter REST contract, mirroringscanner_registration/pkg/scan/rest/v1(migrations 0191–0193)OPTIMIZE_ARTIFACTjob using a single-use pull-scoped robot account/optimizersregistration CRUD API + a Dockerfile tab on the artifact viewand an Optimizers tab under Interrogation Services
Why a separate framework, for now
pkg/optimizerdeliberately mirrors the scanner adapter framework rather thanextending it, and the optimizer lives in its own registration table and packages.
The overlap is real and I'm not hiding it - the registration DAO is three lines
from identical to the scanner's, and the manager is ~80% the same.
Keeping them separate keeps this PR purely additive: nothing on the scan path
changes, so an experimental feature can't destabilise a shipped one. Consolidating
into a shared
adapter/registrationpackage is already proposed in goharbor/community#285, and could be the next step after one question is decided: both registrations are beego ORMmodels with a fixed
TableName(), so a single shared struct can't back two tables -the manager, controller and REST transport generalise cleanly, the DAO layer needs a
pattern this codebase doesn't use yet.
The adapter service itself is external by design, for the same reason Trivy is:
Harbor stays free of any LLM or model dependency and only speaks the REST contract.
Trying it out
The reference adapter is sleeko, a standalone Go service:
https://github.com/czifrushanna/sleeko (README covers running it
against a Harbor built from this version). It is deliberately minimal for now - a
single LLM API call per artifact; I am working on optimizing the optimization workflow itself.
Still to do
Adapter contract
v1isn't frozen yet, there are no e2e tests (verification hasbeen manual against a live cluster), and docs aren't written.
Related to goharbor/community#285 and goharbor/community#282