feat(gallery): publish signed OCI fallbacks - #12182
Open
localai-org-maint-bot wants to merge 1 commit into
Open
localai-org-maint-bot wants to merge 1 commit into
localai-org-maint-bot wants to merge 1 commit into
Conversation
Publish both official gallery indexes with their local base configs so an outage of the HTTP and GitHub sources can fall back to Quay. Keep artifact signing policies separate from backend image policies, and expose each moving gallery tag only after its digest is signed. Assisted-by: Codex:gpt-6
| if source != "gallery" && source != "backend" { | ||
| return fmt.Errorf("unsupported gallery directory %q", source) | ||
| } | ||
| body, err := os.ReadFile(filepath.Join(root, source, "index.yaml")) |
| if source != "gallery" && source != "backend" { | ||
| return fmt.Errorf("unsupported gallery directory %q", source) | ||
| } | ||
| body, err := os.ReadFile(filepath.Join(root, source, "index.yaml")) |
| if err := yaml.Unmarshal(body, &doc); err != nil { | ||
| return err | ||
| } | ||
| if err := os.MkdirAll(output, 0755); err != nil { |
| if err := yaml.Unmarshal(body, &doc); err != nil { | ||
| return err | ||
| } | ||
| if err := os.MkdirAll(output, 0755); err != nil { |
| if !filepath.IsLocal(path) { | ||
| return fmt.Errorf("base config escapes repository: %q", path) | ||
| } | ||
| config, err := os.ReadFile(filepath.Join(root, path)) |
| return err | ||
| } | ||
| dest := filepath.Join(output, path) | ||
| if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil { |
| if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil { | ||
| return err | ||
| } | ||
| if err := os.WriteFile(dest, config, 0644); err != nil { |
| if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil { | ||
| return err | ||
| } | ||
| if err := os.WriteFile(dest, config, 0644); err != nil { |
| if err != nil { | ||
| return err | ||
| } | ||
| return os.WriteFile(filepath.Join(output, "index.yaml"), body, 0644) |
| if err != nil { | ||
| return err | ||
| } | ||
| return os.WriteFile(filepath.Join(output, "index.yaml"), body, 0644) |
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.
Description
Publish signed OCI copies of the official model and backend galleries. LocalAI tries these copies after the index server and GitHub fail. The model artifact includes repository-local base configurations, so those files remain available during a GitHub outage.
Follow-up to #12167, requested by @mudler in #12167 (comment).
Notes for Reviewers
The new workflow publishes to
quay.io/go-skynet/local-ai-backendsusing the existing registry credentials. It signs each digest before updating thegallery-modelsorgallery-backendstag. The separateartifact_verificationpolicy preserves backend image verification behavior. Existing custom gallery lists remain unchanged.Validation:
go test ./core/config ./core/gallery ./scripts/build/gallery -count=1go vet ./core/config ./core/gallery ./scripts/build/gallerygit diff --checkpasses.Registry publication was not exercised locally: ORAS and cosign are unavailable. Full lint could not run because this environment lacks make and a runnable golangci-lint. No existing CI runs were inspected or restarted.
Signed commits