hpc-runner 0.2.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. hpc_runner-0.3.0/.github/workflows/docs.yml +56 -0
  2. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/CLAUDE.md +1 -1
  3. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/PKG-INFO +11 -10
  4. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/README.md +4 -9
  5. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/defaults/config.toml +1 -1
  6. hpc_runner-0.3.0/docs/Makefile +20 -0
  7. hpc_runner-0.3.0/docs/source/_static/.gitkeep +1 -0
  8. hpc_runner-0.3.0/docs/source/_templates/.gitkeep +1 -0
  9. hpc_runner-0.3.0/docs/source/cli.rst +79 -0
  10. hpc_runner-0.3.0/docs/source/conf.py +41 -0
  11. hpc_runner-0.3.0/docs/source/configuration.rst +144 -0
  12. hpc_runner-0.3.0/docs/source/getting_started.rst +78 -0
  13. hpc_runner-0.3.0/docs/source/index.rst +19 -0
  14. hpc_runner-0.3.0/docs/source/programmatic_api.rst +170 -0
  15. hpc_runner-0.3.0/docs/source/sge.rst +95 -0
  16. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/pyproject.toml +4 -0
  17. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/_version.py +2 -2
  18. hpc_runner-0.3.0/src/hpc_runner/cli/__init__.py +1 -0
  19. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/config.py +11 -8
  20. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/main.py +6 -0
  21. hpc_runner-0.3.0/src/hpc_runner/cli/submit.py +72 -0
  22. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/__init__.py +1 -1
  23. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/config.py +12 -11
  24. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/exceptions.py +2 -2
  25. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/job.py +4 -0
  26. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/types.py +1 -1
  27. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/local/scheduler.py +70 -41
  28. hpc_runner-0.3.0/src/hpc_runner/schedulers/local/templates/job.sh.j2 +68 -0
  29. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/templates/batch.sh.j2 +16 -1
  30. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/templates/interactive.sh.j2 +16 -1
  31. hpc_runner-0.3.0/tests/__init__.py +1 -0
  32. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/conftest.py +1 -1
  33. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_core/test_config.py +2 -2
  34. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_schedulers/test_local.py +2 -1
  35. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_schedulers/test_sge.py +66 -0
  36. hpc_runner-0.2.1/SPEC.md +0 -2002
  37. hpc_runner-0.2.1/docs/cli-redesign-spec.md +0 -786
  38. hpc_runner-0.2.1/src/hpc_runner/cli/__init__.py +0 -1
  39. hpc_runner-0.2.1/src/hpc_runner/schedulers/local/templates/job.sh.j2 +0 -28
  40. hpc_runner-0.2.1/tests/__init__.py +0 -1
  41. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/.github/workflows/ci.yml +0 -0
  42. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/.github/workflows/publish.yml +0 -0
  43. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/.gitignore +0 -0
  44. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/docs/HPC_MONITOR_TUI_PLAN.md +0 -0
  45. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/docs/TEXTUAL_STYLING_COOKBOOK.md +0 -0
  46. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/sourceme +0 -0
  47. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/__init__.py +0 -0
  48. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/cancel.py +0 -0
  49. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/monitor.py +0 -0
  50. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/run.py +0 -0
  51. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/cli/status.py +0 -0
  52. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/descriptors.py +0 -0
  53. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/job_array.py +0 -0
  54. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/job_info.py +0 -0
  55. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/resources.py +0 -0
  56. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/core/result.py +0 -0
  57. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/py.typed +0 -0
  58. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/__init__.py +0 -0
  59. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/base.py +0 -0
  60. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/detection.py +0 -0
  61. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/local/__init__.py +0 -0
  62. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/__init__.py +0 -0
  63. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/args.py +0 -0
  64. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/parser.py +0 -0
  65. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/schedulers/sge/scheduler.py +0 -0
  66. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/templates/__init__.py +0 -0
  67. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/templates/engine.py +0 -0
  68. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/__init__.py +0 -0
  69. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/app.py +0 -0
  70. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/components/__init__.py +0 -0
  71. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/components/detail_panel.py +0 -0
  72. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/components/filter_bar.py +0 -0
  73. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/components/filter_popup.py +0 -0
  74. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/components/job_table.py +0 -0
  75. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/providers/__init__.py +0 -0
  76. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/providers/jobs.py +0 -0
  77. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/screens/__init__.py +0 -0
  78. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/screens/confirm.py +0 -0
  79. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/screens/job_details.py +0 -0
  80. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/screens/log_viewer.py +0 -0
  81. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/snapshot.py +0 -0
  82. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/tui/styles/monitor.tcss +0 -0
  83. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/workflow/__init__.py +0 -0
  84. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/workflow/dependency.py +0 -0
  85. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/src/hpc_runner/workflow/pipeline.py +0 -0
  86. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_cli/__init__.py +0 -0
  87. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_cli/test_run.py +0 -0
  88. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_core/__init__.py +0 -0
  89. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_core/test_job.py +0 -0
  90. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_core/test_resources.py +0 -0
  91. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_schedulers/__init__.py +0 -0
  92. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_schedulers/test_detection.py +0 -0
  93. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_tui/__init__.py +0 -0
  94. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_tui/test_app_snapshot.py +0 -0
  95. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_tui/test_detail_panel.py +0 -0
  96. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_tui/test_job_table.py +0 -0
  97. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_workflow/__init__.py +0 -0
  98. {hpc_runner-0.2.1 → hpc_runner-0.3.0}/tests/test_workflow/test_pipeline.py +0 -0
