# Develop for the entire RCC cluster

This is the public developer contract for project repositories prepared with
Codex, Claude, Cowork, or another coding assistant. It describes the intended
RCC operating model. It does not grant infrastructure access and does not
confirm that a particular node, partition, portal, or service is currently
available.

Read the machine-readable companion
[`cluster-capabilities.yml`](cluster-capabilities.yml), then copy
[`project-cluster-handoff.yml`](project-cluster-handoff.yml) into the project
repository. The handoff records requirements; it is not Ansible inventory,
Slurm configuration, an RCC Admin export, or deployment authorization.

## The target user path

Use RCC as a cluster rather than as a collection of individually selected
machines:

```text
workstation
  -> one of c001/c002/c119/c120 for editing, Git, submission, and monitoring
  -> allocation-backed Slurm development session when resources are needed
  -> Slurm CPU or GPU workers for execution
  -> shared storage for inputs and durable results
```

The four general shellhosts are Slurm clients but not workers: `slurmd` is
disabled and no partition can place a job on them. A shellhost is not a private
workstation. Do not run substantial computation, notebooks, model training,
persistent services, or long-lived tests directly on it. Do not select a compute host because it currently contains your environment
or the only copy of your data.

Legacy direct-host behavior may remain during the transition. New project code
must target the Slurm-first model rather than preserve that behavior.

## Choose a workload profile

### Batch computation

Use `sbatch` for reproducible CPU or GPU work. Every job declares realistic
walltime, CPU, memory, log paths, and GPU requirements where applicable. The
normal CPU partition is `cpu_nodes`; `cpu_short` is for bounded short work.
Heterogeneous GPU work uses `gpu_nodes` and requests the required GPU count and,
when scientifically material, the GPU type or capability.
The specialist `interactive_gpu` partition provides five schedulable RTX
A6000 devices on one allocation-backed interactive worker; its quarantined
sixth physical GPU is never assigned to jobs.

Do not hard-code a physical host. Discover current partition and feature
availability with `sinfo` and `scontrol`.

### Interactive development

Interactive nodes are ordinary schedulable workers held by a Slurm allocation;
they are not a second set of freely accessible login hosts. Start a durable CPU
session from a shellhost with:

```bash
rcc-dev-session start --wait
rcc-dev-session shell JOBID
```

Use `--gpu` for one GPU. CPU sessions default to eight hours and have a hard
thirty-day ceiling. GPU sessions default to four hours and have a seven-day
ceiling. Each user may hold one CPU and one GPU development session.

For VS Code, either connect to a named shellhost and submit compute through
Slurm, or run `rcc-dev-session vscode JOBID` and use the generated
`rcc-dev-JOBID` Remote SSH target. `pam_slurm_adopt` admits and accounts the
connection only while that job is active. The VS Code server and descendants
terminate when the allocation ends.

The allocation, not the SSH connection, owns the resources. The project must
not depend on the assigned worker surviving maintenance or on data stored only
on that node.

### Workflows

Snakemake and Nextflow submit tasks through Slurm. Keep workflow definitions,
resource declarations, container references, and dependency locks in Git.
Keep resume-critical workflow state on shared storage. Use `$TMPDIR` only for
explicit task scratch; node-local workflow state cannot be resumed from another
worker.

### Group-owned capacity

A project that requires group-owned machines declares that requirement in the
handoff. The RCC operator maps the approved group policy to scheduler resources.
Borrowed work on group-owned nodes (ADR-0038) must be restartable and
requeueable, with a time limit of at most four hours, because owner work can
preempt it. Separately, ADR-0132 contributed pools let eligible jobs with an
explicit time limit of at most two hours borrow idle capacity without
preemption; Slurm routes them automatically. Both policies are staged until
scheduler activation is accepted. A developer must not encode ownership by
naming a machine.

## Data contract

Use shared storage for authoritative inputs and durable outputs:

- `/projects/<project>` for project data and results;
- `/groups/<group>` for group collaboration;
- `/homes/<user>` for personal configuration and small user-owned source.

Slurm provides job-local scratch through `$TMPDIR`. Current workers place this
under a private `/local/work/<user>/slurm-job-<jobid>` directory. Scratch is
not shared, not backed up, and may disappear after the job or during node
maintenance. Stage inputs deliberately and copy validated outputs back before
the job exits.

A local non-RAID drive must never contain the only copy of source, input data,
results, an irreplaceable environment, or workflow resume state.

The handoff records expected data volume, file count, I/O pattern, retention,
transfer method, and stage-in/stage-out tests. This lets an agent identify
machine-affine or metadata-heavy designs before they reach production.

## Software contract

