feat: select open port on firecrest remote sessions - #1208
Open
SalimKayal wants to merge 5 commits into
Open
Conversation
SalimKayal
force-pushed
the
salimkayal/feat/select-open-port-on-firecrest-remote-sessions
branch
from
August 10, 2026 14:22
7d2286c to
d8c10bb
Compare
SalimKayal
force-pushed
the
salimkayal/feat/select-open-port-on-firecrest-remote-sessions
branch
from
August 10, 2026 14:35
d8c10bb to
5e03c3a
Compare
leafty
approved these changes
Aug 12, 2026
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
Remote FirecREST sessions on Slurm now pick free local TCP ports for the session, git proxy, and git-proxy health endpoints instead of hardcoded defaults, while keeping the standard ports the Amalthea controller connects to. This prevents collisions between co-located sessions that share the host network namespace.
Motivation and context
Enroot on the cluster shares the host network namespace, so multiple sessions scheduled on the same node collide on the previously fixed ports (
RENKU_SESSION_PORT=8888,GIT_PROXY_PORT=65480,GIT_PROXY_HEALTH_PORT=65481). One session's wstunnel/git-proxy listener would fail to bind or clash with another's, breaking session startup and git operations on multi-tenant nodes.Behavior
find_free_porthelper probes the 20000–31999 range by briefly binding withnc, skippingports already chosen for this session, and errors out (with a stderr diagnostic) if none is free.
RENKU_SESSION_PORT(free) /RENKU_SESSION_REMOTE_PORT(8888)GIT_PROXY_PORT(free) /GIT_PROXY_REMOTE_PORT(65480)GIT_PROXY_HEALTH_PORT(free) /GIT_PROXY_HEALTH_REMOTE_PORT(65481)the node-local binds move to the free ports (
-Rexposes the standard remote port forwarding tothe free local session port;
-Lbinds the free local port forwarding to the standard remotegit-proxy ports).
65480) is overridden per repo withhttp.proxy http://localhost:${GIT_PROXY_PORT}andhttp.sslVerify falsebeforegit fetch, sofetches route through this session's local proxy listener.
Changes
internal/remote/firecrest/session_script.shfind_free_portfunction.and exported them.
clientinvocation (and its debug echo) to use the new variables.http.proxyandhttp.sslVerifyper repo beforegit fetch.Notes
ncandtimeoutare present in the remote session image (already adependency of this script's environment).
multiple concurrent sessions.