pybiolib 1.1.1325__py3-none-any.whl → 1.1.1338__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.
- biolib/biolib_binary_format/utils.py +22 -0
- biolib/compute_node/cloud_utils/cloud_utils.py +2 -1
- biolib/compute_node/webserver/worker_thread.py +23 -3
- {pybiolib-1.1.1325.dist-info → pybiolib-1.1.1338.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1325.dist-info → pybiolib-1.1.1338.dist-info}/RECORD +8 -8
- {pybiolib-1.1.1325.dist-info → pybiolib-1.1.1338.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1325.dist-info → pybiolib-1.1.1338.dist-info}/WHEEL +0 -0
- {pybiolib-1.1.1325.dist-info → pybiolib-1.1.1338.dist-info}/entry_points.txt +0 -0
@@ -86,6 +86,28 @@ def _get_request_with_retries_for_timeout(
|
|
86
86
|
raise Exception(f'Failed to complete HTTP GET request for "{url}" after {retries} retries')
|
87
87
|
|
88
88
|
|
89
|
+
class LocalFileIndexableBuffer(IndexableBuffer):
|
90
|
+
|
91
|
+
def __init__(self, filename: str):
|
92
|
+
super().__init__()
|
93
|
+
self._filehandle = open(filename, 'rb')
|
94
|
+
|
95
|
+
def get_data(self, start: int, length: int) -> bytes:
|
96
|
+
if length < 0:
|
97
|
+
raise Exception('get_data length must be positive')
|
98
|
+
|
99
|
+
if length == 0:
|
100
|
+
return bytes(0)
|
101
|
+
|
102
|
+
self._filehandle.seek(start)
|
103
|
+
data: bytes = self._filehandle.read(length)
|
104
|
+
|
105
|
+
if len(data) != length:
|
106
|
+
raise Exception(f'get_data got response of unexpected length. Got {len(data)} expected {length}.')
|
107
|
+
|
108
|
+
return data
|
109
|
+
|
110
|
+
|
89
111
|
class RemoteIndexableBuffer(IndexableBuffer):
|
90
112
|
|
91
113
|
def __init__(self, endpoint: RemoteEndpoint):
|
@@ -102,7 +102,7 @@ class CloudUtils:
|
|
102
102
|
logger_no_user_data.error("Not deregistering as environment is not cloud")
|
103
103
|
|
104
104
|
@staticmethod
|
105
|
-
def finish_cloud_job(cloud_job_id: str, system_exception_code: Optional[int]) -> None:
|
105
|
+
def finish_cloud_job(cloud_job_id: str, system_exception_code: Optional[int], exit_code: Optional[int]) -> None:
|
106
106
|
if not cloud_job_id:
|
107
107
|
logger_no_user_data.error(
|
108
108
|
'Finish cloud job was called but no cloud job was supplied. '
|
@@ -120,6 +120,7 @@ class CloudUtils:
|
|
120
120
|
'auth_token': config["compute_node_info"]["auth_token"],
|
121
121
|
'cloud_job_id': cloud_job_id,
|
122
122
|
'system_exception_code': system_exception_code,
|
123
|
+
'job_exit_code': exit_code
|
123
124
|
},
|
124
125
|
timeout=10,
|
125
126
|
)
|
@@ -9,13 +9,14 @@ import socket
|
|
9
9
|
from queue import Queue
|
10
10
|
|
11
11
|
from biolib import utils
|
12
|
+
from biolib.biolib_binary_format.utils import LocalFileIndexableBuffer
|
12
13
|
from biolib.compute_node.cloud_utils import CloudUtils
|
13
14
|
from biolib.compute_node.job_worker import JobWorkerProcess
|
14
15
|
from biolib.compute_node.job_worker.job_storage import JobStorage
|
15
16
|
from biolib.compute_node.socker_listener_thread import SocketListenerThread
|
16
17
|
from biolib.compute_node.socket_sender_thread import SocketSenderThread
|
17
18
|
from biolib.compute_node.webserver import webserver_utils
|
18
|
-
from biolib.biolib_binary_format import SystemStatusUpdate, SystemException
|
19
|
+
from biolib.biolib_binary_format import SystemStatusUpdate, SystemException, ModuleOutputV2
|
19
20
|
from biolib.compute_node.utils import get_package_type, WorkerThreadException, SystemExceptionCodes
|
20
21
|
from biolib.biolib_logging import logger, logger_no_user_data
|
21
22
|
|
@@ -76,6 +77,22 @@ class WorkerThread(threading.Thread):
|
|
76
77
|
|
77
78
|
# If 'Computation Finished'
|
78
79
|
if progress == 94:
|
80
|
+
# Get Job exit code
|
81
|
+
try:
|
82
|
+
module_output_path = os.path.join(self._job_temporary_dir,
|
83
|
+
JobStorage.module_output_file_name)
|
84
|
+
module_output = ModuleOutputV2(
|
85
|
+
buffer=LocalFileIndexableBuffer(
|
86
|
+
filename=module_output_path
|
87
|
+
)
|
88
|
+
)
|
89
|
+
self.compute_state['exit_code'] = module_output.get_exit_code()
|
90
|
+
|
91
|
+
except Exception as error: # pylint: disable=broad-except
|
92
|
+
logger_no_user_data.error(
|
93
|
+
f'Could not get exit_code from module output due to: {error}'
|
94
|
+
)
|
95
|
+
|
79
96
|
if utils.IS_RUNNING_IN_CLOUD:
|
80
97
|
JobStorage.upload_module_output(
|
81
98
|
job_temporary_dir=self._job_temporary_dir,
|
@@ -184,11 +201,14 @@ class WorkerThread(threading.Thread):
|
|
184
201
|
if system_exception_code and os.path.exists(self._job_temporary_dir):
|
185
202
|
shutil.rmtree(self._job_temporary_dir)
|
186
203
|
|
204
|
+
exit_code = self.compute_state.get('exit_code')
|
205
|
+
|
187
206
|
if utils.IS_RUNNING_IN_CLOUD:
|
188
|
-
# Get and send exception code if present
|
207
|
+
# Get and send compute node exception code and job exit code if present
|
189
208
|
CloudUtils.finish_cloud_job(
|
190
209
|
cloud_job_id=self.compute_state['cloud_job_id'],
|
191
|
-
system_exception_code=system_exception_code
|
210
|
+
system_exception_code=system_exception_code,
|
211
|
+
exit_code=exit_code
|
192
212
|
)
|
193
213
|
|
194
214
|
if self._socket:
|
@@ -29,7 +29,7 @@ biolib/biolib_binary_format/saved_job.py,sha256=nFHVFRNTNcAFGODLSiBntCtMk55QKwre
|
|
29
29
|
biolib/biolib_binary_format/stdout_and_stderr.py,sha256=WfUUJFFCBrtfXjuWIaRPiWCpuBLxfko68oxoTKhrwx8,1023
|
30
30
|
biolib/biolib_binary_format/system_exception.py,sha256=T3iL4_cSHAHim3RSDPS8Xyb1mfteaJBZonSXuRltc28,853
|
31
31
|
biolib/biolib_binary_format/system_status_update.py,sha256=aOELuQ0k-GtpaZTUxYd0GFomP_OInmrK585y6fuQuKE,1191
|
32
|
-
biolib/biolib_binary_format/utils.py,sha256=
|
32
|
+
biolib/biolib_binary_format/utils.py,sha256=JEYJgH3vvf_Iz0rcZjuZ85koex_KByeQaTXgFxDT1rQ,5069
|
33
33
|
biolib/biolib_docker_client/__init__.py,sha256=aBfA6mtWSI5dBEfNNMD6bIZzCPloW4ghKm0wqQiljdo,1481
|
34
34
|
biolib/biolib_errors.py,sha256=5m4lK2l39DafpoXBImEBD4EPH3ayXBX0JgtPzmGClow,689
|
35
35
|
biolib/biolib_logging.py,sha256=J3E5H_LL5k6ZUim2C8gqN7E6lCBZMTpO4tnMpOPwG9U,2854
|
@@ -44,7 +44,7 @@ biolib/cli/start.py,sha256=TpZq1VHVkLTW1_PyjIGkJg44E3PzxSaGrN2D_rNJL0c,1736
|
|
44
44
|
biolib/compute_node/.gitignore,sha256=GZdZ4g7HftqfOfasFpBC5zV1YQAbht1a7EzcXD6f3zg,45
|
45
45
|
biolib/compute_node/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
46
|
biolib/compute_node/cloud_utils/__init__.py,sha256=VZSScLqaz5tg_gpMvWgwkAu9Qf-vgW_QHRoDOaAmU44,67
|
47
|
-
biolib/compute_node/cloud_utils/cloud_utils.py,sha256=
|
47
|
+
biolib/compute_node/cloud_utils/cloud_utils.py,sha256=bvteEsy-rZ-AkMaSiM_UdnaE0SNP2U1mF9Ak0qQSscE,8486
|
48
48
|
biolib/compute_node/job_worker/__init__.py,sha256=ipdPWaABKYrltxny15e2kK8PWdEE7VzXbkKK6wM_zDk,71
|
49
49
|
biolib/compute_node/job_worker/cache_state.py,sha256=N2AxvvgfizKx9P_ysM0GDCmueMUlgcveA4xSdz_Z2IQ,4822
|
50
50
|
biolib/compute_node/job_worker/cache_types.py,sha256=4EIF2bohizsuaF61F0ufedBn6zI4SkvclRIFIxhxZuE,891
|
@@ -70,7 +70,7 @@ biolib/compute_node/webserver/gunicorn_flask_application.py,sha256=jPfR_YvNBekLU
|
|
70
70
|
biolib/compute_node/webserver/webserver.py,sha256=15PkRyhtdtSgFDxa0z78aPO4ciZURsFqJYi-HtUmZF8,6494
|
71
71
|
biolib/compute_node/webserver/webserver_types.py,sha256=Vmt1ZDecYhGBVEYWcW1DVxee1DEPqkqyxQzbsObXWbI,420
|
72
72
|
biolib/compute_node/webserver/webserver_utils.py,sha256=XWvwYPbWNR3qS0FYbLLp-MDDfVk0QdaAmg3xPrT0H2s,4234
|
73
|
-
biolib/compute_node/webserver/worker_thread.py,sha256=
|
73
|
+
biolib/compute_node/webserver/worker_thread.py,sha256=qNiwUUd6UJG2oFQuP7KCb0cCOTqyTCGUHJSAx7yLko4,10979
|
74
74
|
biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
75
75
|
biolib/experiments/experiment.py,sha256=NjJOFktfTbgHNtIDavyQP_uL_-gSGwYHfycybPLJRKU,5939
|
76
76
|
biolib/experiments/types.py,sha256=n9GxdFA7cLMfHvLLqLmZzX31ELeSSkMXFoEEdFsdWGY,171
|
@@ -95,8 +95,8 @@ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3
|
|
95
95
|
biolib/utils/multipart_uploader.py,sha256=Bf09MJcIOBwzG8L1i5UeQ2cNcYohxklhhWWAMpnE41I,9671
|
96
96
|
biolib/utils/seq_util.py,sha256=QRLYIPg1yM_LF9bFuM-Ow14gTHoG3rOK6CeGHD705qw,2612
|
97
97
|
biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
|
98
|
-
pybiolib-1.1.
|
99
|
-
pybiolib-1.1.
|
100
|
-
pybiolib-1.1.
|
101
|
-
pybiolib-1.1.
|
102
|
-
pybiolib-1.1.
|
98
|
+
pybiolib-1.1.1338.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
99
|
+
pybiolib-1.1.1338.dist-info/METADATA,sha256=0jW7ZvvbQ4Tv8_9JJr0e5ShMxsFalVv3Cy06wVldzzw,1492
|
100
|
+
pybiolib-1.1.1338.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
101
|
+
pybiolib-1.1.1338.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
102
|
+
pybiolib-1.1.1338.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|