Skip to main content

How it works

This page follows a Cybershuttle session from a form in VS Code or JupyterLab to an editor or notebook connected to a Slurm compute node, and assumes user-level knowledge of ssh and sbatch. The Introduction names the components and Architecture states what each owns.

Five terms recur. Airavata is the hosted service behind CS Jupyter and CS Batch. Linkspan is the agent that runs as the main process of each session job. A transport is the outbound connection through which a client reaches Linkspan. A session is a durable definition: SSH host, Slurm account and partition, resources, root folder and transports. It is defined once and started many times. Each start creates a run: one Slurm job, numbered by seq from 1. The Glossary defines the other terms.

Each arrow points from the side that opens the connection; only Slurm reaches into the compute node.

Session sequence​

Both interactive clients take a session through the same steps; they differ in who runs the login-node commands (Credentials).

StepWhat happensWhere
1. Discoversacctmgr lists the user's Slurm accounts; sinfo lists partitions, CPUs, memory and GPUsLogin node
2. Validatesbatch --test-only runs the site's submit filter on the generated script without queueing a jobLogin node
3. InstallLinkspan is installed into ~/.cybershuttle/bin/ on first use; no privilege neededThe user's home directory
4. Submitsbatch submits a one-node, one-task job under the user's login and Slurm accountSlurm
5. StartLinkspan starts an SSH server (VS Code) or Jupyter Server (Jupyter) on 127.0.0.1Compute node
6. ConnectLinkspan dials out to a relay; the editor or browser reaches the node through itOutbound HTTPS
7. EndStop runs scancel, or Slurm ends the job at its walltimeSlurm

From step 4 the job is visible with squeue -u $USER on the login node. It is named linkspan-session for VS Code and cs-<session id>-<seq> for Jupyter, and writes its output under ~/.cybershuttle/logs/. Between steps 4 and 7 the job holds its resources and is charged for them, whether or not a client is connected.

Credentials​

CS Bridge runs every Slurm command over the user's own ssh, while CS Jupyter and CS Batch have Airavata run them, under the user's login for Jupyter and a cluster configuration's login for Batch. For Jupyter, Airavata keeps the SSH connection open after the first login, so an MFA answer is given once and the connection serves later commands. Credentials and data summarises this per client, and Security model lists every credential and where it is held.

Transports​

Compute nodes are assumed to accept no inbound connections, so Linkspan opens the connection outward and the client meets it at a relay.

TransportPathUsed byAccount neededTraffic carried by
Dev TunnelLinkspan hosts a Microsoft Dev Tunnel; the client connects through Microsoft's relayVS Code (default), Jupyter (optional)Microsoft (VS Code); Microsoft or GitHub (Jupyter)Microsoft's relay; for Jupyter, also Airavata
LinkLinkspan opens a WebSocket to Airavata, which forwards the client's traffic over itJupyter (default), VS Code (experimental)NoneAiravata; on the public instance, jupyterapi.cybershuttle.org

Requirements lists the outbound hosts of each, and Architecture the full path.

States​

A session defined through Airavata is in one of seven states, which tell where its current run stands and are shown in CS Jupyter. A run normally goes SUBMITTING → QUEUED → STARTING → READY, then STOPPING → STOPPED on Stop, or straight to STOPPED at its walltime. Session states gives each state's meaning for researchers, and Airavata sessions and runs gives every transition and how reconciliation decides it. CS Bridge keeps its own status model; see CS Bridge architecture.

Jupyter path​

The sequence and steps below trace one Jupyter session through every component. Every Airavata route is under the session server's /api/v1. PKCE is the OAuth sign-in flow for a client that cannot keep a secret, such as a browser page. yamux carries many independent streams over the one link WebSocket.

Sequence​

Steps​

Cluster paths are under ~/.cybershuttle/.

StepCS JupyterAiravataCluster
Sign inPKCE with CILogon (oauth/config, oauth/exchange); tokens in sessionStorageAdds the client secret; checks the ID token's signature, issuer and audience on every call
SSH hostPosts the user's ssh command (POST hosts) and optionally a key uploaded under SSH Keys (POST keys/ssh)Parses the command, stores the host, renders a per-user SSH config
AuthenticateOn 409 ssh_authentication_required, opens a terminal over the SSH authentication WebSocketRuns ssh in a PTY to establish a control masterThe user answers MFA once; later commands reuse the master
DiscoverShows accounts, partitions and homeRuns id -un, sacctmgr show associations, sinfo and printenv HOME in one SSH call
ValidateReview Slurm jobsbatch --test-only on the exact scriptThe site's submit filter runs
Define and startPOST sessions, then sessions/{id}/startNext seq, fresh Jupyter and link tokens, a Dev Tunnel only if devtunnel is requested; SUBMITTING
PrepareShows the status logOne SSH callLinkspan installed or updated in bin/; sessions/<id>/workflow.yaml written
SubmitRuns sbatch --export=ALL from a script on standard input that exports the tokens, keeping them out of arguments and the job script; QUEUEDJob queued
StartPolls every secondReconciles with Slurm every 30 seconds; STARTING once the job runsThe job execs Linkspan; logs go to logs/<id>-<seq>.{out,err}
LinkREADY when Linkspan's link connectsLinkspan dials Airavata's …/sessions/<id>/link WebSocket
JupyterLinkspan runs the workflow step jupyter.sessions.start: builds jupyter-env/ with uv, starts Jupyter Server on a loopback port derived from the session ID and seq
AccessRequests the grant for this run and keeps it in memory onlyReturns the Jupyter URI and token; refuses until READY
ConnectReloads with the session and workspace URL parameters set to the session ID; points JupyterLab at the proxyProxies REST and WebSockets over the link
UseKernels, terminals, filesSamples Linkspan's usage every 5 secondsCode runs on the compute node, as the user
StopStopSets STOPPING and runs scancel on the jobSlurm cancels the job
EndReturns to the session home and opens the run's report in Run HistoryFreezes the run with its log tail and usage; fetches sacct accounting, retrying for up to 10 minutesAt cancellation or walltime, Linkspan gets SIGTERM, runs its stop steps and stops every server

CS Bridge path​

CS Bridge submits the job itself over the user's own SSH. It uses a Dev Tunnel by default, or the link with the settings csbridge.transport: "link" and csbridge.experimentalFeatures: true. Its jobs are named linkspan-session, log to ~/.cybershuttle/logs/linkspan-session-<job id>.{out,err} and run no workflow document. Each Start is a new run of the same local session. With a Dev Tunnel, Airavata takes no part and records nothing.

With the link, CS Bridge registers its job with Airavata through attach, which gives the run the platform vscode. Airavata then carries the link and forwards, samples usage and freezes the run into history. It does not submit, reconcile or cancel a job the client launched: an Airavata stop only marks the session STOPPED, and CS Bridge runs scancel itself. Transports gives each step of both transports.

Batch runs​

A CS Batch run uses neither Linkspan nor a transport. Airavata's batch server copies each input file to the cluster by SCP, renders the job script from the application's template, submits it with sbatch over SSH, and copies each output file back when the job ends. Launch sequence gives each step.

The batch server learns the job's state only from the e-mail Slurm sends. On a site that delivers no job e-mail, a run is submitted but never reported as started or ended, and its outputs are not copied back; fetch them from the working directory on the cluster. A run cannot be cancelled through Airavata; use scancel on the cluster.