Apptainer is the preferred portable runtime. Pin the image by immutable digest
and retain its definition or another reproducible build description. Do not
assume Docker, root privileges, host networking, or arbitrary devices.

Conda environment descriptions are portable; an installed Conda prefix is not.
RCC uses node-local Conda package and environment paths, so an environment
created interactively on one host must not be treated as available on a worker.
Use workflow-managed rule or process environments, recreate the environment
inside the job, or use an Apptainer image.

Project repositories should support both currently relevant CPU architectures
where practical. When architecture matters, declare `x86_64` or `arm64`
explicitly in the handoff and build or select matching artifacts.

## Network and dependency contract

Do not assume direct external network access from a worker. Resolve and pin
software dependencies during project preparation, pre-stage immutable
artifacts, or use an operator-approved acquisition path. A successful download
from one shell does not make network access part of the workload contract.

## Cluster user surfaces

The capability catalog uses logical service names rather than private topology:

- **ClusterDocs** is the human onboarding and education source.
- **RCC Admin** handles account, project, membership, recovery, and governed
  service requests; it is not an agent deployment API.
- **Files** provides the browser and SFTP interfaces for ordinary
  project-scoped transfer.
- **RCC-workbench** is the staged replacement interface for governed
  Slurm-backed interactive development sessions. Its menu entry remains hidden
  until the Workbench ingress and service have passed operator acceptance.
- **Globus** is the operator-approved path for large or external transfers.
- **RCC AI Assistant** may provide support and advice, but it
  is not an execution or authorization boundaries.
- **Coscine archive** is the approved archival surface when enabled for the
  project.

Availability is discovered from the RCC front page, Slurm, or operator evidence.
An entry in this contract describes an interface and must not be interpreted as
proof that the service is enabled for a specific project. Record required
surfaces in the project handoff.

## Data transfer

Use the Files portal or SFTP for ordinary project transfer. Request Globus only
when its scale or external endpoint integration is required and the operator
confirms availability. Project applications must not become ad-hoc file
servers and must never expose raw cluster filesystem roots.

## Managed services

RCC supports four developer-facing service profiles:

1. **Static site** — reviewed static information under the governed web service.
2. **Protected web application** — an active application behind RCC
   authentication and project authorization.
3. **Application-local database** — loopback-only SQL state for one approved
   protected application.
4. **Scheduled batch service** — recurring work expressed as bounded,
   observable Slurm jobs rather than a daemon on a shellhost or worker.

Read
[`project-vhost-dbhost-integration.md`](project-vhost-dbhost-integration.md)
for the web and database profiles. A persistent daemon, shared database,
network listener, or privileged service that does not fit these profiles needs
a separate operator design and approval. Do not run it informally on a compute
or interactive host.

## Agent workflow

A coding agent may:

- prepare source, tests, workflow definitions, Slurm scripts, containers, and
  documentation;
- complete the non-secret project handoff;
- identify portability, resource, storage, and security blockers;
- report exact tests and unresolved operator inputs;
- when an RCC project lead has explicitly released one, use a ModelView
  `schema-only` or `coding-safe` projection as programming context. Source
  semantic identifiers (for example column names, VCF sample/INFO/FORMAT IDs,
  JSON keys, DICOM tags, or HDF5 dataset names) are private by default and may
  be pseudonymized or withheld. A released projection is not proof of access to
  the protected source data;
- return code with the projection/release-bound `modelview-return.json` contract
  when ModelView is used. RCC may copy the return into private state and test it
  against the same safe projection in a no-network sandbox before any separate
  real-data execution decision.

A coding agent must not:

- access RCC infrastructure secrets or administrative repositories;
- invent hosts, addresses, groups, credentials, certificates, or approvals;
- administer identity, scheduling, storage, DNS, firewalls, or hardware;
- claim a live deployment, successful cluster run, or available service without
  evidence supplied by RCC operations;
- place credentials, private data, connection strings, or unpublished results
  in Git;
- treat a safe projection as permission to request, reconstruct, infer, or
  execute against the corresponding protected source data. Returned code must
  come back to RCC for projection/release-bound intake and review; synthetic
  sandbox success is evidence about code behavior only. Real-data execution is
  a separate authorization and may not be inferred from release, return intake,
  or sandbox success.

## Required completion report

Every agent or developer handoff states:

- project, owners, and current phase;
- selected workload and service profiles;
- data paths, classification, volume, I/O pattern, and transfer plan;
- CPU, memory, walltime, concurrency, architecture, and GPU requirements;
- software and workflow reproducibility mechanism;
- scratch stage-in, stage-out, checkpoint, and resume behavior;
- files changed and tests run;
- unresolved operator gates;
- confirmation that no secret or private research data was committed.