@@ -0,0 +1,56 @@
1
+ name: Docs (GitHub Pages)
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.11"
29
+
30
+ - name: Install dependencies
31
+ run: pip install -e ".[dev]"
32
+
33
+ - name: Build docs
34
+ run: make -C docs html SPHINXOPTS="-W --keep-going"
35
+
36
+ - name: Upload Pages artifact
37
+ if: github.event_name != 'pull_request'
38
+ uses: actions/upload-pages-artifact@v3
39
+ with:
40
+ path: docs/build/html
41
+
42
+ deploy:
43
+ if: github.event_name != 'pull_request'
44
+ needs: build
45
+ runs-on: ubuntu-latest
46
+ permissions:
47
+ pages: write
48
+ id-token: write
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+ steps:
53
+ - name: Deploy to GitHub Pages
54
+ id: deployment
55
+ uses: actions/deploy-pages@v4
56
+
@@ -36,7 +36,7 @@ hpc --scheduler sge run --cpu 4 --mem 8G "python script.py"
36
36
  - **JobResult/ArrayJobResult** - Returned from submission, provides status polling and output access
37
37
  - **JobStatus** - Unified enum: PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, TIMEOUT, UNKNOWN
38
38
  - **ResourceSet** - Collection of named resources (gpu, licenses, etc.)
39
- - **HPCConfig** - TOML-based config with hierarchy: ./hpc-tools.toml > pyproject.toml > git root > ~/.config > package defaults
39
+ - **HPCConfig** - TOML-based config with hierarchy: ./hpc-runner.toml > pyproject.toml > git root > ~/.config > package defaults
40
40
 
41
41
  ### Scheduler System (`src/hpc_runner/schedulers/`)
42
42
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hpc-runner
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Unified HPC job submission across multiple schedulers
5
5
  Project-URL: Homepage, https://github.com/sjalloq/hpc-runner
6
6
  Project-URL: Repository, https://github.com/sjalloq/hpc-runner
@@ -26,19 +26,25 @@ Requires-Dist: textual>=6.11
26
26
  Requires-Dist: tomli>=2.0; python_version < '3.11'
27
27
  Provides-Extra: all
28
28
  Requires-Dist: build; extra == 'all'
29
+ Requires-Dist: furo>=2024.0.0; extra == 'all'
29
30
  Requires-Dist: hatch-vcs; extra == 'all'
30
31
  Requires-Dist: mypy; extra == 'all'
