xmanager-slurm 0.4.6__py3-none-any.whl → 0.4.7__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/execution.py CHANGED
@@ -237,8 +237,8 @@ class SlurmHandle(_BatchedSlurmHandle, tp.Generic[SlurmJobT]):
237
237
  async def logs(
238
238
  self, *, num_lines: int, block_size: int, wait: bool, follow: bool
239
239
  ) -> tp.AsyncGenerator[ConsoleRenderable, None]:
240
- statedir = await get_client()._state_dir(self.ssh)
241
- file = statedir / f"{self.experiment_id}/slurm-{self.slurm_job.job_id}.out"
240
+ experiment_dir = await get_client().experiment_dir(self.ssh, self.experiment_id)
241
+ file = experiment_dir / f"slurm-{self.slurm_job.job_id}.out"
242
242
 
243
243
  fs = await get_client().fs(self.ssh)
244
244
 
@@ -455,9 +455,26 @@ class SlurmExecutionClient:
455
455
 
456
456
  @functools.cache
457
457
  async def _state_dir(self, ssh_config: SlurmSSHConfig) -> pathlib.Path:
458
- cmd = await self.run(ssh_config, "printenv HOME", check=True)
459
- assert isinstance(cmd.stdout, str)
460
- return pathlib.Path(cmd.stdout.strip()) / ".local" / "state" / "xm-slurm"
458
+ state_dirs = [
459
+ ("XM_SLURM_STATE_DIR", ""),
460
+ ("XDG_STATE_HOME", "xm-slurm"),
461
+ ("HOME", ".local/state/xm-slurm"),
462
+ ]
463
+
464
+ for env_var, subpath in state_dirs:
465
+ cmd = await self.run(ssh_config, f"printenv {env_var}", check=False)
466
+ assert isinstance(cmd.stdout, str)
467
+ if cmd.returncode == 0:
468
+ return pathlib.Path(cmd.stdout.strip()) / subpath
469
+
470
+ raise SlurmExecutionError(
471
+ "Failed to find a valid state directory for XManager. "
472
+ "We weren't able to resolve any of the following paths: "
473
+ f"{', '.join(env_var + ('/' + subpath if subpath else '') for env_var, subpath in state_dirs)}."
474
+ )
475
+
476
+ async def experiment_dir(self, ssh_config: SlurmSSHConfig, experiment_id: int) -> pathlib.Path:
477
+ return (await self._state_dir(ssh_config)) / f"{experiment_id:08d}"
461
478
 
462
479
  async def run(
463
480
  self,
@@ -646,7 +663,7 @@ class SlurmExecutionClient:
646
663
 
647
664
  fs = await self.fs(cluster.ssh)
648
665
 
649
- template_dir = (await self._state_dir(cluster.ssh)) / f"{experiment_id}"
666
+ template_dir = await self.experiment_dir(cluster.ssh, experiment_id)
650
667
 
651
668
  await fs.makedirs(template_dir, exist_ok=True)
652
669
  await fs.write(template_dir / submission_script_path, submission_script.encode())
@@ -3,7 +3,6 @@ time podman pull \
3
3
  {% if job.executable.credentials %}
4
4
  --creds {{ job.executable.credentials.username }}:{{ job.executable.credentials.password }} \
5
5
  {% endif %}
6
- --retry 3 \
7
6
  {{ job.executable.image }}
8
7
 
9
8
  cat << 'ENTRYPOINT_EOF' > "$SLURM_TMPDIR"/xm-slurm-entrypoint.sh
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xmanager-slurm
3
- Version: 0.4.6
3
+ Version: 0.4.7
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>
@@ -5,7 +5,7 @@ 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
7
7
  xm_slurm/executables.py,sha256=fGmrFBl-258bMn6ip5adYeM7xxUHAeIbDN9zD2FDGtY,6373
8
- xm_slurm/execution.py,sha256=MRv7MjFVDhGbUrq28kpW82kOYvKdb0tS7tV5jh8g_I0,30163
8
+ xm_slurm/execution.py,sha256=AicnjpY9ncLBlJrLzpngjmS23zfFZftYrflrWpgcyzE,30888
9
9
  xm_slurm/executors.py,sha256=fMtxGUCi4vEKmb_p4JEpqPUTh7L_f1LcR_TamMLAWNg,4667
10
10
  xm_slurm/experiment.py,sha256=94r0mhtUPUzw4eaUEz0kpsufC25wEGqlDhV4Fcr1ukY,39883
11
11
  xm_slurm/filesystem.py,sha256=4rKtq3t-KDgxJbSGt6JVyRJT_3lCN_vIKTcwKHpTo3I,4389
@@ -43,9 +43,9 @@ xm_slurm/templates/slurm/job.bash.j2,sha256=d35VYHdAKkgVK8s4XnUDJwQR0gLnDWRJu-Ld
43
43
  xm_slurm/templates/slurm/fragments/monitor.bash.j2,sha256=HYqYhXsTv8TCed5UaGCZVGIYsqxSKHcnPyNNTHWNvxc,1279
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
- xm_slurm/templates/slurm/runtimes/podman.bash.j2,sha256=yUOUTzGNyVy1IQSgvY9wn9pE-reB1SYNJmuV2ji8l6w,1162
47
- xmanager_slurm-0.4.6.dist-info/METADATA,sha256=Zo382SdJ2QWrzEVwNYQX7DXRhhcv9HZA8SPRuWtT0W4,1042
48
- xmanager_slurm-0.4.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
- xmanager_slurm-0.4.6.dist-info/entry_points.txt,sha256=_HLGmLgxuQLOPmF2gOFYDVq2HqtMVD_SzigHvUh8TCY,49
50
- xmanager_slurm-0.4.6.dist-info/licenses/LICENSE.md,sha256=IxstXr3MPHwTJ5jMrByHrQsR1ZAGQ2U_uz_4qzI_15Y,11756
51
- xmanager_slurm-0.4.6.dist-info/RECORD,,
46
+ xm_slurm/templates/slurm/runtimes/podman.bash.j2,sha256=3j7K5eyXt_WhXK0EoMlxnhlmFVJ2JyxRKbsMRaDqzSs,1148
47
+ xmanager_slurm-0.4.7.dist-info/METADATA,sha256=mRwFTuy53rP0lDYJ9xMXx6E8Ed7sZAzjSEcQpjvV3GQ,1042
48
+ xmanager_slurm-0.4.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
49
+ xmanager_slurm-0.4.7.dist-info/entry_points.txt,sha256=_HLGmLgxuQLOPmF2gOFYDVq2HqtMVD_SzigHvUh8TCY,49
50
+ xmanager_slurm-0.4.7.dist-info/licenses/LICENSE.md,sha256=IxstXr3MPHwTJ5jMrByHrQsR1ZAGQ2U_uz_4qzI_15Y,11756
51
+ xmanager_slurm-0.4.7.dist-info/RECORD,,