Tunnels, CLI and errors
SSH port forwarding to a Ray head node, using the OpenSSH client.
with RayTunnels(head.public_ip, user="yd-agent", private_key="~/.ssh/id_ed25519"):
ray.init("ray://localhost:10001") # the Ray client port
... # the dashboard is at localhost:8265
One ssh process carries all the forwards, so they all work or none do. Your
SSH configuration (~/.ssh/config: jump hosts, agents and so on) applies, except
where the options below override it.
Host keys are not checked by default, as with Ray’s own SSH: cloud instances
are short-lived and their addresses are reused, so a remembered host key says
little. Where that matters (the tunnel carries the Ray client and dashboard
traffic), record the head node’s key yourself and pass
ssh_options=["StrictHostKeyChecking=yes", "UserKnownHostsFile=<file>"].
The ssh process is stopped by stop() or by leaving the with block. A
process killed outright (SIGKILL, or SIGTERM with no handler) cannot do
that, and leaves its ssh running.
- class yellowdog_ray.tunnels.PortForward(local_port: int, remote_port: int, remote_host: str = 'localhost', local_host: str = 'localhost')[source]
Bases:
objectForward
local_host:local_porthere toremote_host:remote_portas seen from the head node.
The raydog command: see what clusters exist, and end them.
raydog list clusters in a namespace raydog status CLUSTER one cluster in detail raydog down CLUSTER shut a cluster down raydog cleanup find (and with –delete, remove) leftovers raydog tunnel CLUSTER forward the Ray ports of a cluster’s head node
It works from any machine with YellowDog credentials: clusters are found on the
platform by name, whoever created them and however (Builder or ray up).
- yellowdog_ray.cli.main(argv: Sequence[str] | None = None, *, platform: Platform | None = None, clock: Clock | None = None) int[source]
Run the command line. Returns the process exit code.
Every exception RayDog raises deliberately.
- exception yellowdog_ray.errors.BuildTimeoutError[source]
Bases:
RayDogError,TimeoutErrorA node did not start within the build timeout.
- exception yellowdog_ray.errors.ClusterExistsError[source]
Bases:
RayDogErrorA live cluster with this name already exists.
- exception yellowdog_ray.errors.ClusterNotFoundError[source]
Bases:
RayDogErrorNo cluster with this name was found.
- exception yellowdog_ray.errors.ClusterStateError[source]
Bases:
RayDogErrorThe operation is not valid in the cluster’s current state.
- exception yellowdog_ray.errors.ConfigError[source]
Bases:
RayDogErrorA cluster specification, YAML config or name is invalid.
- exception yellowdog_ray.errors.CredentialsError[source]
Bases:
RayDogErrorYellowDog credentials are missing or were rejected.
- exception yellowdog_ray.errors.InvalidRequestError(message: str, *, error_type: str | None = None, status_code: int | None = None, retryable: bool = False)[source]
Bases:
PlatformErrorThe platform rejected the request as invalid.
- exception yellowdog_ray.errors.NameInUseError(message: str, *, error_type: str | None = None, status_code: int | None = None, retryable: bool = False)[source]
Bases:
InvalidRequestErrorThe name is already taken, possibly by an object that has ended.
- exception yellowdog_ray.errors.NodeStartError[source]
Bases:
RayDogErrorA node’s task failed or was cancelled before it started running.
- exception yellowdog_ray.errors.NotFoundError(message: str, *, error_type: str | None = None, status_code: int | None = None, retryable: bool = False)[source]
Bases:
PlatformErrorThe object does not exist.
- exception yellowdog_ray.errors.PlatformError(message: str, *, error_type: str | None = None, status_code: int | None = None, retryable: bool = False)[source]
Bases:
RayDogErrorA call to the YellowDog platform failed.
- exception yellowdog_ray.errors.RayDogError[source]
Bases:
ExceptionBase class for all RayDog errors.
- exception yellowdog_ray.errors.TeardownError(failures: Sequence[tuple[str, Exception]])[source]
Bases:
RayDogErrorTeardown ran to the end, but some steps failed.
Something may still be running.
failurespairs a description of each step that failed with the exception it raised.
- exception yellowdog_ray.errors.TunnelError[source]
Bases:
RayDogErrorAn SSH tunnel could not be opened.