32
+ Requires-Dist: pytest-asyncio; extra == 'all'
31
33
  Requires-Dist: pytest-cov; extra == 'all'
32
34
  Requires-Dist: pytest>=7.0; extra == 'all'
33
35
  Requires-Dist: ruff; extra == 'all'
36
+ Requires-Dist: sphinx>=7.0; extra == 'all'
34
37
  Requires-Dist: twine; extra == 'all'
35
38
  Provides-Extra: dev
36
39
  Requires-Dist: build; extra == 'dev'
40
+ Requires-Dist: furo>=2024.0.0; extra == 'dev'
37
41
  Requires-Dist: hatch-vcs; extra == 'dev'
38
42
  Requires-Dist: mypy; extra == 'dev'
43
+ Requires-Dist: pytest-asyncio; extra == 'dev'
39
44
  Requires-Dist: pytest-cov; extra == 'dev'
40
45
  Requires-Dist: pytest>=7.0; extra == 'dev'
41
46
  Requires-Dist: ruff; extra == 'dev'
47
+ Requires-Dist: sphinx>=7.0; extra == 'dev'
42
48
  Requires-Dist: twine; extra == 'dev'
43
49
  Description-Content-Type: text/markdown
44
50
 
@@ -173,10 +179,10 @@ p.wait()
173
179
  hpc-runner uses TOML configuration files. Location priority:
174
180
 
175
181
  1. `--config /path/to/config.toml`
176
- 2. `./hpc-tools.toml`
177
- 3. `./pyproject.toml` under `[tool.hpc-tools]`
178
- 4. Git repository root `hpc-tools.toml`
179
- 5. `~/.config/hpc-tools/config.toml`
182
+ 2. `./hpc-runner.toml`
183
+ 3. `./pyproject.toml` under `[tool.hpc-runner]`
184
+ 4. Git repository root `hpc-runner.toml`
185
+ 5. `~/.config/hpc-runner/config.toml`
180
186
  6. Package defaults
181
187
 
182
188
  ### Example Configuration
@@ -275,11 +281,6 @@ ruff check src/hpc_runner
275
281
  ruff format src/hpc_runner
276
282
  ```
277
283
 
278
- ## Documentation
279
-
280
- - [Programmatic API Reference](docs/programmatic_api.md)
281
- - [TUI Styling Guide](docs/TEXTUAL_STYLING_COOKBOOK.md)
282
-
283
284
  ## License
284
285
 
285
286
  MIT License - see LICENSE file for details.
@@ -129,10 +129,10 @@ p.wait()
129
129
  hpc-runner uses TOML configuration files. Location priority:
130
130
 
131
131
  1. `--config /path/to/config.toml`
132
- 2. `./hpc-tools.toml`
133
- 3. `./pyproject.toml` under `[tool.hpc-tools]`
134
- 4. Git repository root `hpc-tools.toml`
135
- 5. `~/.config/hpc-tools/config.toml`
132
+ 2. `./hpc-runner.toml`
133
+ 3. `./pyproject.toml` under `[tool.hpc-runner]`
134
+ 4. Git repository root `hpc-runner.toml`
135
+ 5. `~/.config/hpc-runner/config.toml`
136
136
  6. Package defaults
137
137
 
138
138
  ### Example Configuration
@@ -231,11 +231,6 @@ ruff check src/hpc_runner
231
231
  ruff format src/hpc_runner
232
232
  ```
233
233
 
234
- ## Documentation
235
-
236
- - [Programmatic API Reference](docs/programmatic_api.md)
237
- - [TUI Styling Guide](docs/TEXTUAL_STYLING_COOKBOOK.md)
238
-
239
234
  ## License
240
235
 
241
236
  MIT License - see LICENSE file for details.
@@ -1,4 +1,4 @@
1
- # hpc-tools default configuration
1
+ # hpc-runner default configuration
2
2
 
3
3
  [defaults]
