Skip OCI Object Storage download for Ready same-path artifacts#629
Open
op109lvb wants to merge 1 commit into
Open
Skip OCI Object Storage download for Ready same-path artifacts#629op109lvb wants to merge 1 commit into
op109lvb wants to merge 1 commit into
Conversation
truddy0
reviewed
Jun 15, 2026
| } | ||
|
|
||
| func sameModelStoragePath(currentStorage *v1beta1.StorageSpec, candidateStorage *v1beta1.StorageSpec, modelRootDir string, destPath string) bool { | ||
| if currentStorage == nil || candidateStorage == nil || currentStorage.Path == nil || candidateStorage.Path == nil { |
Collaborator
There was a problem hiding this comment.
do we need to handle the case where the getDestPath is empty?
truddy0
reviewed
Jun 15, 2026
| baseModels, err := s.baseModelLister.List(labels.Everything()) | ||
| if err == nil { | ||
| for _, model := range baseModels { | ||
| key := constants.GetModelConfigMapKey(model.Namespace, model.Name, false) |
Collaborator
There was a problem hiding this comment.
nit: maybe we can extract reusable part between cluster basemodel and basemodel.
truddy0
reviewed
Jun 15, 2026
| return getDestPath(&candidateSpec, modelRootDir) == destPath | ||
| } | ||
|
|
||
| func sameStringPtr(left *string, right *string) bool { |
Collaborator
There was a problem hiding this comment.
these 2 funcs:sameStringPtr, sameStringMapPtr should be moved to utils.go file as they are pure string validation methods
truddy0
reviewed
Jun 15, 2026
| return ociOSDS, nil | ||
| } | ||
|
|
||
| func (s *Gopher) findReadyObjectStorageModelWithSamePath(ctx context.Context, task *GopherTask, baseModelSpec v1beta1.BaseModelSpec, destPath string) (string, bool) { |
Collaborator
There was a problem hiding this comment.
let's add a comment for this func
Collaborator
|
we have this before f8d263f |
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.
What this PR does
Speeds up copied model reconciliation when the copied CR uses OCI Object Storage and points to the same storage path as a model artifact that is already Ready on the same node.
For same-path object storage reuse, model-agent skips the expensive download/integrity-validation path instead of re-running file validation.
The implementation looks at this node’s Ready model entries and reuses only when the storage URI, path, schema path, storage key, parameters, and resolved destination path match exactly, and the local destination path already exists.
Why we need it
Copied model CRs can point to the same object storage path as an already Ready model on the same node. In that case, re-downloading or re-validating all files adds unnecessary reconciliation latency.
This speeds up copied model CR reconciliation while preserving safety:
How to test
Checklist
make testpasses locally