pybiolib 1.1.1325__tar.gz → 1.1.1338__tar.gz

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.
Files changed (99) hide show
  1. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/PKG-INFO +1 -1
  2. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/utils.py +22 -0
  3. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/cloud_utils/cloud_utils.py +2 -1
  4. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/worker_thread.py +23 -3
  5. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/pyproject.toml +1 -1
  6. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/LICENSE +0 -0
  7. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/README.md +0 -0
  8. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/__init__.py +0 -0
  9. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/api/__init__.py +0 -0
  10. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/api/client.py +0 -0
  11. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/app/__init__.py +0 -0
  12. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/app/app.py +0 -0
  13. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/app/search_apps.py +0 -0
  14. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/__init__.py +0 -0
  15. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/api_client.py +0 -0
  16. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/app_types.py +0 -0
  17. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/auth.py +0 -0
  18. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/biolib_account_api.py +0 -0
  19. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/biolib_app_api.py +0 -0
  20. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/biolib_job_api.py +0 -0
  21. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/biolib_large_file_system_api.py +0 -0
  22. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/common_types.py +0 -0
  23. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/job_types.py +0 -0
  24. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/lfs_types.py +0 -0
  25. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_api_client/user_state.py +0 -0
  26. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/__init__.py +0 -0
  27. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
  28. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/file_in_container.py +0 -0
  29. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/module_input.py +0 -0
  30. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/module_output_v2.py +0 -0
  31. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/remote_endpoints.py +0 -0
  32. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/remote_stream_seeker.py +0 -0
  33. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/saved_job.py +0 -0
  34. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
  35. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/system_exception.py +0 -0
  36. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_binary_format/system_status_update.py +0 -0
  37. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_docker_client/__init__.py +0 -0
  38. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_errors.py +0 -0
  39. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_logging.py +0 -0
  40. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/biolib_push.py +0 -0
  41. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/__init__.py +0 -0
  42. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/init.py +0 -0
  43. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/lfs.py +0 -0
  44. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/push.py +0 -0
  45. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/run.py +0 -0
  46. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/runtime.py +0 -0
  47. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/cli/start.py +0 -0
  48. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/.gitignore +0 -0
  49. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/__init__.py +0 -0
  50. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/cloud_utils/__init__.py +0 -0
  51. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/__init__.py +0 -0
  52. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/cache_state.py +0 -0
  53. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/cache_types.py +0 -0
  54. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
  55. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
  56. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
  57. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
  58. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
  59. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/executors/types.py +0 -0
  60. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
  61. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
  62. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/job_storage.py +0 -0
  63. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/job_worker.py +0 -0
  64. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/large_file_system.py +0 -0
  65. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/mappings.py +0 -0
  66. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/job_worker/utils.py +0 -0
  67. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/remote_host_proxy.py +0 -0
  68. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/socker_listener_thread.py +0 -0
  69. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/socket_sender_thread.py +0 -0
  70. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/utils.py +0 -0
  71. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/__init__.py +0 -0
  72. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
  73. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/webserver.py +0 -0
  74. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/webserver_types.py +0 -0
  75. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/compute_node/webserver/webserver_utils.py +0 -0
  76. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/experiments/__init__.py +0 -0
  77. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/experiments/experiment.py +0 -0
  78. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/experiments/types.py +0 -0
  79. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/jobs/__init__.py +0 -0
  80. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/jobs/job.py +0 -0
  81. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/jobs/job_result.py +0 -0
  82. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/jobs/types.py +0 -0
  83. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/lfs/__init__.py +0 -0
  84. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/lfs/cache.py +0 -0
  85. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/lfs/utils.py +0 -0
  86. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/runtime/__init__.py +0 -0
  87. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/runtime/results.py +0 -0
  88. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/tables.py +0 -0
  89. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/templates/__init__.py +0 -0
  90. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/templates/example_app.py +0 -0
  91. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/typing_utils.py +0 -0
  92. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/user/__init__.py +0 -0
  93. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/user/sign_in.py +0 -0
  94. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/__init__.py +0 -0
  95. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/app_uri.py +0 -0
  96. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/cache_state.py +0 -0
  97. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/multipart_uploader.py +0 -0
  98. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/seq_util.py +0 -0
  99. {pybiolib-1.1.1325 → pybiolib-1.1.1338}/biolib/utils/zip/remote_zip.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.1325
3
+ Version: 1.1.1338
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -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:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pybiolib"
3
- version = "1.1.1325"
3
+ version = "1.1.1338"
4
4
  description = "BioLib Python Client"
5
5
  readme = "README.md"
6
6
  license = "MIT"
File without changes
File without changes