Repository navigation
Gateway: on RunPod, job and output links use the pod's public URL - #26
Conversation
RunPod's proxy sends the machine's own address as Host (100.65.x.x:600xx),
so a studio or CLI outside the pod got output links it could not open
("fetch failed"). pod.py now gives the gateway its public URL in
FREEFIELD_PUBLIC_URL, and the gateway uses it for requests from outside.
The studio in the pod keeps 127.0.0.1.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@neuregex This is a small fix for your consideration. |
|
Thanks, @ksylvan! Clear write-up and a tight fix. One note for the record: on Vast.ai, |
Good point, and thanks for merging. I'm using freefield in my workflows now instead of Higgsfield. |
Problem
On a RunPod pod, a studio or
npm run appoutside the pod cannot get its results. The job runs and succeeds on the GPU, but the CLI stops withfetch failed.RunPod's HTTP proxy sends the machine's own address as
Host(for example100.65.35.32:60021), not<pod>-8000.proxy.runpod.net.external_base()builds the job and output links from thatHost, so the client gets links to a private address that it cannot open. The studio in the pod is not affected because it talks to the gateway on127.0.0.1.Seen on 28 Nov on an L40S pod from template
p7g587ry3j:create-imagesucceeded, and its outputurlwashttps://100.65.35.32:60021/api/v2/assets/....Change
infra/gateway.py: a new setting,FREEFIELD_PUBLIC_URL. When it is set and the request comes from a public host, links use that address. Requests from local and private addresses keep the address they used.infra/pod.py: on RunPod, setsFREEFIELD_PUBLIC_URLto the gateway URL thatwhere()already computes (https://<pod>-8000.proxy.runpod.net). A value set in the environment wins. On Vast.ai and on your own machine,where()gives no public gateway URL here, so nothing changes.test/gateway_test.py: two new checks. A request withHost: 100.65.35.32:60021gets the public URL, and a request on127.0.0.1keeps its own address.Test
python test/gateway_test.pyprintsgateway relink ok. I did not test this on a pod, because the pod runs the published image.🤖 Generated with Claude Code