slurmray 6.0.4__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 slurmray might be problematic. Click here for more details.

slurmray/utils.py ADDED
@@ -0,0 +1,359 @@
1
+ import paramiko
2
+ import socket
3
+ import threading
4
+ import logging
5
+ import os
6
+ import re
7
+ import hashlib
8
+
9
+
10
+ class DependencyManager:
11
+ """Manage dependencies and cache for remote execution"""
12
+
13
+ def __init__(self, project_path, logger=None):
14
+ self.project_path = project_path
15
+ self.logger = logger
16
+ self.cache_dir = os.path.join(project_path, ".slogs")
17
+ self.cache_file = os.path.join(self.cache_dir, "requirements_cache.txt")
18
+ self.venv_hash_file = os.path.join(self.cache_dir, "venv_hash.txt")
19
+ self.env_hash_file = os.path.join(self.cache_dir, "env_hash.txt")
20
+
21
+ if not os.path.exists(self.cache_dir):
22
+ os.makedirs(self.cache_dir)
23
+
24
+ def parse_requirements(self, req_lines):
25
+ """Parse requirements into dict {package_lower: {original, version}}"""
26
+ reqs = {}
27
+ for line in req_lines:
28
+ line = line.strip()
29
+ if not line or line.startswith("#"):
30
+ continue
31
+
32
+ # Handle 'package==version', 'package>=version', 'package'
33
+ # We split by logical operators to isolate package name
34
+ # For cache comparison, we primarily care about package name and '==' version
35
+
36
+ # Simple split for '=='
37
+ if "==" in line:
38
+ parts = line.split("==")
39
+ name_part = parts[0]
40
+ version = parts[1].split(";")[0].strip() # Remove env markers
41
+ else:
42
+ # Split by other operators or spaces
43
+ # re.split returns the parts, we take the first one as name
44
+ name_part = re.split(r"[<>=;]", line)[0]
45
+ version = None
46
+
47
+ name = name_part.strip().lower()
48
+
49
+ # Clean name from extras e.g. ray[default] -> ray
50
+ if "[" in name:
51
+ name = name.split("[")[0]
52
+
53
+ reqs[name] = {"original": line, "version": version}
54
+ return reqs
55
+
56
+ def load_cache(self):
57
+ """Load cached requirements"""
58
+ if not os.path.exists(self.cache_file):
59
+ return []
60
+ with open(self.cache_file, "r") as f:
61
+ return f.readlines()
62
+
63
+ def save_cache(self, remote_reqs_lines):
64
+ """Save remote requirements to cache"""
65
+ with open(self.cache_file, "w") as f:
66
+ f.writelines(remote_reqs_lines)
67
+
68
+ def compare(self, local_reqs_lines, remote_reqs_lines):
69
+ """
70
+ Compare local requirements with remote/cache.
71
+ Returns a list of lines (requirements) that need to be installed.
72
+ """
73
+ local_reqs = self.parse_requirements(local_reqs_lines)
74
+ remote_reqs = self.parse_requirements(remote_reqs_lines)
75
+
76
+ to_install = []
77
+
78
+ for name, info in local_reqs.items():
79
+ local_ver = info["version"]
80
+ original_line = info["original"]
81
+
82
+ if name not in remote_reqs:
83
+ # Missing on remote
84
+ to_install.append(original_line + "\n")
85
+ else:
86
+ remote_ver = remote_reqs[name]["version"]
87
+ # If local has version, compare.
88
+ if local_ver and remote_ver:
89
+ if local_ver != remote_ver:
90
+ # Version mismatch
91
+ to_install.append(original_line + "\n")
92
+ # If local has no version, strict existence is enough (already checked)
93
+
94
+ return to_install
95
+
96
+ def compute_requirements_hash(self, req_lines):
97
+ """
98
+ Compute a hash of the requirements file content.
99
+ This hash can be used to detect if the virtualenv needs to be recreated.
100
+
101
+ Args:
102
+ req_lines: List of requirement lines (strings)
103
+
104
+ Returns:
105
+ str: SHA256 hash of sorted requirements (hexdigest)
106
+ """
107
+ # Normalize requirements: sort and strip whitespace
108
+ normalized = sorted(
109
+ [
110
+ line.strip()
111
+ for line in req_lines
112
+ if line.strip() and not line.strip().startswith("#")
113
+ ]
114
+ )
115
+ content = "\n".join(normalized).encode("utf-8")
116
+ return hashlib.sha256(content).hexdigest()
117
+
118
+ def get_stored_venv_hash(self):
119
+ """
120
+ Get the stored virtualenv hash from cache.
121
+
122
+ Returns:
123
+ str or None: The stored hash if it exists, None otherwise
124
+ """
125
+ if not os.path.exists(self.venv_hash_file):
126
+ return None
127
+ with open(self.venv_hash_file, "r") as f:
128
+ return f.read().strip()
129
+
130
+ def store_venv_hash(self, req_hash):
131
+ """
132
+ Store the virtualenv hash to cache.
133
+
134
+ Args:
135
+ req_hash: The hash to store
136
+ """
137
+ with open(self.venv_hash_file, "w") as f:
138
+ f.write(req_hash)
139
+
140
+ def should_recreate_venv(self, req_lines):
141
+ """
142
+ Check if the virtualenv should be recreated based on requirements hash.
143
+
144
+ Args:
145
+ req_lines: List of requirement lines (strings)
146
+
147
+ Returns:
148
+ bool: True if venv should be recreated, False if it can be reused
149
+ """
150
+ current_hash = self.compute_requirements_hash(req_lines)
151
+ stored_hash = self.get_stored_venv_hash()
152
+
153
+ if stored_hash is None:
154
+ # No hash stored, venv should be created/recreated
155
+ return True
156
+
157
+ if current_hash != stored_hash:
158
+ # Hash mismatch, requirements changed, venv needs recreation
159
+ if self.logger:
160
+ self.logger.info(
161
+ f"Requirements changed (hash mismatch), venv will be recreated."
162
+ )
163
+ return True
164
+
165
+ # Hash matches, venv can be reused
166
+ if self.logger:
167
+ self.logger.info(
168
+ f"Requirements unchanged (hash matches), reusing existing venv."
169
+ )
170
+ return False
171
+
172
+ def get_stored_env_hash(self):
173
+ """
174
+ Get the stored environment hash from cache.
175
+
176
+ Returns:
177
+ str or None: The stored hash if it exists, None otherwise
178
+ """
179
+ if not os.path.exists(self.env_hash_file):
180
+ return None
181
+ with open(self.env_hash_file, "r") as f:
182
+ return f.read().strip()
183
+
184
+ def store_env_hash(self, env_hash):
185
+ """
186
+ Store the environment hash to cache.
187
+
188
+ Args:
189
+ env_hash: The hash to store
190
+ """
191
+ with open(self.env_hash_file, "w") as f:
192
+ f.write(env_hash)
193
+
194
+
195
+ class SSHTunnel:
196
+ """Context manager for SSH port forwarding using Paramiko"""
197
+
198
+ def __init__(
199
+ self,
200
+ ssh_host: str,
201
+ ssh_username: str,
202
+ ssh_password: str,
203
+ remote_host: str,
204
+ local_port: int = 8888,
205
+ remote_port: int = 8888,
206
+ logger: logging.Logger = None,
207
+ ):
208
+ """Initialize SSH tunnel
209
+
210
+ Args:
211
+ ssh_host: SSH server hostname
212
+ ssh_username: SSH username
213
+ ssh_password: SSH password
214
+ remote_host: Remote hostname to forward to
215
+ local_port: Local port to bind (default: 8888)
216
+ remote_port: Remote port to forward (default: 8888)
217
+ logger: Optional logger
218
+ """
219
+ self.ssh_host = ssh_host
220
+ self.ssh_username = ssh_username
221
+ self.ssh_password = ssh_password
222
+ self.remote_host = remote_host
223
+ self.local_port = local_port
224
+ self.remote_port = remote_port
225
+ self.ssh_client = None
226
+ self.forward_server = None
227
+ self.logger = logger
228
+
229
+ def __enter__(self):
230
+ """Create SSH tunnel"""
231
+ try:
232
+ self.ssh_client = paramiko.SSHClient()
233
+ self.ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
234
+ self.ssh_client.connect(
235
+ hostname=self.ssh_host,
236
+ username=self.ssh_username,
237
+ password=self.ssh_password,
238
+ )
239
+
240
+ # Create local port forwarding using socket server
241
+ transport = self.ssh_client.get_transport()
242
+
243
+ # Create a local socket server
244
+ local_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
245
+ local_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
246
+ local_socket.bind(("127.0.0.1", self.local_port))
247
+ if self.local_port == 0:
248
+ self.local_port = local_socket.getsockname()[1]
249
+ local_socket.listen(5)
250
+ local_socket._closed = False # Track if server is closed
251
+ self.forward_server = local_socket
252
+
253
+ def forward_handler(client_socket):
254
+ try:
255
+ # Create SSH channel to remote host
256
+ channel = transport.open_channel(
257
+ "direct-tcpip",
258
+ (self.remote_host, self.remote_port),
259
+ client_socket.getpeername(),
260
+ )
261
+
262
+ # Forward data bidirectionally
263
+ def forward_data(source, dest):
264
+ try:
265
+ while True:
266
+ data = source.recv(1024)
267
+ if not data:
268
+ break
269
+ dest.send(data)
270
+ except Exception:
271
+ pass
272
+ finally:
273
+ source.close()
274
+ dest.close()
275
+
276
+ # Start forwarding in both directions
277
+ thread1 = threading.Thread(
278
+ target=forward_data,
279
+ args=(client_socket, channel),
280
+ daemon=True,
281
+ )
282
+ thread2 = threading.Thread(
283
+ target=forward_data,
284
+ args=(channel, client_socket),
285
+ daemon=True,
286
+ )
287
+ thread1.start()
288
+ thread2.start()
289
+ thread1.join()
290
+ thread2.join()
291
+ except Exception as e:
292
+ # Silently ignore connection errors when tunnel is closing
293
+ if self.forward_server and not self.forward_server._closed:
294
+ # Only log if server is still supposed to be running
295
+ pass
296
+ finally:
297
+ try:
298
+ client_socket.close()
299
+ except Exception:
300
+ pass
301
+
302
+ def accept_handler():
303
+ while True:
304
+ try:
305
+ # Check if server is closed before accepting
306
+ if (
307
+ hasattr(self.forward_server, "_closed")
308
+ and self.forward_server._closed
309
+ ):
310
+ break
311
+ client_socket, addr = self.forward_server.accept()
312
+ thread = threading.Thread(
313
+ target=forward_handler,
314
+ args=(client_socket,),
315
+ daemon=True,
316
+ )
317
+ thread.start()
318
+ except (OSError, socket.error):
319
+ # Socket closed or connection refused - normal when shutting down
320
+ break
321
+ except Exception:
322
+ break
323
+
324
+ forward_thread = threading.Thread(target=accept_handler, daemon=True)
325
+ forward_thread.start()
326
+
327
+ msg = f"🎉 Dashboard forwarded and available here : http://localhost:{self.local_port}"
328
+ print(msg)
329
+ if self.logger:
330
+ self.logger.info(msg)
331
+ return self
332
+ except Exception as e:
333
+ msg = f"Warning: Failed to create SSH tunnel: {e}"
334
+ print(msg)
335
+ print("Dashboard will not be accessible via port forwarding")
336
+ if self.logger:
337
+ self.logger.warning(msg)
338
+ self.logger.info("Dashboard will not be accessible via port forwarding")
339
+ if self.ssh_client:
340
+ self.ssh_client.close()
341
+ self.ssh_client = None
342
+ self.forward_server = None
343
+ return self
344
+
345
+ def __exit__(self, exc_type, exc_val, exc_tb):
346
+ """Close SSH tunnel"""
347
+ if self.forward_server:
348
+ try:
349
+ # Mark server as closed first to prevent new connections
350
+ self.forward_server._closed = True
351
+ self.forward_server.close()
352
+ except Exception:
353
+ pass
354
+ if self.ssh_client:
355
+ try:
356
+ self.ssh_client.close()
357
+ except Exception:
358
+ pass
359
+ return False
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.3
2
+ Name: slurmray
3
+ Version: 6.0.4
4
+ Summary: SlurmRay is an official tool from DESI @ HEC UNIL for effortlessly distributing tasks on Slurm clusters (e.g., Curnagl) or standalone servers (e.g., ISIPOL09/Desi) using the Ray library.
5
+ License: Apache License
6
+ Keywords: ray,slurm,distributed-computing,hpc,desi,hec-unil
7
+ Author: Henri Jamet
8
+ Author-email: henri.jamet@unil.ch
9
+ Requires-Python: >=3.9,<4.0
10
+ Classifier: License :: Other/Proprietary License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Dist: dill (>=0.3.7,<0.4.0)
18
+ Requires-Dist: inquirer (>=3.1.3,<4.0.0)
19
+ Requires-Dist: paramiko (>=3.3.1,<4.0.0)
20
+ Requires-Dist: pdoc3 (>=0.10.0,<0.11.0)
21
+ Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
22
+ Requires-Dist: ray[data,serve,train,tune] (>=2.7.1,<3.0.0)
23
+ Requires-Dist: rich (>=14.2.0,<15.0.0)
24
+ Requires-Dist: setuptools (>=80.9.0,<81.0.0)
25
+ Project-URL: Documentation, https://henri-jamet.vercel.app/cards/documentation/slurm-ray/slurm-ray/
26
+ Project-URL: Homepage, https://henri-jamet.vercel.app/
27
+ Description-Content-Type: text/markdown
28
+
29
+ # SlurmRay
30
+
31
+ **SlurmRay** is a powerful tool designed to simplify the execution of Python code on remote clusters (Slurm) and standalone servers. It automates the complex process of dependency management, environment setup, and job submission.
32
+
33
+ ## Project Overview
34
+ - **Goal**: Effortslessly distribute Python tasks on Slurm clusters or standalone servers using the Ray library.
35
+ - **Status**: Stable (v6.0.4). Correction de la détection erronée des packages locaux (binaires venv).
36
+ - **Features**: Utilisation de `uv` pour la génération des requirements, suppression des contraintes de version pour compatibilité multi-Python.
37
+
38
+ ## Main Entry Scripts
39
+ | Script | Purpose | Usage Example | Env Vars |
40
+ | :--- | :--- | :--- | :--- |
41
+ | `slurmray` | CLI entry point for project management and job monitoring. | `slurmray --help` | `SLURMRAY_CONFIG` |
42
+
43
+ *The `slurmray` command is the primary way to interact with the system once installed via pip or poetry.*
44
+
45
+ ## Installation
46
+ 1. **Prerequisites**: Python >= 3.9, Poetry (optional).
47
+ 2. **Commands**:
48
+ ```bash
49
+ pip install slurmray
50
+ ```
51
+ *Installs the stable version of SlurmRay from PyPI.*
52
+
53
+ ```bash
54
+ git clone https://github.com/lopilo/SLURM_RAY.git
55
+ cd SLURM_RAY
56
+ poetry install
57
+ ```
58
+ *Prepares the development environment and installs dependencies in a virtual environment.*
59
+
60
+ ## Key Results
61
+ | Benchmark | Cluster | Performance |
62
+ | :--- | :--- | :--- |
63
+ | Job Startup | Curnagl | < 5s (cached) |
64
+ | File Sync | ISIPOL | Incremental (HA-based) |
65
+
66
+ ## Repository Map
67
+ ```text
68
+ .
69
+ ├── slurmray/ # Core package logic
70
+ │ ├── backend/ # Cluster/Server specific implementations
71
+ │ ├── scanner.py # AST-based dependency tracer
72
+ │ └── file_sync.py # Incremental file synchronization
73
+ ├── tests/ # Automated test suite
74
+ ├── documentation/ # Extended technical docs
75
+ └── pyproject.toml # Project configuration and metadata
76
+ ```
77
+
78
+ ## Utility Scripts
79
+ *No additional utility scripts in `scripts/utils/` currently.*
80
+
81
+ ## Roadmap
82
+ - **Enhanced Caching**: Implement more aggressive caching for large conda/venv environments to reduce startup time. *Estimated: 15h. Priority: High.*
83
+ - **Monitoring Dashboard**: Integration with a web-based UI for real-time job monitoring and log visualization. *Estimated: 40h. Priority: Medium.*
84
+ - **Docker Support**: Allow running jobs inside custom Docker containers on supported Slurm clusters. *Estimated: 25h. Priority: Low.*
85
+
@@ -0,0 +1,24 @@
1
+ slurmray/RayLauncher.py,sha256=ZcbRxEQGUzfDVzfedJhlAFmzomDIV5KzvPpAZ6-XGto,45819
2
+ slurmray/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ slurmray/__main__.py,sha256=ZQt_merGP_zLaB5QWdzH4oxgjOGnwdsMLMVXgNmSKH4,70
4
+ slurmray/assets/cleanup_old_projects.py,sha256=Fyv3YKnDPttMOvOoSxS2Co1jF42Ys1CX8zsT0zZIIwg,5354
5
+ slurmray/assets/sbatch_template.sh,sha256=BKj3TL-ewcqhYVsVMB0be6pDUV1vi34GDuVpqFLhsVk,2295
6
+ slurmray/assets/slurmray_server.sh,sha256=ZPNjQ2vydxmI9keodEhmMqVcR_tWvaQZbX-hjveCD0I,6033
7
+ slurmray/assets/slurmray_server_template.py,sha256=2nRPe9FdZ3ZY--8_lyCV7aWH3gpMryB3kgHuwE9ADxI,1355
8
+ slurmray/assets/spython_template.py,sha256=vQkWY6Jl93pMmhEx8C5eOTKDxl_EFgdba7pzr5pe0g0,3639
9
+ slurmray/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ slurmray/backend/base.py,sha256=95HmsIg8PsHTj9EErpzdnRwRmPwf4BTQ_WDpCIigkF8,45420
11
+ slurmray/backend/desi.py,sha256=xFqeKnVdyx0z-NO5IqkToMdgD37X8RT2-TWT3_ZrJ6c,34223
12
+ slurmray/backend/local.py,sha256=GBKogMKaXP2rB82a00QhCLY5JFItACF9s0MkSK-QcBk,4697
13
+ slurmray/backend/remote.py,sha256=lmKBeMwC7ESeoBtg_P-wGLJanCvm9LU6sVRzbbswHJw,7165
14
+ slurmray/backend/slurm.py,sha256=qvFJKvpzYCIs-obT6gVl8hVtyw_PLs06Llnqr1retQE,50575
15
+ slurmray/cli.py,sha256=UDrUaFWuKoAR3Y_KWbIf0f4u59dKe9HZYs2eNIYJtCY,35713
16
+ slurmray/detection.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
17
+ slurmray/file_sync.py,sha256=TNLuJxWOl2AUcT5t3DdEwlVHP4F41RV2m6nTwE26Wd4,10501
18
+ slurmray/scanner.py,sha256=ccZF_c0GbpsWo03OhuoYChJyuggn8jIX5cDwAIcR-mg,19045
19
+ slurmray/utils.py,sha256=wLtjlEunpys0DNxTi0Ts_1ZQWQkC3prLG2rg3h_ChJ8,12792
20
+ slurmray-6.0.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
21
+ slurmray-6.0.4.dist-info/METADATA,sha256=kKS7NT3-vEhR_5WDWxtILjvpqVQFyPX0Wjv3O4OWNkQ,3766
22
+ slurmray-6.0.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
23
+ slurmray-6.0.4.dist-info/entry_points.txt,sha256=rPyaZsidMpsjLzyDdS6LLoKWZ4sTp4pt6vkcP4l1xyk,46
24
+ slurmray-6.0.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.1.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ slurmray=slurmray.cli:main
3
+