xmanager-slurm 0.4.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.

Potentially problematic release.


This version of xmanager-slurm might be problematic. Click here for more details.

Files changed (103) hide show
  1. xmanager_slurm-0.4.0/.devcontainer.json +38 -0
  2. xmanager_slurm-0.4.0/.github/workflows/ci.yml +22 -0
  3. xmanager_slurm-0.4.0/.github/workflows/deploy-docs.yml +55 -0
  4. xmanager_slurm-0.4.0/.gitignore +126 -0
  5. xmanager_slurm-0.4.0/.pre-commit-config.yaml +31 -0
  6. xmanager_slurm-0.4.0/.vscode/settings.json +5 -0
  7. xmanager_slurm-0.4.0/LICENSE.md +227 -0
  8. xmanager_slurm-0.4.0/PKG-INFO +26 -0
  9. xmanager_slurm-0.4.0/README.md +65 -0
  10. xmanager_slurm-0.4.0/docs/api/executables.rst +16 -0
  11. xmanager_slurm-0.4.0/docs/api/executors.rst +15 -0
  12. xmanager_slurm-0.4.0/docs/api/packageables.rst +36 -0
  13. xmanager_slurm-0.4.0/docs/assets/workflow-dark.svg +148 -0
  14. xmanager_slurm-0.4.0/docs/assets/workflow-light.svg +148 -0
  15. xmanager_slurm-0.4.0/docs/conf.py +77 -0
  16. xmanager_slurm-0.4.0/docs/getting-started/xmanager.md +1 -0
  17. xmanager_slurm-0.4.0/docs/guides/index.md +10 -0
  18. xmanager_slurm-0.4.0/docs/guides/remote-dev.md +85 -0
  19. xmanager_slurm-0.4.0/docs/index.md +88 -0
  20. xmanager_slurm-0.4.0/examples/conda/environment.yml +4 -0
  21. xmanager_slurm-0.4.0/examples/conda/launch.py +42 -0
  22. xmanager_slurm-0.4.0/examples/conda/main.py +7 -0
  23. xmanager_slurm-0.4.0/examples/conda/pyproject.toml +5 -0
  24. xmanager_slurm-0.4.0/examples/custom-dockerfile/Dockerfile +3 -0
  25. xmanager_slurm-0.4.0/examples/custom-dockerfile/launch.py +42 -0
  26. xmanager_slurm-0.4.0/examples/custom-dockerfile/pyproject.toml +5 -0
  27. xmanager_slurm-0.4.0/examples/job-array-sweep/launch.py +60 -0
  28. xmanager_slurm-0.4.0/examples/job-array-sweep/main.py +24 -0
  29. xmanager_slurm-0.4.0/examples/job-array-sweep/pyproject.toml +6 -0
  30. xmanager_slurm-0.4.0/examples/job-array-sweep/uv.lock +73 -0
  31. xmanager_slurm-0.4.0/examples/job-group/Dockerfile +3 -0
  32. xmanager_slurm-0.4.0/examples/job-group/launch.py +61 -0
  33. xmanager_slurm-0.4.0/examples/job-group/pyproject.toml +6 -0
  34. xmanager_slurm-0.4.0/examples/job-group/uv.lock +66 -0
  35. xmanager_slurm-0.4.0/examples/metadata/launch.py +61 -0
  36. xmanager_slurm-0.4.0/examples/metadata/main.py +10 -0
  37. xmanager_slurm-0.4.0/examples/metadata/pyproject.toml +6 -0
  38. xmanager_slurm-0.4.0/examples/metadata/requirements.txt +3 -0
  39. xmanager_slurm-0.4.0/examples/parameter-controller/launch.py +111 -0
  40. xmanager_slurm-0.4.0/examples/parameter-controller/main.py +29 -0
  41. xmanager_slurm-0.4.0/examples/parameter-controller/pyproject.toml +6 -0
  42. xmanager_slurm-0.4.0/examples/parameter-controller/requirements.txt +2 -0
  43. xmanager_slurm-0.4.0/examples/pip/launch.py +41 -0
  44. xmanager_slurm-0.4.0/examples/pip/main.py +10 -0
  45. xmanager_slurm-0.4.0/examples/pip/pyproject.toml +5 -0
  46. xmanager_slurm-0.4.0/examples/pip/requirements.txt +1 -0
  47. xmanager_slurm-0.4.0/examples/uv/launch.py +53 -0
  48. xmanager_slurm-0.4.0/examples/uv/pyproject.toml +6 -0
  49. xmanager_slurm-0.4.0/examples/uv/uv.lock +66 -0
  50. xmanager_slurm-0.4.0/pyproject.toml +76 -0
  51. xmanager_slurm-0.4.0/tests/integration/conftest.py +71 -0
  52. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/Dockerfile +47 -0
  53. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/README.md +15 -0
  54. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/cgroup.conf +13 -0
  55. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/docker-compose.yml +71 -0
  56. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/docker-entrypoint.sh +63 -0
  57. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/host_ed25519 +8 -0
  58. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/host_ed25519.pub +1 -0
  59. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/id_ed25519 +7 -0
  60. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/id_ed25519.pub +1 -0
  61. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/slurm.conf +53 -0
  62. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/slurmdbd.conf +20 -0
  63. xmanager_slurm-0.4.0/tests/integration/fixtures/slurm/sshd_config +7 -0
  64. xmanager_slurm-0.4.0/tests/integration/test_remote_execution.py +44 -0
  65. xmanager_slurm-0.4.0/uv.lock +2338 -0
  66. xmanager_slurm-0.4.0/xm_slurm/__init__.py +46 -0
  67. xmanager_slurm-0.4.0/xm_slurm/api.py +528 -0
  68. xmanager_slurm-0.4.0/xm_slurm/batching.py +139 -0
  69. xmanager_slurm-0.4.0/xm_slurm/config.py +207 -0
  70. xmanager_slurm-0.4.0/xm_slurm/console.py +3 -0
  71. xmanager_slurm-0.4.0/xm_slurm/constants.py +15 -0
  72. xmanager_slurm-0.4.0/xm_slurm/contrib/__init__.py +0 -0
  73. xmanager_slurm-0.4.0/xm_slurm/contrib/clusters/__init__.py +61 -0
  74. xmanager_slurm-0.4.0/xm_slurm/contrib/clusters/drac.py +187 -0
  75. xmanager_slurm-0.4.0/xm_slurm/executables.py +213 -0
  76. xmanager_slurm-0.4.0/xm_slurm/execution.py +539 -0
  77. xmanager_slurm-0.4.0/xm_slurm/executors.py +127 -0
  78. xmanager_slurm-0.4.0/xm_slurm/experiment.py +879 -0
  79. xmanager_slurm-0.4.0/xm_slurm/experimental/parameter_controller.py +200 -0
  80. xmanager_slurm-0.4.0/xm_slurm/job_blocks.py +21 -0
  81. xmanager_slurm-0.4.0/xm_slurm/packageables.py +319 -0
  82. xmanager_slurm-0.4.0/xm_slurm/packaging/__init__.py +8 -0
  83. xmanager_slurm-0.4.0/xm_slurm/packaging/docker/__init__.py +69 -0
  84. xmanager_slurm-0.4.0/xm_slurm/packaging/docker/abc.py +112 -0
  85. xmanager_slurm-0.4.0/xm_slurm/packaging/docker/local.py +207 -0
  86. xmanager_slurm-0.4.0/xm_slurm/packaging/registry.py +45 -0
  87. xmanager_slurm-0.4.0/xm_slurm/packaging/router.py +52 -0
  88. xmanager_slurm-0.4.0/xm_slurm/packaging/utils.py +154 -0
  89. xmanager_slurm-0.4.0/xm_slurm/resources.py +174 -0
  90. xmanager_slurm-0.4.0/xm_slurm/scripts/_cloudpickle.py +28 -0
  91. xmanager_slurm-0.4.0/xm_slurm/status.py +197 -0
  92. xmanager_slurm-0.4.0/xm_slurm/templates/docker/docker-bake.hcl.j2 +54 -0
  93. xmanager_slurm-0.4.0/xm_slurm/templates/docker/mamba.Dockerfile +29 -0
  94. xmanager_slurm-0.4.0/xm_slurm/templates/docker/python.Dockerfile +32 -0
  95. xmanager_slurm-0.4.0/xm_slurm/templates/docker/uv.Dockerfile +35 -0
  96. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/fragments/monitor.bash.j2 +32 -0
  97. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/fragments/proxy.bash.j2 +31 -0
  98. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/job-array.bash.j2 +29 -0
  99. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/job-group.bash.j2 +41 -0
  100. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/job.bash.j2 +78 -0
  101. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/runtimes/apptainer.bash.j2 +103 -0
  102. xmanager_slurm-0.4.0/xm_slurm/templates/slurm/runtimes/podman.bash.j2 +56 -0
  103. xmanager_slurm-0.4.0/xm_slurm/utils.py +77 -0
