/** * Renders the sbatch script that launches a Nebula client-server inside a job. * * The rendered job: * - re-invokes this very Nebula install (same node binary + entry) with --client * from the same working directory (all visible on the shared filesystem), * - points it at the login-node main server, * - carries a one-time allocation token so the main server can correlate the * resulting registration back to this allocation. * * The client spawns its kernels locally (ZeroMQ on 127.0.0.1 on the compute * node); nothing here touches the kernel transport. */ import type { JobSpec } from './types'; export interface LaunchContext { /** URL the compute node uses to reach the main server, e.g. http://login:3000 */ mainUrl: string; secret?: string; /** Absolute node binary path (shared FS), e.g. process.execPath */ nodeBin: string; /** Node exec args, e.g. ['--import', 'tsx'] */ execArgv: string[]; /** Server entry script, e.g. process.argv[1] */ scriptPath: string; /** Working directory to launch from (the nebula checkout) */ cwd: string; /** Directory (on shared storage) for job scripts + logs */ stateDir: string; /** * Per-arch runtime substitutions (node's process.arch keys, e.g. 'arm64') * for partitions whose CPU arch differs from this server's — see arch.ts. */ archOverrides?: Record; /** Arch of nodeBin itself. Defaults to process.arch; overridable for tests. */ serverArch?: string; } export declare function renderJobScript(spec: JobSpec, ctx: LaunchContext, allocId: string, token: string): string;