sl-shared-assets 4.0.1__py3-none-any.whl → 5.0.1__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 sl-shared-assets might be problematic. Click here for more details.
- sl_shared_assets/__init__.py +48 -41
- sl_shared_assets/command_line_interfaces/__init__.py +3 -0
- sl_shared_assets/command_line_interfaces/configure.py +173 -0
- sl_shared_assets/command_line_interfaces/manage.py +226 -0
- sl_shared_assets/data_classes/__init__.py +33 -32
- sl_shared_assets/data_classes/configuration_data.py +267 -79
- sl_shared_assets/data_classes/session_data.py +226 -289
- sl_shared_assets/server/__init__.py +24 -4
- sl_shared_assets/server/job.py +6 -7
- sl_shared_assets/server/pipeline.py +585 -0
- sl_shared_assets/server/server.py +57 -25
- sl_shared_assets/tools/__init__.py +9 -8
- sl_shared_assets/tools/packaging_tools.py +14 -25
- sl_shared_assets/tools/project_management_tools.py +602 -523
- sl_shared_assets/tools/transfer_tools.py +88 -23
- {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/METADATA +46 -203
- sl_shared_assets-5.0.1.dist-info/RECORD +23 -0
- sl_shared_assets-5.0.1.dist-info/entry_points.txt +3 -0
- sl_shared_assets/__init__.pyi +0 -91
- sl_shared_assets/cli.py +0 -501
- sl_shared_assets/cli.pyi +0 -106
- sl_shared_assets/data_classes/__init__.pyi +0 -75
- sl_shared_assets/data_classes/configuration_data.pyi +0 -235
- sl_shared_assets/data_classes/runtime_data.pyi +0 -157
- sl_shared_assets/data_classes/session_data.pyi +0 -379
- sl_shared_assets/data_classes/surgery_data.pyi +0 -89
- sl_shared_assets/server/__init__.pyi +0 -11
- sl_shared_assets/server/job.pyi +0 -205
- sl_shared_assets/server/server.pyi +0 -298
- sl_shared_assets/tools/__init__.pyi +0 -19
- sl_shared_assets/tools/ascension_tools.py +0 -265
- sl_shared_assets/tools/ascension_tools.pyi +0 -68
- sl_shared_assets/tools/packaging_tools.pyi +0 -58
- sl_shared_assets/tools/project_management_tools.pyi +0 -239
- sl_shared_assets/tools/transfer_tools.pyi +0 -53
- sl_shared_assets-4.0.1.dist-info/RECORD +0 -36
- sl_shared_assets-4.0.1.dist-info/entry_points.txt +0 -7
- {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/WHEEL +0 -0
- {sl_shared_assets-4.0.1.dist-info → sl_shared_assets-5.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
"""This package provides the classes and methods used by all Sun lab libraries to
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"""This package provides the classes and methods used by all Sun lab libraries to work with the data stored on remote
|
|
2
|
+
compute servers, such as the BioHPC server. It provides tools for submitting and monitoring jobs, running complex
|
|
3
|
+
processing pipelines and interactively working with the data via a Jupyter lab server."""
|
|
4
4
|
|
|
5
5
|
from .job import Job, JupyterJob
|
|
6
6
|
from .server import Server, ServerCredentials, generate_server_credentials
|
|
7
|
+
from .pipeline import (
|
|
8
|
+
ProcessingStatus,
|
|
9
|
+
TrackerFileNames,
|
|
10
|
+
ProcessingTracker,
|
|
11
|
+
ProcessingPipeline,
|
|
12
|
+
ProcessingPipelines,
|
|
13
|
+
generate_manager_id,
|
|
14
|
+
)
|
|
7
15
|
|
|
8
|
-
__all__ = [
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Job",
|
|
18
|
+
"JupyterJob",
|
|
19
|
+
"ProcessingPipeline",
|
|
20
|
+
"ProcessingPipelines",
|
|
21
|
+
"ProcessingStatus",
|
|
22
|
+
"ProcessingTracker",
|
|
23
|
+
"Server",
|
|
24
|
+
"ServerCredentials",
|
|
25
|
+
"TrackerFileNames",
|
|
26
|
+
"generate_manager_id",
|
|
27
|
+
"generate_server_credentials",
|
|
28
|
+
]
|
sl_shared_assets/server/job.py
CHANGED
|
@@ -7,7 +7,6 @@ Since version 3.0.0, this module also provides the specialized JupyterJob class
|
|
|
7
7
|
notebook servers.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
# noinspection PyProtectedMember
|
|
11
10
|
import re
|
|
12
11
|
from pathlib import Path
|
|
13
12
|
import datetime
|
|
@@ -49,7 +48,7 @@ class _JupyterConnectionInfo:
|
|
|
49
48
|
|
|
50
49
|
|
|
51
50
|
class Job:
|
|
52
|
-
"""Aggregates the data of a single SLURM-managed job to be executed on the Sun lab
|
|
51
|
+
"""Aggregates the data of a single SLURM-managed job to be executed on the Sun lab's remote compute server.
|
|
53
52
|
|
|
54
53
|
This class provides the API for constructing any server-side job in the Sun lab. Internally, it wraps an instance
|
|
55
54
|
of a Slurm class to package the job data into the format expected by the SLURM job manager. All jobs managed by this
|
|
@@ -222,7 +221,7 @@ class JupyterJob(Job):
|
|
|
222
221
|
connection_info: Stores the JupyterConnectionInfo instance after the Jupyter server is instantiated.
|
|
223
222
|
host: Stores the hostname of the remote server.
|
|
224
223
|
user: Stores the username used to connect with the remote server.
|
|
225
|
-
connection_info_file: The absolute path to the file that stores connection information
|
|
224
|
+
connection_info_file: The absolute path to the file that stores connection information relative to the remote
|
|
226
225
|
server root.
|
|
227
226
|
_command: Stores the shell command for launching the Jupyter server.
|
|
228
227
|
"""
|
|
@@ -273,12 +272,12 @@ class JupyterJob(Job):
|
|
|
273
272
|
"""Builds the command to launch the Jupyter notebook server on the remote Sun lab server."""
|
|
274
273
|
|
|
275
274
|
# Gets the hostname of the compute node and caches it in the connection data file. Also caches the port name.
|
|
276
|
-
self.add_command('echo "COMPUTE_NODE: $(hostname)" > {
|
|
277
|
-
self.add_command('echo "PORT: {}" >> {
|
|
275
|
+
self.add_command(f'echo "COMPUTE_NODE: $(hostname)" > {self.connection_info_file}')
|
|
276
|
+
self.add_command(f'echo "PORT: {self.port}" >> {self.connection_info_file}')
|
|
278
277
|
|
|
279
278
|
# Generates a random access token for security and caches it in the connection data file.
|
|
280
279
|
self.add_command("TOKEN=$(openssl rand -hex 24)")
|
|
281
|
-
self.add_command('echo "TOKEN: $TOKEN" >> {
|
|
280
|
+
self.add_command(f'echo "TOKEN: $TOKEN" >> {self.connection_info_file}')
|
|
282
281
|
|
|
283
282
|
# Builds Jupyter startup command.
|
|
284
283
|
jupyter_cmd = [
|
|
@@ -312,7 +311,7 @@ class JupyterJob(Job):
|
|
|
312
311
|
information to be parsed.
|
|
313
312
|
"""
|
|
314
313
|
|
|
315
|
-
with open(
|
|
314
|
+
with info_file.open() as f:
|
|
316
315
|
content = f.read()
|
|
317
316
|
|
|
318
317
|
# Extracts information using regex
|