Metadata-Version: 2.4
Name: bujang-mila
Version: 0.1.7
Summary: bujang plugin: Mila cluster configuration
License-Expression: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# bujang-mila

[bujang](../../README.md) plugin with the Mila cluster configuration: the clusters
(`bujang_mila/config/clusters.yaml`), their slurm profiles by node type
(`bujang_mila/config/profiles/<cluster>.yaml`) and example scripts (`bujang_mila/config/scripts/<cluster>/`).

```bash
uv add "bujang[mila]"          # or: pip install "bujang[mila]", or bujang-mila on its own
```

Installed, the clusters show up in `bujang serve` with no other setup
(`GET /api/slurm/config/sources` shows them coming from `mila`). Override a field in a
user file, e.g. `~/.config/bujang/mila.yaml`:

```yaml
clusters:
  mila:
    remote_folder: ~/scratch/bujang
```

## SSH config

bujang reaches each cluster with `ssh <alias>`. `bujang_mila/config/ssh_config` holds the
matching `~/.ssh/config` entries for every cluster above, plus the Trillium data mover
`tri-dm1`. Install them with your usernames (`MILA_USER` is also used for Lynx,
`ALLIANCE_USER` is your CCDB username):

```bash
bujang ssh install --plugin mila --set MILA_USER=... --set ALLIANCE_USER=...
bujang ssh test --plugin mila      # connect to every cluster, read only
```

The block goes between `# >>> bujang:mila ...` anchors (a backup of the file is made first);
running `install` again after an upgrade updates it in place, `bujang ssh remove --plugin mila`
removes it. On clusters with MFA, run `ssh <alias>` once in a terminal. bujang then reuses that
connection (ControlMaster) until `ControlPersist` expires.

## Examples

`bujang_mila/config/scripts/<cluster>/` has a job per cluster (`<cluster>_gpu_example.sh`, a CPU
one on `trillium`) that trains the MNIST example of pytorch/examples (`mnist/main.py`, checked out at
a pinned commit; the scripts carry no Python code). On mila, fir and nibi the job clones the code and
downloads MNIST itself. The clusters whose compute nodes have no internet (rorqual, tamia,
trillium-gpu, trillium, lynx) have a `<cluster>_download_example.sh` step and a
`pipeline/<cluster>_gpu_example.json` (`trillium_cpu_example.json`) that runs it first on the login
node or the data mover, plus a `<cluster>_proxy_example.json` that runs it as a Slurm job through
the SOCKS proxy (not on trillium): see [docs/EXAMPLES.md](../../docs/EXAMPLES.md). Rorqual, tamIA and
Lynx have a `login` node type (ssh executor on the login node) for those steps. The examples use `# {START}` / `# {END}` for bujang's
bookkeeping (see [Script placeholders](../../docs/SCRIPTS.md#script-placeholders)).
