flux proxy [OPTIONS] TARGET [command [args...]]
flux proxy connects to the Flux instance identified by TARGET, then spawns a shell with FLUX_URI pointing to a local:// socket managed by the proxy program. As long as the shell is running, the proxy program routes messages between the instance and the local:// socket. Once the shell terminates, the proxy program terminates and removes the socket.
The TARGET argument is a URI which can be resolved by
including a Flux jobid, a fully-resolved native
URI, or a resolvable URI with a scheme supported by a
plugin. See flux-uri(1) for details.
If the connection to the Flux instance is lost, for example when the
target instance terminates, flux proxy will emit an error message,
SIGCONT to the spawned shell or other process,
and wait for it to terminate before exiting. The delivery of signals
can be disabled with the
-n, --nohup option, but be aware that Flux
commands running under a flux proxy which has lost its connection
will likely result in errors.
The purpose of flux proxy is to allow a connection to be reused, for example where connection establishment has high latency or requires authentication.
- -f, --force
Allow the proxy command to connect to a broker running a different version of Flux with a warning message instead of a fatal error.
- -n, --nohup
When an error occurs in the proxy connection, flux proxy will normally shut down the proxy and send
SIGCONTto the spawned shell or command. If the
-n, --nohupoption is used, the
SIGCONTsignals will not be sent. flux proxy will still wait for the spawned shell or command to exit before terminating to avoid having the child process reparented and possibly lose its controlling tty.
If broker communication fails, drop the current connection and try to reconnect every 2 seconds until the connection succeeds. Any event subscriptions and service registrations that were made on behalf of clients are re-established, and in-flight RPCs receive an ECONNRESET error responses.
Connect to a job running on the localhost which has a FLUX_URI
local:///tmp/flux-123456-abcdef/0/local and spawn an interactive
$ flux proxy local:///tmp/flux-123456-abcdef/0/local
Connect to the same job remotely on host foo.com:
$ flux proxy ssh://foo.com/tmp/flux-123456-abcdef/0/local
Connect to a Flux instance running as job ƒQBfmbm in the current instance:
$ flux proxy ƒQBfmbm
$ flux proxy jobid:ƒQBfmbm
Connect to a Flux instance running as job ƒQ8ho35 in ƒQBfmbm
$ flux proxy jobid:ƒQBfmbm/ƒQ8ho35
Connect to a Flux instance started in Slurm job 1234
$ flux proxy slurm:1234