Feature #17209
closedController forwards web requests to crunch worker nodes
Description
Controller checks authorization, looks up the addr:port of the relevant crunch-run process, and forwards the request there.
Details on #17207
Updated by Tom Clegg over 4 years ago
- Related to Idea #17207: services running in containers added
Updated by Tom Clegg almost 4 years ago
- Assigned To set to Tom Clegg
- Status changed from New to In Progress
This provides the basic functionality of forwarding external requests to https://{uuid}-{port}.zzzzz.example.com/foo through Nginx+controller to http://{container}:{port}/foo on the worker node:
17209-http-forward @ bb050a077ae014a8db2e58589f1b62dc6462afe2 -- developer-run-tests: #2469
- Upgrade notes (add wildcard to nginx conf)
- Documentation (as usual I could use some help with this)
- Config knob to enable/disable (currently follows "shell access" configs, right up to the error messages "shell access is disabled in config")
- Tests for "not permitted/configured" and "missing/invalid token" cases
- Tests for redirect-with-cookie behavior (and rename the query param from "arvados_api_token" to "api_token" to match other places where we do this)
Updated by Tom Clegg almost 4 years ago
- Estimated time set to 0.00 h
- Tracker changed from Feature to Task
Updated by Tom Clegg almost 4 years ago
- Related to Feature #17206: crunch-run reverse proxies HTTP requests to container added
Updated by Peter Amstutz about 2 months ago
- Release deleted (
60) - Target version changed from Future to Development 2025-02-26
- Assigned To deleted (
Tom Clegg) - Category set to API
Updated by Tom Clegg about 1 month ago
17209-http-forward @ 54f5f3b0868709dc9a45963bc8224fa0ff4813df -- developer-run-tests: #4673
Rebased/rewrote stale branch (container gateway things changed a lot in Feature #19889: access current container logs at /arvados/v1/containers/{uuid}/log/{filename})
Updated by Tom Clegg about 1 month ago
17209-http-forward @ a651cd2938c6592d4a60aa3c696ce681b0615d60 -- developer-run-tests: #4675
- test/fix "proxy to tunnel terminated at other controller process" case
- update permission check (currently it's just "is container readable?")
Updated by Tom Clegg about 1 month ago
17209-http-forward @ 74153a23bede1c925167ec74a0aa17a5adbe479e -- developer-run-tests: #4676
Updated by Brett Smith about 1 month ago
- Target version changed from Development 2025-02-26 to Development 2025-03-19
Updated by Tom Clegg about 1 month ago
17209-http-forward @ f5a7f839b82ec9c939c03e8924227018b651680d -- developer-run-tests: #4681
- All agreed upon points are implemented / addressed. Describe changes from pre-implementation design.
- Permission check is the same as for container SSH access, i.e., ports can be accessed by admins, and by the user who submitted all of the CRs that reference the container
- We didn't discuss a way to disable the feature via config, and I didn't add one. I figure this is OK (at least for now) since it is effectively disabled by default until someone configures upstream proxies, DNS, and TLS certificates, none of which is documented yet (#22613).
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described.
- ✅ automated tests only.
- New or changed UX/UX and has gotten feedback from stakeholders.
- n/a
- Documentation has been updated.
- no, we decided not to until #22613
- Behaves appropriately at the intended scale (describe intended scale).
- The permission checks (get user/container) aren't cached, so they could generate some real RailsAPI load if the container hosts (for example) a web app that makes lots of requests. Added a note to #22551 that we should have a cache to avoid doing a lookup on every request to a "public" port.
- Considered backwards and forwards compatibility issues between client and server.
- none
- Follows our coding standards and GUI style guidelines.
- ✅
Updated by Lucas Di Pentima about 1 month ago
- File
lib/crunchrun/container_gateway.go
: Leftover commented-out code at lines 366-370 - I'm guessing this feature will have a config knob like
Services.WebDAV.ExternalURL
, just not this first prototype? Being able to accept connections to a domain name like<uuid>-<port>--containers.zzzzz.example.com
will be necessary on some deployments.
Apart from that, LGTM.
Updated by Tom Clegg about 1 month ago
Lucas Di Pentima wrote in #note-15:
- File
lib/crunchrun/container_gateway.go
: Leftover commented-out code at lines 366-370
Oops, yes. Removed.
- I'm guessing this feature will have a config knob like
Services.WebDAV.ExternalURL
, just not this first prototype? Being able to accept connections to a domain name like<uuid>-<port>--containers.zzzzz.example.com
will be necessary on some deployments.
Yes. I didn't add it here because it seemed too close to advertising the half-implemented feature. Added a note to #22613 description.
Updated by Tom Clegg about 1 month ago
- ensure TLS certificates validate for
*.containers.domain.example
- update Nginx config so
*.containers.domain.example
routes to controller, e.g.,server { // ... server_name domain.example ~\.containers\.domain\.example;
- point browser to
https://{container-uuid}-{port}.containers.domain.example
Updated by Tom Clegg about 1 month ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|1bca6728bf4659e4b13146a6f041a0c188a0a8bc.