4
4
  scheduler = "auto"
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,79 @@
1
+ CLI
2
+ ===
3
+
4
+ The primary entry point is the ``hpc`` command.
5
+
6
+ .. note::
7
+
8
+ This page focuses on the stable “user facing” flags. Any unknown options that
9
+ start with ``-`` are passed through to the underlying scheduler (e.g. SGE
10
+ ``qsub`` flags like ``-q`` and ``-l``).
11
+
12
+
13
+ Global options
14
+ --------------
15
+
16
+ These options come before the subcommand:
17
+
18
+ - ``--config PATH``: use an explicit config file (bypasses discovery)
19
+ - ``--scheduler NAME``: force a scheduler (``sge``, ``slurm``, ``pbs``, ``local``)
20
+ - ``--verbose``: extra debug output
21
+
22
+
23
+ ``hpc run`` (submit)
24
+ --------------------
25
+
26
+ Submit a job to the scheduler.
27
+
28
+ Common options:
29
+
30
+ - ``--job-name TEXT``
31
+ - ``--cpu N``
32
+ - ``--mem TEXT`` (e.g. ``16G``)
33
+ - ``--time TEXT`` (e.g. ``4:00:00``)
34
+ - ``--queue TEXT`` (SGE queue)
35
+ - ``--directory PATH`` (working dir)
36
+ - ``--module TEXT`` (repeatable)
37
+ - ``--job-type TEXT`` (named profile from config)
38
+ - ``--array TEXT`` (e.g. ``1-100``)
39
+ - ``--depend TEXT``
40
+ - ``--interactive`` (SGE: qrsh)
41
+ - ``--dry-run`` (render, don’t submit)
42
+ - ``--wait`` (wait for completion)
43
+ - ``--keep-script`` (debug: keep generated script)
44
+
45
+ Examples:
46
+
47
+ .. code-block:: bash
48
+
49
+ hpc run --cpu 4 --mem 16G --time 2:00:00 "python train.py"
50
+ hpc run --job-type gpu "python train.py"
51
+ hpc run -q gpu.q -l gpu=1 "python train.py" # scheduler passthrough
52
+
53
+
54
+ ``submit`` alias
55
+ ----------------
56
+
57
+ There is also a convenience console script called ``submit`` which behaves like:
58
+
59
+ .. code-block:: bash
60
+
61
+ submit ... == hpc run ...
62
+
63
+ It still supports global flags:
64
+
65
+ .. code-block:: bash
66
+
67
+ submit --config ./hpc-runner.toml --scheduler sge --dry-run "python train.py"
68
+
69
+
70
+ Other commands
71
+ --------------
72
+
73
+ - ``hpc status JOB_ID``: show job status
74
+ - ``hpc cancel JOB_ID``: cancel a job
75
+ - ``hpc monitor``: launch the TUI job monitor
76
+ - ``hpc config show``: print the active config file contents
77
+ - ``hpc config path``: print the active config file path
78
+ - ``hpc config init [--global]``: create a starter config
79
+
@@ -0,0 +1,41 @@
1
+ """Sphinx documentation configuration for hpc-runner."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ # -- Project information -----------------------------------------------------
10
+
11
+ project = "HPC Runner"
12
+ copyright = "2026, Shareef Jalloq"
13
+ author = "Shareef Jalloq"
14
+
15
+ # -- General configuration ---------------------------------------------------
16
+
17
+ # Make package importable for autodoc (src layout)
18
+ REPO_ROOT = Path(__file__).resolve().parents[2]
19
+ sys.path.insert(0, str(REPO_ROOT / "src"))
20
+
21
+ extensions = [
22
+ "sphinx.ext.autodoc",
23
+ "sphinx.ext.napoleon",
24
+ "sphinx.ext.autosectionlabel",
25
+ "sphinx.ext.viewcode",
26
+ ]
27
+
28
+ templates_path = ["_templates"]
29
+ exclude_patterns: list[str] = []
30
+
31
+ # Avoid autosectionlabel collisions across pages
32
+ autosectionlabel_prefix_document = True
33
+
34
+ # Honor SOURCE_DATE_EPOCH when set (reproducible builds)
35
+ if os.environ.get("SOURCE_DATE_EPOCH"):
36
+ today_fmt = "%Y-%m-%d"
37
+
38
+ # -- Options for HTML output -------------------------------------------------
39
+
40
+ html_theme = "furo"
41
+ html_static_path = ["_static"]
@@ -0,0 +1,144 @@
1
+ :orphan:
2
+
3
+ Configuration
4
+ =============
5
+
6
+ This page describes the TOML configuration format used by **hpc-runner** and how
7
+ configuration values map to scheduler flags (with a focus on SGE).
8
+
9
+
10
+ Where configuration is loaded from
11
+ ----------------------------------------
12
+
13
+ Configuration can be provided via a standalone TOML file or embedded inside
14
+ ``pyproject.toml``.
15
+
16
+ Discovery/precedence (highest to lowest):
17
+
18
+ 1. ``./hpc-runner.toml``
19
+ 2. ``./pyproject.toml`` under ``[tool.hpc-runner]``
20
+ 3. ``<git root>/hpc-runner.toml``
21
+ 4. ``~/.config/hpc-runner/config.toml``
22
+ 5. Package defaults
23
+
24
+ You can always bypass discovery by providing ``--config /path/to/file.toml``.
25
+
26
+
27
+ Top-level sections
28
+ ------------------
29
+
30
+ Configuration supports four top-level namespaces:
31
+
32
+ - ``[defaults]``: baseline job settings applied to all jobs
33
+ - ``[tools.<name>]``: overrides keyed by tool name (e.g., ``python``, ``make``)
34
+ - ``[types.<name>]``: named job profiles (e.g., ``gpu``, ``interactive``)
35
+ - ``[schedulers.<name>]``: scheduler-specific behavior (e.g., SGE resource names)
36
+
37
+
38
+ How jobs pick up config
39
+ -----------------------
40
+
41
+ When creating a job from config, hpc-runner merges values in this order:
42
+
43
+ 1. start from ``[defaults]``
44
+ 2. merge either ``[types.<name>]`` **or** ``[tools.<name>]`` (types take precedence)
45
+
46
+ Then CLI options override whatever came from config.
47
+
48
+ .. note::
49
+
50
+ List values use a "merge by union" strategy.
51
+ If you need to *replace* a list instead of merging, use a leading ``"-"`` entry
52
+ to reset it, e.g. ``modules = ["-", "python/3.11"]``.
53
+
54
+
55
+ SGE mapping notes
56
+ -----------------
57
+
58
+ - ``queue`` maps to SGE ``qsub -q <queue>``.
59
+ - ``cpu`` maps to SGE parallel environment slots: ``qsub -pe <parallel_environment> <cpu>``.
60
+ - ``mem`` and ``time`` map to SGE hard resources via ``-l <resource>=<value>``, where the
61
+ resource names are configured under ``[schedulers.sge]``.
62
+
63
+
64
+ Example: fully populated config (standalone file)
65
+ -------------------------------------------------
66
+
67
+ Save as ``hpc-runner.toml`` (or ``~/.config/hpc-runner/config.toml``):
68
+
69
+ .. code-block:: toml
70
+
71
+ [defaults]
72
+ scheduler = "auto" # auto|sge|slurm|pbs|local
73
+ name = "job"
74
+ cpu = 1
75
+ mem = "4G"
76
+ time = "1:00:00"
77
+ queue = "batch.q" # SGE default queue
78
+ priority = 0
79
+ workdir = "."
80
+ shell = "/bin/bash"
81
+ use_cwd = true
82
+ inherit_env = true
83
+
84
+ stdout = "hpc.%N.%J.out"
85
+ stderr = "" # empty means "unset"
86
+
87
+ modules = ["gcc/12.2", "python/3.11"]
88
+ modules_path = []
89
+
90
+ raw_args = []
91
+ sge_args = []
92
+
93
+ resources = [
94
+ { name = "scratch", value = "20G" }
95
+ ]
96
+
97
+ [schedulers.sge]
98
+ parallel_environment = "smp"
99
+ memory_resource = "mem_free"
100
+ time_resource = "h_rt"
101
+
102
+ merge_output = true
103
+ purge_modules = false
104
+ silent_modules = false
105
+ module_init_script = ""
106
+ expand_makeflags = true
107
+ unset_vars = ["https_proxy", "http_proxy"]
108
+
109
+ [tools.python]
110
+ cpu = 4
111
+ mem = "16G"
112
+ time = "4:00:00"
113
+ queue = "short.q"
114
+ modules = ["-", "python/3.11"] # replace list rather than union-merge
115
+ resources = [
116
+ { name = "tmpfs", value = "8G" }
117
+ ]
118
+
119
+ [types.interactive]
120
+ queue = "interactive.q"
121
+ time = "8:00:00"
122
+ cpu = 2
123
+ mem = "8G"
124
+
125
+ [types.gpu]
126
+ queue = "gpu.q"
127
+ cpu = 8
128
+ mem = "64G"
129
+ time = "12:00:00"
130
+ resources = [
131
+ { name = "gpu", value = 1 }
132
+ ]
133
+
134
+
135
+ Embedding in pyproject.toml
136
+ ---------------------------
137
+
138
+ To embed the same config in ``pyproject.toml``, nest the same keys under:
139
+
140
+ .. code-block:: toml
141
+
142
+ [tool.hpc-runner]
143
+ # ... same content as the standalone file ...
144
+
@@ -0,0 +1,78 @@
1
+ Getting Started
2
+ ===============
3
+
4
+ This guide gets you from “installed” to a first successful submission.
5
+
6
+
7
+ Install
8
+ -------
9
+
10
+ In a virtual environment:
11
+
12
+ .. code-block:: bash
13
+
14
+ pip install hpc-runner
15
+
16
+
17
+ Quick start: submit a job
18
+ -------------------------
19
+
20
+ Submit a batch job:
21
+
22
+ .. code-block:: bash
23
+
24
+ hpc run "python -c 'print(\"hello\")'"
25
+
26
+ Show what would be submitted without actually submitting:
27
+
28
+ .. code-block:: bash
29
+
30
+ hpc run --dry-run "python train.py"
31
+
32
+ Run interactively (SGE: ``qrsh``):
33
+
34
+ .. code-block:: bash
35
+
36
+ hpc run --interactive "bash"
37
+
38
+
39
+ Pick a scheduler
40
+ ----------------
41
+
42
+ By default, hpc-runner tries to auto-detect the scheduler. You can force it:
43
+
44
+ .. code-block:: bash
45
+
46
+ hpc --scheduler sge run "python train.py"
47
+
48
+ Or use the environment variable:
49
+
50
+ .. code-block:: bash
51
+
52
+ export HPC_SCHEDULER=sge
53
+
54
+
55
+ First config
56
+ ------------
57
+
58
+ Create a project-local config (safe to commit):
59
+
60
+ .. code-block:: bash
61
+
62
+ hpc config init
63
+
64
+ Create a user config:
65
+
66
+ .. code-block:: bash
67
+
68
+ hpc config init --global
69
+
70
+ Then open the file and set your site defaults, e.g. a default SGE queue:
71
+
72
+ .. code-block:: toml
73
+
74
+ [defaults]
75
+ queue = "batch.q"
76
+
77
+ See :doc:`configuration` for the full configuration format and examples.
78
+
@@ -0,0 +1,19 @@
1
+ HPC Runner
2
+ ==========
3
+
4
+ .. note::
5
+
6
+ **Overview (write your why/what here):**
7
+ Replace this note with your project perspective (motivation, principles,
8
+ and what “good” looks like). The rest of the docs are organized below.
9
+
10
+
11
+ .. toctree::
12
+ :maxdepth: 2
13
+ :caption: Contents:
14
+
15
+ getting_started
16
+ configuration
17
+ cli
18
+ sge
19
+ programmatic_api