xmanager-slurm 0.4.10__py3-none-any.whl → 0.4.12__py3-none-any.whl
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.
- xm_slurm/api/sqlite/client.py +1 -1
- xm_slurm/config.py +8 -3
- xm_slurm/packageables.py +14 -15
- xm_slurm/resources.py +4 -3
- xm_slurm/scripts/cli.py +7 -1
- {xmanager_slurm-0.4.10.dist-info → xmanager_slurm-0.4.12.dist-info}/METADATA +1 -2
- {xmanager_slurm-0.4.10.dist-info → xmanager_slurm-0.4.12.dist-info}/RECORD +10 -10
- {xmanager_slurm-0.4.10.dist-info → xmanager_slurm-0.4.12.dist-info}/WHEEL +0 -0
- {xmanager_slurm-0.4.10.dist-info → xmanager_slurm-0.4.12.dist-info}/entry_points.txt +0 -0
- {xmanager_slurm-0.4.10.dist-info → xmanager_slurm-0.4.12.dist-info}/licenses/LICENSE.md +0 -0
xm_slurm/api/sqlite/client.py
CHANGED
|
@@ -153,7 +153,7 @@ class XManagerSqliteAPI(XManagerAPI):
|
|
|
153
153
|
artifacts = [
|
|
154
154
|
models.Artifact(name=artifact.name, uri=artifact.uri)
|
|
155
155
|
for artifact in experiment.artifacts
|
|
156
|
-
]
|
|
156
|
+
]
|
|
157
157
|
|
|
158
158
|
return models.Experiment(
|
|
159
159
|
title=experiment.title,
|
xm_slurm/config.py
CHANGED
|
@@ -62,9 +62,14 @@ class SlurmSSHConfig:
|
|
|
62
62
|
if self.host_public_key is None:
|
|
63
63
|
return None
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
hostname = f"{self.host}"
|
|
66
|
+
if self.port is not None and self.port != asyncssh.DEFAULT_PORT:
|
|
67
|
+
hostname = f"[{hostname}]:{self.port}"
|
|
68
|
+
|
|
69
|
+
known_hosts = asyncssh.import_known_hosts(
|
|
70
|
+
f"{hostname} {self.host_public_key.algorithm} {self.host_public_key.key}"
|
|
67
71
|
)
|
|
72
|
+
return known_hosts
|
|
68
73
|
|
|
69
74
|
@functools.cached_property
|
|
70
75
|
def config(self) -> asyncssh.config.SSHConfig:
|
|
@@ -117,9 +122,9 @@ class SlurmSSHConfig:
|
|
|
117
122
|
def connection_options(self) -> asyncssh.SSHClientConnectionOptions:
|
|
118
123
|
options = asyncssh.SSHClientConnectionOptions(
|
|
119
124
|
config=None,
|
|
120
|
-
kbdint_auth=False,
|
|
121
125
|
disable_trivial_auth=True,
|
|
122
126
|
known_hosts=self.known_hosts,
|
|
127
|
+
server_host_key_algs=self.host_public_key.algorithm if self.host_public_key else None,
|
|
123
128
|
)
|
|
124
129
|
options.prepare(last_config=self.config)
|
|
125
130
|
return options
|
xm_slurm/packageables.py
CHANGED
|
@@ -3,7 +3,6 @@ import pathlib
|
|
|
3
3
|
import sys
|
|
4
4
|
from typing import Literal, Mapping, Sequence
|
|
5
5
|
|
|
6
|
-
import immutabledict
|
|
7
6
|
from xmanager import xm
|
|
8
7
|
|
|
9
8
|
from xm_slurm import job_blocks, utils
|
|
@@ -15,7 +14,7 @@ def docker_image(
|
|
|
15
14
|
*,
|
|
16
15
|
image: str,
|
|
17
16
|
args: xm.UserArgs | None = None,
|
|
18
|
-
env_vars: Mapping[str, str] =
|
|
17
|
+
env_vars: Mapping[str, str] | None = None,
|
|
19
18
|
) -> xm.Packageable:
|
|
20
19
|
"""Creates a packageable for a pre-built Docker image.
|
|
21
20
|
|
|
@@ -30,7 +29,7 @@ def docker_image(
|
|
|
30
29
|
executor_spec=SlurmSpec(),
|
|
31
30
|
executable_spec=DockerImage(image=image),
|
|
32
31
|
args=xm.SequentialArgs.from_collection(args),
|
|
33
|
-
env_vars=
|
|
32
|
+
env_vars=env_vars or {},
|
|
34
33
|
)
|
|
35
34
|
|
|
36
35
|
|
|
@@ -41,11 +40,11 @@ def docker_container(
|
|
|
41
40
|
context: pathlib.Path | None = None,
|
|
42
41
|
target: str | None = None,
|
|
43
42
|
ssh: Sequence[str] | Literal[True] | None = None,
|
|
44
|
-
build_args: Mapping[str, str] =
|
|
43
|
+
build_args: Mapping[str, str] | None = None,
|
|
45
44
|
cache_from: str | Sequence[str] | None = None,
|
|
46
|
-
labels: Mapping[str, str] =
|
|
45
|
+
labels: Mapping[str, str] | None = None,
|
|
47
46
|
args: xm.UserArgs | None = None,
|
|
48
|
-
env_vars: Mapping[str, str] =
|
|
47
|
+
env_vars: Mapping[str, str] | None = None,
|
|
49
48
|
) -> xm.Packageable:
|
|
50
49
|
"""Creates a Docker container packageable from a dockerfile.
|
|
51
50
|
|
|
@@ -89,12 +88,12 @@ def docker_container(
|
|
|
89
88
|
context=context,
|
|
90
89
|
target=target,
|
|
91
90
|
ssh=ssh,
|
|
92
|
-
build_args=build_args,
|
|
91
|
+
build_args=build_args or {},
|
|
93
92
|
cache_from=cache_from,
|
|
94
|
-
labels=labels,
|
|
93
|
+
labels=labels or {},
|
|
95
94
|
),
|
|
96
95
|
args=xm.SequentialArgs.from_collection(args),
|
|
97
|
-
env_vars=
|
|
96
|
+
env_vars=env_vars or {},
|
|
98
97
|
)
|
|
99
98
|
|
|
100
99
|
|
|
@@ -108,10 +107,10 @@ def python_container(
|
|
|
108
107
|
extra_system_packages: Sequence[str] = (),
|
|
109
108
|
extra_python_packages: Sequence[str] = (),
|
|
110
109
|
cache_from: str | Sequence[str] | None = None,
|
|
111
|
-
labels: Mapping[str, str] =
|
|
110
|
+
labels: Mapping[str, str] | None = None,
|
|
112
111
|
ssh: Sequence[str] | Literal[True] | None = None,
|
|
113
112
|
args: xm.UserArgs | None = None,
|
|
114
|
-
env_vars: Mapping[str, str] =
|
|
113
|
+
env_vars: Mapping[str, str] | None = None,
|
|
115
114
|
) -> xm.Packageable:
|
|
116
115
|
"""Creates a Python container from a base image using pip from a `requirements.txt` file.
|
|
117
116
|
|
|
@@ -183,10 +182,10 @@ def mamba_container(
|
|
|
183
182
|
environment: pathlib.Path | None = None,
|
|
184
183
|
base_image: str = "gcr.io/distroless/base-debian10",
|
|
185
184
|
cache_from: str | Sequence[str] | None = None,
|
|
186
|
-
labels: Mapping[str, str] =
|
|
185
|
+
labels: Mapping[str, str] | None = None,
|
|
187
186
|
ssh: Sequence[str] | Literal[True] | None = None,
|
|
188
187
|
args: xm.UserArgs | None = None,
|
|
189
|
-
env_vars: Mapping[str, str] =
|
|
188
|
+
env_vars: Mapping[str, str] | None = None,
|
|
190
189
|
) -> xm.Packageable:
|
|
191
190
|
"""Creates a Conda container from a base image using mamba from a `environment.yml` file.
|
|
192
191
|
|
|
@@ -253,10 +252,10 @@ def uv_container(
|
|
|
253
252
|
extra_system_packages: Sequence[str] = (),
|
|
254
253
|
extra_python_packages: Sequence[str] = (),
|
|
255
254
|
cache_from: str | Sequence[str] | None = None,
|
|
256
|
-
labels: Mapping[str, str] =
|
|
255
|
+
labels: Mapping[str, str] | None = None,
|
|
257
256
|
ssh: Sequence[str] | Literal[True] | None = None,
|
|
258
257
|
args: xm.UserArgs | None = None,
|
|
259
|
-
env_vars: Mapping[str, str] =
|
|
258
|
+
env_vars: Mapping[str, str] | None = None,
|
|
260
259
|
) -> xm.Packageable:
|
|
261
260
|
"""Creates a Python container from a base image using uv from a `uv.lock` file.
|
|
262
261
|
|
xm_slurm/resources.py
CHANGED
|
@@ -3,8 +3,6 @@ import itertools
|
|
|
3
3
|
import math
|
|
4
4
|
from typing import Mapping
|
|
5
5
|
|
|
6
|
-
import immutabledict
|
|
7
|
-
|
|
8
6
|
from xm_slurm import config
|
|
9
7
|
|
|
10
8
|
|
|
@@ -76,7 +74,7 @@ class JobRequirements:
|
|
|
76
74
|
def __init__(
|
|
77
75
|
self,
|
|
78
76
|
*,
|
|
79
|
-
resources: Mapping[ResourceType | str, ResourceQuantity] =
|
|
77
|
+
resources: Mapping[ResourceType | str, ResourceQuantity] | None = None,
|
|
80
78
|
replicas: int = 1,
|
|
81
79
|
location: str | None = None,
|
|
82
80
|
cluster: config.SlurmClusterConfig | None = None,
|
|
@@ -87,6 +85,9 @@ class JobRequirements:
|
|
|
87
85
|
self.accelerator = None
|
|
88
86
|
self.cluster = cluster
|
|
89
87
|
|
|
88
|
+
if resources is None:
|
|
89
|
+
resources = {}
|
|
90
|
+
|
|
90
91
|
self.task_requirements: dict[ResourceType | str, ResourceQuantity] = {}
|
|
91
92
|
for resource_name, value in itertools.chain(resources.items(), kw_resources.items()):
|
|
92
93
|
match resource_name:
|
xm_slurm/scripts/cli.py
CHANGED
|
@@ -19,7 +19,13 @@ async def logs(
|
|
|
19
19
|
xp = xm_slurm.get_experiment(experiment_id)
|
|
20
20
|
|
|
21
21
|
if wid is not None:
|
|
22
|
-
|
|
22
|
+
wus = xp.work_units()
|
|
23
|
+
if wid not in wus:
|
|
24
|
+
console.print(
|
|
25
|
+
f"[red]Work Unit ID {wid} not found for experiment {experiment_id} with {len(wus)} work units.[/red]"
|
|
26
|
+
)
|
|
27
|
+
sys.exit(1)
|
|
28
|
+
wu = wus[wid]
|
|
23
29
|
elif identity is not None:
|
|
24
30
|
wu = xp._get_work_unit_by_identity(identity)
|
|
25
31
|
if wu is None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xmanager-slurm
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.12
|
|
4
4
|
Summary: Slurm backend for XManager.
|
|
5
5
|
Project-URL: GitHub, https://github.com/jessefarebro/xm-slurm
|
|
6
6
|
Author-email: Jesse Farebrother <jfarebro@cs.mcgill.ca>
|
|
@@ -20,7 +20,6 @@ Requires-Dist: backoff>=2.2.1
|
|
|
20
20
|
Requires-Dist: cloudpickle>=3.0.0
|
|
21
21
|
Requires-Dist: httpx>=0.28.1
|
|
22
22
|
Requires-Dist: humanize>=4.8.0
|
|
23
|
-
Requires-Dist: immutabledict>=3.0.0
|
|
24
23
|
Requires-Dist: jinja2>=3.1.2
|
|
25
24
|
Requires-Dist: more-itertools>=10.2.0
|
|
26
25
|
Requires-Dist: rich>=13.5.2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
xm_slurm/__init__.py,sha256=WgRn9HDYa5H3sfIH-HZu33liBOh98jM4GqcR349RaSY,1086
|
|
2
2
|
xm_slurm/batching.py,sha256=GbKBsNz9w8gIc2fHLZpslC0e4K9YUfLXFHmjduRRCfQ,4385
|
|
3
|
-
xm_slurm/config.py,sha256=
|
|
3
|
+
xm_slurm/config.py,sha256=i9WuxjfGBgVoHHDNk3BvO7LCwpBTJeRnOiFvTU-FHrk,7330
|
|
4
4
|
xm_slurm/console.py,sha256=UpMqeJ0C8i0pkue1AHnnyyX0bFJ9zZeJ7HBR6yhuA8A,54
|
|
5
5
|
xm_slurm/constants.py,sha256=zefVtlFdflgSolie5g_rVxWV-Zpydxapchm3y0a2FDc,999
|
|
6
6
|
xm_slurm/dependencies.py,sha256=-5gN_tpfs3dOA7H5_MIHO2ratb7F5Pm_yjkR5rZcgI8,6421
|
|
@@ -11,15 +11,15 @@ xm_slurm/experiment.py,sha256=94r0mhtUPUzw4eaUEz0kpsufC25wEGqlDhV4Fcr1ukY,39883
|
|
|
11
11
|
xm_slurm/filesystem.py,sha256=4rKtq3t-KDgxJbSGt6JVyRJT_3lCN_vIKTcwKHpTo3I,4389
|
|
12
12
|
xm_slurm/job_blocks.py,sha256=_F8CKCs5BQFj40a2-mjG71HfacvWoBXBDPDKEaKTbXc,616
|
|
13
13
|
xm_slurm/metadata_context.py,sha256=mksVRbVUuistL1uE7TC-fkW-Y69On52jN_svP1e1kiQ,7841
|
|
14
|
-
xm_slurm/packageables.py,sha256=
|
|
15
|
-
xm_slurm/resources.py,sha256=
|
|
14
|
+
xm_slurm/packageables.py,sha256=K6vNhLvASdnqsc8vXlT3h9cObJpC9Rbw93pUBvBwapQ,12209
|
|
15
|
+
xm_slurm/resources.py,sha256=T7uje3E6oWbZSrsxykgW-40DE-Bvw_NWDM2qXbw2rgI,5740
|
|
16
16
|
xm_slurm/status.py,sha256=WTWiDHi-ZHtwHRnDP0cGa-27zTSm6LkA-GCKsN-zBgg,6916
|
|
17
17
|
xm_slurm/types.py,sha256=TsVykDm-LazVkrjeJrTwCMs4Q8APKhy7BTk0yKIhFNg,805
|
|
18
18
|
xm_slurm/utils.py,sha256=xtFvktaxr0z65sTdu6HhOVfyo0OAB9t-EYXWcYrQQEU,5958
|
|
19
19
|
xm_slurm/api/__init__.py,sha256=cyao3LZ3uLftu1wIv1aN7Qvsl6gYzYpkxeehTHZ0fA8,1089
|
|
20
20
|
xm_slurm/api/abc.py,sha256=-lS2OndnOuEiwNdr8ccQKkwMd1iDmKMmkBOSTvo5H5w,1816
|
|
21
21
|
xm_slurm/api/models.py,sha256=_INVh0j-4-rRs0WASyg4fNB6NF1L1nUeGgQ6-XnbwsM,1610
|
|
22
|
-
xm_slurm/api/sqlite/client.py,sha256=
|
|
22
|
+
xm_slurm/api/sqlite/client.py,sha256=jAesCKDuYwnNcAxwJk_1b1TB8cT_QGbSjo1UE3mZjEQ,14037
|
|
23
23
|
xm_slurm/api/web/client.py,sha256=uO67Y7fnQ-w__Vm_A5BEuy7Qi8wQcWk3vIsBGEBkyfk,6261
|
|
24
24
|
xm_slurm/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
xm_slurm/contrib/clusters/__init__.py,sha256=XFCVnkThiU3_8uA_tUgDByOBanXNHrxDvfmuptmQ2KE,2214
|
|
@@ -31,7 +31,7 @@ xm_slurm/packaging/registry.py,sha256=GrdmQg9MgSo38OiqOzMKWSkQyBuyryOfc3zcdgZ4CU
|
|
|
31
31
|
xm_slurm/packaging/router.py,sha256=yPbdA9clrhly97cLgDsSRZG2LZRKE-oz8Hhdb7WtYqk,2070
|
|
32
32
|
xm_slurm/packaging/utils.py,sha256=6EAb17zKQQeuyNY2EV9AoW1RvnDGrQwmIT9wtQEsC4c,632
|
|
33
33
|
xm_slurm/scripts/_cloudpickle.py,sha256=dlJYf2SceOuUn8wi-ozuoYAQg71wqD2MUVOUCyOwWIY,647
|
|
34
|
-
xm_slurm/scripts/cli.py,sha256=
|
|
34
|
+
xm_slurm/scripts/cli.py,sha256=zzsQpvkx9VThAeQPM34iDK9wAWfCVCIIvLNI12UaMhw,2577
|
|
35
35
|
xm_slurm/templates/docker/docker-bake.hcl.j2,sha256=7qSJl2VN5poz-Hh8Gjo7--qR-k3lmfGtBu2mNbfG2uA,1499
|
|
36
36
|
xm_slurm/templates/docker/mamba.Dockerfile,sha256=Sgxr5IA5T-pT1Shumb5k3JngoG4pgCdBXjzqslFJdZI,753
|
|
37
37
|
xm_slurm/templates/docker/python.Dockerfile,sha256=U4b4QVkopckQ0o9jJIE7d_M6TvExEYlYDirNwCoZ7W4,865
|
|
@@ -44,8 +44,8 @@ xm_slurm/templates/slurm/fragments/monitor.bash.j2,sha256=BJ1brSjhESOe9VX_OYaPyy
|
|
|
44
44
|
xm_slurm/templates/slurm/fragments/proxy.bash.j2,sha256=VJLglZo-Nvx9R-qe3rHTxr07CylTQ6Z9NwBzvIpAZrA,814
|
|
45
45
|
xm_slurm/templates/slurm/runtimes/apptainer.bash.j2,sha256=lE2EWVCK2O-n08RL4_MJYIikVTvODjcYKuv7Eh73Q2w,1932
|
|
46
46
|
xm_slurm/templates/slurm/runtimes/podman.bash.j2,sha256=3j7K5eyXt_WhXK0EoMlxnhlmFVJ2JyxRKbsMRaDqzSs,1148
|
|
47
|
-
xmanager_slurm-0.4.
|
|
48
|
-
xmanager_slurm-0.4.
|
|
49
|
-
xmanager_slurm-0.4.
|
|
50
|
-
xmanager_slurm-0.4.
|
|
51
|
-
xmanager_slurm-0.4.
|
|
47
|
+
xmanager_slurm-0.4.12.dist-info/METADATA,sha256=ttPSMz6bQs8BEQVCurQ9lFWV7MuzLOHWU7lISOOoufA,1007
|
|
48
|
+
xmanager_slurm-0.4.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
49
|
+
xmanager_slurm-0.4.12.dist-info/entry_points.txt,sha256=_HLGmLgxuQLOPmF2gOFYDVq2HqtMVD_SzigHvUh8TCY,49
|
|
50
|
+
xmanager_slurm-0.4.12.dist-info/licenses/LICENSE.md,sha256=IxstXr3MPHwTJ5jMrByHrQsR1ZAGQ2U_uz_4qzI_15Y,11756
|
|
51
|
+
xmanager_slurm-0.4.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|