An Open OnDemand Batch Connect application that launches a browser-based terminal running the GitHub Copilot CLI on a Quest compute node. A Quest-specific MCP server starts automatically with every session, giving the agent read/write access to the user's home directory and Quest documentation.
App metadata consumed by the OOD portal: name, icon, category, and description shown on the app card and launch page.
Defines the web form a user fills in before launching a session. Fields:
| Field | Purpose |
|---|---|
slurm_partition |
SLURM partition to submit to |
slurm_account |
Allocation to charge |
num_cores |
CPU cores (--ntasks-per-node) |
memory_per_node |
RAM in GB (--mem) |
bc_num_hours |
Walltime in hours (--time) |
user_email |
Optional email on session start |
job_name |
SLURM job name |
raw_data / raw_group_data |
Hidden fields populated by OOD helpers; used by form.js to drive the dynamic dropdowns |
JavaScript that powers the dynamic partition and account dropdowns. On page load and on
partition change it reads raw_data and raw_group_data, filters the available
partition/account combinations to those the user actually belongs to, and enforces the
correct walltime and memory limits for the selected partition.
Translates form values into sbatch flags passed to SLURM:
--partition, --account, --time, --nodes, --ntasks-per-node, --mem,
--job-name, and optionally --mail-user.
The panel shown in the OOD dashboard while the session is running. Provides:
- A Connect button that opens the browser terminal.
- The SSH tunnel command for users who want to connect from outside Quest.
- Quick-start example
copilotcommands.
Runs inside the SLURM job before the main script. It:
- Finds an available port for the
ttydweb terminal. - Sets
COPILOT_PREFIXandCOPILOT_CUSTOM_INSTRUCTIONS_DIRSto the shared install at/software/2025/copilot_cli. - Writes the MCP config JSON (pointing to the Quest filesystem server at
/software/2025/mcp) into the session's staged directory. - Installs that config to
~/.copilot/mcp-config.json, backing up any pre-existing file so it can be restored on session end. - Pre-approves all
quest-filesystemMCP tools in~/.copilot/permissions-config.jsonso Copilot CLI does not prompt for interactive confirmation inside the batch job. - Ensures
quest-filesystemis not listed in the user'sdisabledMcpServerssetting.
The main SLURM job script (started in the background by OOD). It:
- Registers a
cleanuptrap that fires onEXITandSIGTERM(e.g. when SLURM terminates the job at walltime). The trap restores the user's original~/.copilot/mcp-config.jsonfrom the backup created inbefore.sh.erb, ensuring no session-specific config leaks into subsequent sessions. - Launches
ttyd— the browser-based terminal server — on the port chosen bybefore.sh.erb. - Serves a small startup script that prints session info (binary path, version,
active MCP config) and drops the user into an interactive bash shell with
copilotonPATH.
Waits (up to 120 seconds) for ttyd to open its port. Once the port is open,
OOD marks the session as Running and enables the Connect button. Exits with
an error and cleans up the SLURM job if the timeout is reached.
The quest-filesystem MCP server is managed by RCS staff and lives at
/software/2025/mcp. Write access to that path is restricted to the
rcs_staff group — regular users receive the server automatically with every
session but cannot modify the server binary or its configuration.
The server gives Copilot read/write access to two directories:
| Path | Purpose |
|---|---|
$HOME (resolved via realpath) |
The user's home directory |
/software/2025/copilot_cli |
Quest guidelines and custom instructions |
Quest-specific agent guidance is in /software/2025/copilot_cli/quest_guidelines.md.
Copilot reads it automatically via the MCP server without a separate process.
The server is named quest-filesystem rather than filesystem so it is never
silently skipped by a user-level disabledMcpServers setting that might contain
the generic name.
User submits form
│
▼
SLURM allocates a compute node
│
▼
before.sh ── sets port, writes MCP config, pre-approves tools
│
▼
script.sh ── (background) registers cleanup trap, launches ttyd
│
▼
after.sh ── waits for ttyd port; OOD marks session "Running"
│
▼
User connects via browser terminal
│
▼
Session ends (user exits, walltime reached, or job cancelled)
│
▼
script.sh EXIT/SIGTERM trap restores ~/.copilot/mcp-config.json
SLURM kills all remaining job processes
Place this directory in a shared OOD app path readable by all cluster users.
Write access should be restricted to rcs_staff so users cannot alter the app
files. The SLURM job and the MCP server both run as the submitting user; no
elevated privileges are required.
Required shared paths (managed by RCS staff, not part of this app):
| Path | Contents |
|---|---|
/software/2025/copilot_cli/ |
Copilot CLI binary, quest_guidelines.md, *.instructions.md |
/software/2025/mcp/ |
Node.js MCP filesystem server |