Repository navigation
Merged
Conversation
…l token; release 0.19.0 `ow broker` is a small HTTP service that accepts a worker's own token as the Hugging Face token, checks it with the database, reads the organization's real HF_TOKEN from the secret store and forwards the request to the Hub. File bytes do not pass through it. With OW_BROKER_URL set, the cluster manager gives workers HF_ENDPOINT and a stand-in token instead of the real one, for organizations whose token is in the secret store. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Third of four steps towards a worker environment without any organization credential (
TODO.md). Details indocs/release-0.19.0.md. The design follows the credential broker in r-docs.What changes
A worker's environment held the organization's real
HF_TOKEN, readable by the code of any job. With a broker deployed, the worker gets instead:ow broker(openweights/broker) receives every Hub request of the worker and:HF_TOKENfrom the secret store (cached 5 min, re-read after the Hub answers 401);Secret flow
HF_TOKENhf_+ worker token: works only through the broker, dies with the workerThe broker holds no database credential and no RunPod key; it needs read access to the organization secrets in the store. It never follows a redirect itself and rewrites only URLs that lead back to the Hub (Location, Link, LFS batch hrefs,
x-xet-refresh-route).When a worker is brokered
Only if the manager has
OW_BROKER_URL, the organization'sHF_TOKENis in the secret store, and the worker has its own token. Otherwise nothing changes, so merging and releasing this is inert untilOW_BROKER_URLis set, and self-managed clusters are unaffected.What breaks once it is switched on
https://huggingface.codirectly in places; those calls carry the stand-in and fail with 401.https://huggingface.cofor an authenticated call, andgit clone https://huggingface.co/...with the token.What a release requires
Publish 0.19.0 and upgrade the manager (no effect yet); deploy the broker and test it from a job with the job's own worker token; then set
OW_BROKER_URLon the manager. No migration, no worker image change.Tests
tests/test_broker.py(21 tests): the proxy against a stand-in for the Hub, the token check against a stand-in for the database, and the manager's choice. Full suite: 267 passed.ow brokerstarted locally:/healthzanswers, a request without a token and one with an invalid worker token (checked against the real database) get 401.Not verified: the broker against the real Hub with real client libraries (
hf_xet/hf_transferdownloads, uploads, gated models). That needs a deployed broker and is the second step of the release.🤖 Generated with Claude Code