ci: Prepare Image Publishing for the Move to LibreChat-AI - #325
Merged
Merged
Conversation
3 tasks
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.
Summary
This prepares the repository for its move to the
LibreChat-AIorganization: image publishing keeps working under the new owner, and the images deployments pull today keep being updated.Both image workflows build tags from
github.repository_owner. That value is the owner's name as written, and registries reject uppercase letters in a name: an owner likeLibreChat-AIproducesghcr.io/LibreChat-AI/librechat-rag-api-dev, which is not a valid reference, and the push fails. The current owner is already lowercase, so this has never been exercised.The tags now come from a lowercased owner. Under the current owner the published names are byte-for-byte what they are today, so this is a no-op until the owner changes.
How it works
GitHub's expression syntax has no lowercase function, so a shell step does it once per job and the tag list reads it back:
Applied in
images.yaml(pushes:shaand:lateston main) anddocker-build-workflow.yaml(the reusable workflowrelease.yamlcalls on a tag).Mirroring the old namespace
After the move, images publish to
ghcr.io/librechat-ai/*while every deployment still pullslibrechat-rag-api-dev*from the old namespace, directly or throughregistry.librechat.ai, which passes the path to ghcr.io unchanged. Both workflows now copy each published tag to a second, configurable namespace, so those deployments keep updating and the new namespace becomes canonical without a flag day. Copies are GHCR cross-repo blob mounts: no image data is rebuilt or re-uploaded.release.yamlnow passessecrets: inherit, because a called workflow receives no secrets otherwise.It skips rather than fails when:
LEGACY_GHCR_OWNERis unset (the step doesn't run), the legacy owner equals the publishing owner (the case today, so nothing mirrors onto itself), or the secret is missing (warns, exits 0). A failed copy iscontinue-on-error, so a registry hiccup can't fail a publish.To turn it on after the move: add a token with
write:packagesfordanny-avilaasLEGACY_GHCR_TOKEN, and set theLEGACY_GHCR_OWNERvariable todanny-avila. Remove both when the deprecation window closes.This mirrors what LibreChat#16214 does for the main images.
Testing
actionlint1.7.7 reports no problem with the changed lines. It does flag three pre-existing ones, unchanged by this PR:docker/login-action@v2in both image workflows andactions/setup-python@v4inci.ymlare too old for current runners. Worth a separate bump.GITHUB_REPOSITORY_OWNER=LibreChat-AI, legacy ownerdanny-avila): it resolvesghcr.io/librechat-ai/librechat-rag-api-dev:{abc1234,latest}→ghcr.io/danny-avila/…, and with today's owner on both sides it exits early.ghcr.io/librechat-ai/librechat-rag-api-dev; with the current owner it gives today's name unchanged.main, tags and dispatch, so the next image build after merge is the first real exercise.