Skip to content

Should we support retag operations? #276

@bcfre

Description

@bcfre

Description

The current implementation assumes that if a pending manifest file exists in the image repository, the upload has already been completed.
However, this assumption introduces two potential issues:

1. Inability to rename model artifacts efficiently
Users cannot rename model artifacts using the build --output-remote command.
The only available workflow is: delete the existing artifact → rebuild → upload → rename.
This adds an unnecessary re-upload step.

2. Silent failure when tags differ
If an existing manifest references tag-a and the user builds with tag-b,
the logic will neither retag the artifact nor throw an error.
As a result, the build step appears to succeed, but pulling using tag-b will fail because the tag does not actually exist in the repository.

Additional Context

Since reproducible builds are not currently supported[#243 ], this issue is likely to occur only in scenarios with high concurrency.

It's possible I might be missing some background context here, so please let me know if my understanding is incorrect.

https://github.com/modelpack/modctl/blob/main/pkg/backend/build/remote.go#L127-L137

        exist, err := ro.remote.Manifests().Exists(ctx, desc)
	if err != nil {
		hooks.OnError(digest, err)
		return ocispec.Descriptor{}, fmt.Errorf("failed to check if blob exists: %w", err)
	}
	if exist {
		hooks.OnComplete(digest, desc)
		return desc, nil
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions