Skip to main content

HPC simulation run management CLI tool for Slurm-based environments

Project description

runops

runops は、HPC / Slurm 上のシミュレーション研究を AI エージェントと進める ための実行基盤です。

人間が多数の CLI コマンドを覚えて日々叩くための道具ではありません。CLI は 存在しますが、それは Agent が project state を安全に読み書きするための execution kernel です。人間は研究意図、制約、判断、確認を与え、Agent が campaign.toml、case、survey、run、manifest、notes、analysis を整えます。

最初に読むべき入口は AI エージェントではじめる です。

なぜ runops が必要か

HPC シミュレーション研究では、研究そのものよりも周辺の運用が重くなりがちです。

  • 入力ファイルと投入スクリプトがどの仮説から来たのか分からなくなる
  • survey のパラメータ、run directory、Slurm job、解析結果がばらける
  • 失敗 run の retry や continuation の由来が追えなくなる
  • ノート、知見、論文用 export、共有知識が別々の場所で腐る
  • AI Agent に任せようとしても、どこを触ってよくてどこが正本か伝わらない

runops はこの問題を、単なる CLI ではなく Agent が扱える研究 project state として 整理します。

AI 前提の作業ループ

日常運用の主役は、CLI ではなく Agent との会話です。

  1. 人間が研究意図を伝える
  2. Agent が campaign.toml、case、survey を設計する
  3. runops が run directory と manifest.toml を生成する
  4. Agent が投入前 plan、対象 run、queue、資源量を提示する
  5. 人間が高コスト操作や破壊的操作だけ確認する
  6. Agent が状態同期、log 読解、解析、notebook、report、知見整理を進める
  7. 判断が変わったら research/agenda.md と次の survey に戻す

このループの具体的な始め方は docs/get-started-with-agent.md を見てください。 project state の全体像は docs/layers/README.md にまとめています。

人間と Agent の分担

人間が主に行うこと:

  • 研究テーマ、仮説、探索範囲、観測量を言語化する
  • ベース入力や物理的制約の意図を伝える
  • 初回 bulk submit、retry、archive、delete などの gate を確認する
  • 結果の科学的な解釈や次の判断をレビューする

Agent が主に行うこと:

  • project context、既存 notes、materials、refs、environment を読む
  • campaign.toml、case、survey の草案を作る
  • run 生成、submit、sync、status、log、analysis を runops 経由で進める
  • notes/YYYY-MM-DD.mdnotes/reports/research/agenda.md を更新する
  • runops 本体への改善要望や local patch 候補を整理する

CLI を手で直接使う場面は、bootstrap、debug、CI、Agent 実装確認、緊急時の operator 作業に限るのが基本です。必要な場合の詳細は Interface Layer に移しました。

コア設計思想

runops の中心にある思想は、以下の分離です。

  • run directory が日常運用の主単位 すべての実行、状態、解析、履歴は runs/.../RYYYYMMDD-NNNN/ を基点に扱う。

  • manifest.toml が run の正本 run id、状態、由来、job id、Slurm 状態、provenance、parameter snapshot を manifest に記録する。notes や会話ログは補助情報であり、正本ではない。

  • 不変と可変を分ける run.id は不変。path は分類・整理のために変わりうる。run の由来と parameter snapshot を残すことで、移動や再分類に耐える。

  • case / survey / run を混ぜない case は reusable な基本定義、survey は parameter expansion、run は実行単位。 run の input を場当たり的に直さず、再利用すべき変更は case / survey に戻す。

  • Simulator Adapter に閉じ込める simulator 固有の input rendering、runtime 解決、出力検出、summary は Adapter が持つ。 core は simulator に依存しない。

  • Launcher Profile に閉じ込める srun / mpirun / mpiexec、site 固有の Slurm directive、module load は Launcher と site profile に寄せる。Python は MPI rank の wrapper にならない。

  • Agent harness は project state の一部 .claude/.agents/.codex/AGENTS.mdCLAUDE.md は、Agent に 触ってよい場所、確認すべき gate、使う skill を伝える運用面の正本です。

Project が memory になる

runo init で生成される project は、単なる実行ディレクトリではなく、 人間と Agent の共有 memory です。

project/
  campaign.toml          # 研究意図、仮説、変数、観測量
  cases/                 # reusable case definitions
  runs/                  # survey と run directory
  notes/                 # append-only lab notebook と refined reports
  research/agenda.md     # 現在の研究判断
  materials/             # papers, manuals, figures, snippets
  refs/                  # simulator docs / external knowledge sources
  .runops/               # environment, generated Agent context, facts
  .claude/ .agents/ .codex/
                         # Agent harness, skills, rules, permissions

この構造の意味は レイヤー一覧 から辿れます。

Safety Gates

runops は AI 前提ですが、何でも自動化するという意味ではありません。 次の操作では人間の確認を挟みます。

  • 初回または高コストな submit --all
  • queue、QOS、node 数、walltime、memory を増やす retry
  • cancelarchivepurge-workdelete
  • 研究仮説や campaign の意味が変わる編集
  • project-state migration や harness 更新

Agent は確認前に、対象 run、queue、資源量、想定 core-hour、変更理由を提示します。

最小セットアップ

新規 project:

uvx --from runops runo init
uvx --from runops runo doctor

既存 project:

uvx --from runops runo setup https://github.com/user/my-project.git
cd my-project
uvx --from runops runo doctor

ここまで終わったら、CLI を順に叩くのではなく Agent に研究内容を渡します。 依頼例は docs/get-started-with-agent.md にあります。

runops 自体の開発

git clone https://github.com/Nkzono99/runops.git
cd runops
uv sync --dev

uv run pytest
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run mypy src/

ドキュメント

ライセンス

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runops-0.10.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

runops-0.10.0-py3-none-any.whl (469.3 kB view details)

Uploaded Python 3

File details

Details for the file runops-0.10.0.tar.gz.

File metadata

  • Download URL: runops-0.10.0.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runops-0.10.0.tar.gz
Algorithm Hash digest
SHA256 3a0f7c550358409f16ce7677a6a01cdb87a5484b3ed7b0cc78b844edf6b6ecc9
MD5 709591c61c0edd396f75d76c60387b9e
BLAKE2b-256 d127a9c5548adfdcc3ea7eeba1660cb9211534257fbd3ca4d1b8367e7317ed4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for runops-0.10.0.tar.gz:

Publisher: publish.yml on Nkzono99/runops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file runops-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: runops-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 469.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runops-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 022a8a530ae48ad235ef649f23e616d9e67b4edeeae5fafc2ef81aa6c28384dc
MD5 f2400ab93da5f94e62c2e641e555fe6d
BLAKE2b-256 cdb6d24be82511d98c0ab2800dd8bbb371c87471739e7be43ec0d40685945e1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for runops-0.10.0-py3-none-any.whl:

Publisher: publish.yml on Nkzono99/runops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page