@@ -0,0 +1,38 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3-miniconda
3
+ {
4
+ "name": "xm-slurm",
5
+ "image": "mcr.microsoft.com/vscode/devcontainers/python:3.10",
6
+ "features": {
7
+ "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
8
+ // TODO(jfarebro): add uv feature when available
9
+ "ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
10
+ "ghcr.io/devcontainers-contrib/features/direnv:1": {}
11
+ },
12
+ "remoteEnv": {
13
+ "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
14
+ },
15
+ // docker-from-docker suggests using --init in the run args to clean up zombie processes?
16
+ "runArgs": [
17
+ "--init",
18
+ "--network=host"
19
+ ],
20
+ // Mount the local docker socket to the container
21
+ "mounts": [
22
+ "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind,consistency=cached"
23
+ ],
24
+ "customizations": {
25
+ "vscode": {
26
+ "extensions": [
27
+ "ms-python.python",
28
+ "ms-python.vscode-pylance",
29
+ "charliermarsh.ruff",
30
+ "mkhl.direnv"
31
+ ]
32
+ }
33
+ },
34
+ "postCreateCommand": {
35
+ // TODO(jfarebro): uv sync when available
36
+ "pre-commit": "pre-commit install -t commit-msg --install-hooks"
37
+ }
38
+ }
@@ -0,0 +1,22 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ ci:
10
+ name: Run CI checks
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version-file: 'pyproject.toml'
20
+
21
+ - name: Run pre-commit
22
+ uses: pre-commit/action@v3.0.0
@@ -0,0 +1,55 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ paths:
9
+ - "docs/**"
10
+ - "xm_slurm/**"
11
+ - ".github/workflows/deploy-docs.yml"
12
+
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ concurrency:
19
+ group: "pages"
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ build:
24
+ runs-on: ubuntu-latest
25
+
26
+ steps:
27
+ - uses: actions/checkout@v3
28
+
29
+ - name: Setup uv
30
+ uses: astral-sh/setup-uv@v3
31
+ with:
32
+ version: "latest"
33
+
34
+ - uses: actions/configure-pages@v3
35
+ id: pages
36
+
37
+ - run: uv sync
38
+
39
+ - run: uv run sphinx-build -b html docs docs/_build/html
40
+
41
+ - uses: actions/upload-pages-artifact@v1
42
+ with:
43
+ path: docs/_build/html
44
+
45
+ deploy:
46
+ runs-on: ubuntu-latest
47
+ needs: build
48
+
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+
53
+ steps:
54
+ - uses: actions/deploy-pages@v2
55
+ id: deployment
@@ -0,0 +1,126 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # Celery stuff
86
+ celerybeat-schedule
87
+ celerybeat.pid
88
+
89
+ # SageMath parsed files
90
+ *.sage.py
91
+
92
+ # Environments
93
+ .env
94
+ .venv
95
+ env/
96
+ venv/
97
+ ENV/
98
+ env.bak/
99
+ venv.bak/
100
+
101
+ # Spyder project settings
102
+ .spyderproject
103
+ .spyproject
104
+
105
+ # Rope project settings
106
+ .ropeproject
107
+
108
+ # mkdocs documentation
109
+ /site
110
+
111
+ # mypy
112
+ .mypy_cache/
113
+ .dmypy.json
114
+ dmypy.json
115
+
116
+ # Pyre type checker
117
+ .pyre/
118
+
119
+ # pytype static type analyzer
120
+ .pytype/
121
+
122
+ # Cython debug symbols
123
+ cython_debug/
124
+
125
+ .envrc
126
+ .ruff_cache
@@ -0,0 +1,31 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ - id: check-ast
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-symlinks
10
+ - id: check-executables-have-shebangs
11
+ - id: check-merge-conflict
12
+ - id: check-symlinks
13
+ - id: destroyed-symlinks
14
+ - id: debug-statements
15
+ - id: detect-private-key
16
+ exclude: ^tests/integration/fixtures/slurm/.*
17
+
18
+ # Linting
19
+ - repo: https://github.com/astral-sh/ruff-pre-commit
20
+ # Ruff version.
21
+ rev: "v0.6.9"
22
+ hooks:
23
+ - id: ruff
24
+ - id: ruff-format
25
+
26
+ - repo: https://github.com/astral-sh/uv-pre-commit
27
+ # uv version.
28
+ rev: 0.4.20
29
+ hooks:
30
+ # Update the uv lockfile
31
+ - id: uv-lock
@@ -0,0 +1,5 @@
1
+ {
2
+ "search.exclude": {
3
+ "uv.lock": true,
4
+ },
5
+ }
@@ -0,0 +1,227 @@
1
+ This work is dual-licensed under Apache 2.0 and MIT License attached below.
2
+ You can choose between one of them if you use this work.
3
+
4
+ ---
5
+
6
+ The MIT License (MIT)
7
+ =====================
8
+
9
+ Copyright © `2024` `Jesse Farebrother`
10
+
11
+ Permission is hereby granted, free of charge, to any person
12
+ obtaining a copy of this software and associated documentation
13
+ files (the “Software”), to deal in the Software without
14
+ restriction, including without limitation the rights to use,
15
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the
17
+ Software is furnished to do so, subject to the following
18
+ conditions:
19
+
20
+ The above copyright notice and this permission notice shall be
21
+ included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
24
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30
+ OTHER DEALINGS IN THE SOFTWARE.
31
+
32
+ ---
33
+
34
+ Apache License
35
+ ==============
36
+
37
+ _Version 2.0, January 2004_
38
+ _&lt;<http://www.apache.org/licenses/>&gt;_
39
+
40
+ ### Terms and Conditions for use, reproduction, and distribution
41
+
42
+ #### 1. Definitions
43
+
44
+ “License” shall mean the terms and conditions for use, reproduction, and
45
+ distribution as defined by Sections 1 through 9 of this document.
46
+
47
+ “Licensor” shall mean the copyright owner or entity authorized by the copyright
48
+ owner that is granting the License.
49
+
50
+ “Legal Entity” shall mean the union of the acting entity and all other entities
51
+ that control, are controlled by, or are under common control with that entity.
52
+ For the purposes of this definition, “control” means **(i)** the power, direct or
53
+ indirect, to cause the direction or management of such entity, whether by
54
+ contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
55
+ outstanding shares, or **(iii)** beneficial ownership of such entity.
56
+
57
+ “You” (or “Your”) shall mean an individual or Legal Entity exercising
58
+ permissions granted by this License.
59
+
60
+ “Source” form shall mean the preferred form for making modifications, including
61
+ but not limited to software source code, documentation source, and configuration
62
+ files.
63
+
64
+ “Object” form shall mean any form resulting from mechanical transformation or
65
+ translation of a Source form, including but not limited to compiled object code,
66
+ generated documentation, and conversions to other media types.
67
+
68
+ “Work” shall mean the work of authorship, whether in Source or Object form, made
69
+ available under the License, as indicated by a copyright notice that is included
70
+ in or attached to the work (an example is provided in the Appendix below).
71
+
72
+ “Derivative Works” shall mean any work, whether in Source or Object form, that
73
+ is based on (or derived from) the Work and for which the editorial revisions,
74
+ annotations, elaborations, or other modifications represent, as a whole, an
75
+ original work of authorship. For the purposes of this License, Derivative Works
76
+ shall not include works that remain separable from, or merely link (or bind by
77
+ name) to the interfaces of, the Work and Derivative Works thereof.
78
+
79
+ “Contribution” shall mean any work of authorship, including the original version
80
+ of the Work and any modifications or additions to that Work or Derivative Works
81
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
82
+ by the copyright owner or by an individual or Legal Entity authorized to submit
83
+ on behalf of the copyright owner. For the purposes of this definition,
84
+ “submitted” means any form of electronic, verbal, or written communication sent
85
+ to the Licensor or its representatives, including but not limited to
86
+ communication on electronic mailing lists, source code control systems, and
87
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
88
+ the purpose of discussing and improving the Work, but excluding communication
89
+ that is conspicuously marked or otherwise designated in writing by the copyright
90
+ owner as “Not a Contribution.”
91
+
92
+ “Contributor” shall mean Licensor and any individual or Legal Entity on behalf
93
+ of whom a Contribution has been received by Licensor and subsequently
94
+ incorporated within the Work.
95
+
96
+ #### 2. Grant of Copyright License
97
+
98
+ Subject to the terms and conditions of this License, each Contributor hereby
99
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
100
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
101
+ publicly display, publicly perform, sublicense, and distribute the Work and such
102
+ Derivative Works in Source or Object form.
103
+
104
+ #### 3. Grant of Patent License
105
+
106
+ Subject to the terms and conditions of this License, each Contributor hereby
107
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
108
+ irrevocable (except as stated in this section) patent license to make, have
109
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
110
+ such license applies only to those patent claims licensable by such Contributor
111
+ that are necessarily infringed by their Contribution(s) alone or by combination
112
+ of their Contribution(s) with the Work to which such Contribution(s) was
113
+ submitted. If You institute patent litigation against any entity (including a
114
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
115
+ Contribution incorporated within the Work constitutes direct or contributory
116
+ patent infringement, then any patent licenses granted to You under this License
117
+ for that Work shall terminate as of the date such litigation is filed.
118
+
119
+ #### 4. Redistribution
120
+
121
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
122
+ in any medium, with or without modifications, and in Source or Object form,
123
+ provided that You meet the following conditions:
124
+
125
+ * **(a)** You must give any other recipients of the Work or Derivative Works a copy of
126
+ this License; and
127
+ * **(b)** You must cause any modified files to carry prominent notices stating that You
128
+ changed the files; and
129
+ * **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
130
+ all copyright, patent, trademark, and attribution notices from the Source form
131
+ of the Work, excluding those notices that do not pertain to any part of the
132
+ Derivative Works; and
133
+ * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
134
+ Derivative Works that You distribute must include a readable copy of the
135
+ attribution notices contained within such NOTICE file, excluding those notices
136
+ that do not pertain to any part of the Derivative Works, in at least one of the
137
+ following places: within a NOTICE text file distributed as part of the
138
+ Derivative Works; within the Source form or documentation, if provided along
139
+ with the Derivative Works; or, within a display generated by the Derivative
140
+ Works, if and wherever such third-party notices normally appear. The contents of
141
+ the NOTICE file are for informational purposes only and do not modify the
142
+ License. You may add Your own attribution notices within Derivative Works that
143
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
144
+ provided that such additional attribution notices cannot be construed as
145
+ modifying the License.
146
+
147
+ You may add Your own copyright statement to Your modifications and may provide
148
+ additional or different license terms and conditions for use, reproduction, or
149
+ distribution of Your modifications, or for any such Derivative Works as a whole,
150
+ provided Your use, reproduction, and distribution of the Work otherwise complies
151
+ with the conditions stated in this License.
152
+
153
+ #### 5. Submission of Contributions
154
+
155
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
156
+ for inclusion in the Work by You to the Licensor shall be under the terms and
157
+ conditions of this License, without any additional terms or conditions.
158
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
159
+ any separate license agreement you may have executed with Licensor regarding
160
+ such Contributions.
161
+
162
+ #### 6. Trademarks
163
+
164
+ This License does not grant permission to use the trade names, trademarks,
165
+ service marks, or product names of the Licensor, except as required for
166
+ reasonable and customary use in describing the origin of the Work and
167
+ reproducing the content of the NOTICE file.
168
+
169
+ #### 7. Disclaimer of Warranty
170
+
171
+ Unless required by applicable law or agreed to in writing, Licensor provides the
172
+ Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
173
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
174
+ including, without limitation, any warranties or conditions of TITLE,
175
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
176
+ solely responsible for determining the appropriateness of using or
177
+ redistributing the Work and assume any risks associated with Your exercise of
178
+ permissions under this License.
179
+
180
+ #### 8. Limitation of Liability
181
+
182
+ In no event and under no legal theory, whether in tort (including negligence),
183
+ contract, or otherwise, unless required by applicable law (such as deliberate
184
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
185
+ liable to You for damages, including any direct, indirect, special, incidental,
186
+ or consequential damages of any character arising as a result of this License or
187
+ out of the use or inability to use the Work (including but not limited to
188
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
189
+ any and all other commercial damages or losses), even if such Contributor has
190
+ been advised of the possibility of such damages.
191
+
192
+ #### 9. Accepting Warranty or Additional Liability
193
+
194
+ While redistributing the Work or Derivative Works thereof, You may choose to
195
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
196
+ other liability obligations and/or rights consistent with this License. However,
197
+ in accepting such obligations, You may act only on Your own behalf and on Your
198
+ sole responsibility, not on behalf of any other Contributor, and only if You
199
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
200
+ incurred by, or claims asserted against, such Contributor by reason of your
201
+ accepting any such warranty or additional liability.
202
+
203
+ _END OF TERMS AND CONDITIONS_
204
+
205
+ ### APPENDIX: How to apply the Apache License to your work
206
+
207
+ To apply the Apache License to your work, attach the following boilerplate
208
+ notice, with the fields enclosed by brackets `[]` replaced with your own
209
+ identifying information. (Don't include the brackets!) The text should be
210
+ enclosed in the appropriate comment syntax for the file format. We also
211
+ recommend that a file or class name and description of purpose be included on
212
+ the same “printed page” as the copyright notice for easier identification within
213
+ third-party archives.
214
+
215
+ Copyright [yyyy] [name of copyright owner]
216
+
217
+ Licensed under the Apache License, Version 2.0 (the "License");
218
+ you may not use this file except in compliance with the License.
219
+ You may obtain a copy of the License at
220
+
221
+ http://www.apache.org/licenses/LICENSE-2.0
222
+
223
+ Unless required by applicable law or agreed to in writing, software
224
+ distributed under the License is distributed on an "AS IS" BASIS,
225
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226
+ See the License for the specific language governing permissions and
227
+ limitations under the License.
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.3
2
+ Name: xmanager-slurm
3
+ Version: 0.4.0
4
+ Summary: Slurm backend for XManager.
5
+ Project-URL: GitHub, https://github.com/jessefarebro/xm-slurm
6
+ Author-email: Jesse Farebrother <jfarebro@cs.mcgill.ca>
7
+ License: MIT
8
+ License-File: LICENSE.md
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: asyncssh>=2.13.2
18
+ Requires-Dist: backoff>=2.2.1
19
+ Requires-Dist: cloudpickle>=3.0.0
20
+ Requires-Dist: humanize>=4.8.0
21
+ Requires-Dist: immutabledict>=3.0.0
22
+ Requires-Dist: jinja2>=3.1.2
23
+ Requires-Dist: more-itertools>=10.2.0
24
+ Requires-Dist: rich>=13.5.2
25
+ Requires-Dist: toml>=0.10.2
26
+ Requires-Dist: xmanager>=0.5.0
@@ -0,0 +1,65 @@
1
+ # 👨‍🔬 XManager Slurm
2
+
3
+ <p align="center">
4
+ <em><a href="https://jessefarebro.github.io/xm-slurm">Documentation</a></em>
5
+ &nbsp;&nbsp;&bull;&nbsp;&nbsp;
6
+ <em><code>pip install xmanager-slurm</code></em>
7
+ </p>
8
+
9
+ <!--
10
+ Badges
11
+ <p align="center">
12
+ <img alt="build" src="https://github.com/jessefarebro/xm-slurm/actions/workflows/build.yml/badge.svg" />
13
+ <img alt="mypy" src="https://github.com/jessefarebro/xm-slurm/actions/workflows/mypy.yml/badge.svg" />
14
+ <img alt="pyright" src="https://github.com/jessefarebro/xm-slurm/actions/workflows/pyright.yml/badge.svg" />
15
+ <img alt="ruff" src="https://github.com/jessefarebro/xm-slurm/actions/workflows/ruff.yml/badge.svg" />
16
+ <a href="https://codecov.io/gh/jessefarebro/xm-slurm">
17
+ <img alt="codecov" src="https://codecov.io/gh/jessefarebro/xm-slurm/branch/main/graph/badge.svg" />
18
+ </a>
19
+ <a href="https://pypi.org/project/xmanager-slurm/">
20
+ <img alt="codecov" src="https://img.shields.io/pypi/pyversions/xmanager-slurm" />
21
+ </a>
22
+ </p>
23
+ -->
24
+
25
+ This project implements Slurm support for the XManager experiment launcher.
26
+ The aim is to support a general workflow for idempotent launching of experiments to many Slurm clusters
27
+ through the use of containerization.
28
+ This can provide the following benefits which eliminates various sharp edges of using Slurm for both new and experienced users alike:
29
+
30
+ 1. All development can be done locally and launched on any Slurm cluster without ever interacting with the cluster.
31
+ 2. Reproducible experiments (e.g., containerized runtime, code checkpointing, etc.)
32
+ 3. Launch scripts are written in __Python__ which makes it easy to perform complex launch configurations like distributed training or job orchestration.
33
+ 4. Full control over resource scheduling, choose the cluster that meets your requirements and will schedule your job the fastest.
34
+
35
+ The following diagram illustrates the general workflow achieved by using XManager Slurm.
36
+
37
+
38
+ <picture>
39
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/workflow-dark.svg">
40
+ <source media="(prefers-color-scheme: light)" srcset="docs/assets/workflow-light.svg">
41
+ <img alt="XManager workflow with the Slurm executor." src="docs/assets/workflow-light.svg">
42
+ </picture>
43
+
44
+ ## Alternatives
45
+
46
+ This project was spawned from what I perceived as a lack of unoppiniated infrastructure for scheduling jobs.
47
+ Contrasting with the most popular libraries here's what XManager + Slurm provides:
48
+
49
+ * [submitit](https://github.com/facebookincubator/submitit): The submitit plugin is quite popular alongside of the [Hydra](https://hydra.cc/) configuration library. Although these work well in conjunction this might not meet your requirements if and you may consider XMangaer + Slurm if:
50
+ * You don't want to use Hydra.
51
+ * You have more complex needs for sweeps beyond the most common usecases of taking the caretesian product amongst a grid of parameters.
52
+ * You want to schedule jobs on multiple clusters without having to re-configure your development environment.
53
+ * You want better control over resource scheduling beyond what Slurm can provide.
54
+ * You want more control over launch configurations / parameter sweeps by being able to write them in Python.
55
+ * You require launch configurations that go beyond simple single job configurations, e.g., job orchestration, distributed training, etc.
56
+
57
+ ## License
58
+
59
+ This work is dual-licensed under Apache 2.0 and MIT License.
60
+ You can choose between one of them if you use this work.
61
+ See [LICENSE.md](./LICENSE.md) for more information.
62
+
63
+ ## Disclaimer
64
+
65
+ This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.
@@ -0,0 +1,16 @@
1
+ Executables
2
+ ===================
3
+
4
+ .. currentmodule:: xm_slurm
5
+
6
+ .. autosummary::
7
+
8
+ Dockerfile
9
+ DockerImage
10
+
11
+ Docker
12
+ ~~~~~~
13
+
14
+ .. autoclass:: Dockerfile
15
+
16
+ .. autoclass:: DockerImage
@@ -0,0 +1,15 @@
1
+ Executors
2
+ ===================
3
+
4
+ .. currentmodule:: xm_slurm
5
+
6
+ .. autosummary::
7
+
8
+ Slurm
9
+
10
+ Slurm
11
+ ~~~~~
12
+
13
+ .. autoclass:: SlurmSpec
14
+
15
+ .. autoclass:: Slurm
@@ -0,0 +1,36 @@
1
+ Packageables
2
+ ===================
3
+
4
+ .. currentmodule:: xm_slurm
5
+
6
+ .. autosummary::
7
+
8
+ docker_image
9
+ docker_container
10
+ uv_container
11
+ python_container
12
+ conda_container
13
+ mamba_container
14
+
15
+
16
+
17
+ Docker
18
+ ~~~~~~
19
+
20
+ .. autofunction:: docker_image
21
+
22
+ .. autofunction:: docker_container
23
+
24
+
25
+ Python
26
+ ~~~~~~
27
+
28
+ .. autofunction:: uv_container
29
+
30
+ .. autofunction:: python_container
31
+
32
+
33
+ Conda
34
+ ~~~~~~~~~~~~~
35
+
36
+ .. autofunction:: mamba_container