pybiolib 1.2.346.dev1__py3-none-any.whl → 1.2.366__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/compute_node/job_worker/executors/docker_executor.py +14 -8
- {pybiolib-1.2.346.dev1.dist-info → pybiolib-1.2.366.dist-info}/METADATA +1 -1
- {pybiolib-1.2.346.dev1.dist-info → pybiolib-1.2.366.dist-info}/RECORD +6 -6
- {pybiolib-1.2.346.dev1.dist-info → pybiolib-1.2.366.dist-info}/LICENSE +0 -0
- {pybiolib-1.2.346.dev1.dist-info → pybiolib-1.2.366.dist-info}/WHEEL +0 -0
- {pybiolib-1.2.346.dev1.dist-info → pybiolib-1.2.366.dist-info}/entry_points.txt +0 -0
@@ -44,8 +44,10 @@ class DockerExecutor:
|
|
44
44
|
self._send_system_exception = options['send_system_exception']
|
45
45
|
self._send_stdout_and_stderr = options['send_stdout_and_stderr']
|
46
46
|
self._random_docker_id = compute_node_utils.random_string(15)
|
47
|
-
|
48
|
-
|
47
|
+
total_memory_in_bytes = int(os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES'))
|
48
|
+
system_reserved_memory = int(total_memory_in_bytes * 0.1) + 500_000_000
|
49
|
+
self._available_memory_in_bytes = total_memory_in_bytes - system_reserved_memory
|
50
|
+
logger_no_user_data.info(f'Available memory for containers: {self._available_memory_in_bytes} bytes')
|
49
51
|
|
50
52
|
if utils.IS_RUNNING_IN_CLOUD:
|
51
53
|
self._compute_process_dir = os.getenv('BIOLIB_USER_DATA_PATH')
|
@@ -164,7 +166,6 @@ class DockerExecutor:
|
|
164
166
|
may_contain_user_data=False,
|
165
167
|
)
|
166
168
|
|
167
|
-
|
168
169
|
def _execute_helper(self, module_input) -> None:
|
169
170
|
job_uuid = self._options['job']['public_id']
|
170
171
|
logger_no_user_data.debug(f'Initializing container for {job_uuid}.')
|
@@ -250,7 +251,6 @@ class DockerExecutor:
|
|
250
251
|
logger_no_user_data.debug(f'Docker container exited with code {exit_code} for {job_uuid}')
|
251
252
|
self._save_module_output_from_container(exit_code, self._metadata_for_save_output_on_cancel)
|
252
253
|
|
253
|
-
|
254
254
|
def _save_module_output_from_container(self, exit_code: int, metadata: MetadataToSaveOutput) -> None:
|
255
255
|
full_stdout = self._docker_api_client.logs(self._container.id, stdout=True, stderr=False)
|
256
256
|
full_stderr = self._docker_api_client.logs(self._container.id, stdout=False, stderr=True)
|
@@ -267,7 +267,6 @@ class DockerExecutor:
|
|
267
267
|
pre_start_diff=metadata['pre_start_diff'],
|
268
268
|
)
|
269
269
|
|
270
|
-
|
271
270
|
def cleanup(self):
|
272
271
|
# Don't clean up if already in the process of doing so, or done doing so
|
273
272
|
if self._is_cleaning_up:
|
@@ -283,7 +282,7 @@ class DockerExecutor:
|
|
283
282
|
logger_no_user_data.debug(f'Container state {self._docker_container.status}')
|
284
283
|
self._save_module_output_from_container(
|
285
284
|
exit_code=self._docker_container.attrs['State']['ExitCode'],
|
286
|
-
metadata=self._metadata_for_save_output_on_cancel
|
285
|
+
metadata=self._metadata_for_save_output_on_cancel,
|
287
286
|
)
|
288
287
|
logger_no_user_data.debug('Saved results')
|
289
288
|
except BaseException as error:
|
@@ -412,8 +411,15 @@ class DockerExecutor:
|
|
412
411
|
|
413
412
|
if utils.IS_RUNNING_IN_CLOUD:
|
414
413
|
cloud_job = self._options['cloud_job']
|
415
|
-
|
416
|
-
|
414
|
+
container_memory_limit_in_bytes = min(
|
415
|
+
cloud_job['reserved_memory_in_bytes'], self._available_memory_in_bytes
|
416
|
+
)
|
417
|
+
create_container_args['mem_limit'] = f'{container_memory_limit_in_bytes}b'
|
418
|
+
logger_no_user_data.debug(
|
419
|
+
'Setting container memory limit to '
|
420
|
+
f'{container_memory_limit_in_bytes} bytes '
|
421
|
+
f'(requested: {cloud_job["reserved_memory_in_bytes"]}, '
|
422
|
+
f'available: {self._available_memory_in_bytes})'
|
417
423
|
)
|
418
424
|
create_container_args['nano_cpus'] = cloud_job['reserved_cpu_in_nano_shares']
|
419
425
|
create_container_args['pids_limit'] = 10_000
|
@@ -76,7 +76,7 @@ biolib/compute_node/job_worker/cache_state.py,sha256=MwjSRzcJJ_4jybqvBL4xdgnDYSI
|
|
76
76
|
biolib/compute_node/job_worker/cache_types.py,sha256=ajpLy8i09QeQS9dEqTn3T6NVNMY_YsHQkSD5nvIHccQ,818
|
77
77
|
biolib/compute_node/job_worker/docker_image_cache.py,sha256=ansHIkJIq_EMW1nZNlW-RRLVVeKWTbzNICYaOHpKiRE,7460
|
78
78
|
biolib/compute_node/job_worker/executors/__init__.py,sha256=bW6t1qi3PZTlHM4quaTLa8EI4ALTCk83cqcVJfJfJfE,145
|
79
|
-
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=
|
79
|
+
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=UxWUSk15mM_H73q2k5_kBB1IWGYGphyXbyC-Bm0QneU,31550
|
80
80
|
biolib/compute_node/job_worker/executors/docker_types.py,sha256=VhsU1DKtJjx_BbCkVmiPZPH4ROiL1ygW1Y_s1Kbpa2o,216
|
81
81
|
biolib/compute_node/job_worker/executors/tars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
82
82
|
biolib/compute_node/job_worker/executors/types.py,sha256=gw_T-oq0lty8Hg8WsTrqhtV-kyOF_l5nr9Xe8-kzetc,1657
|
@@ -118,8 +118,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
118
118
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
119
119
|
biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
|
120
120
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
121
|
-
pybiolib-1.2.
|
122
|
-
pybiolib-1.2.
|
123
|
-
pybiolib-1.2.
|
124
|
-
pybiolib-1.2.
|
125
|
-
pybiolib-1.2.
|
121
|
+
pybiolib-1.2.366.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
122
|
+
pybiolib-1.2.366.dist-info/METADATA,sha256=0VkWxDelNbXapivceuFPSl1TiSZa1myr6plhWi7HNRQ,1570
|
123
|
+
pybiolib-1.2.366.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
124
|
+
pybiolib-1.2.366.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
125
|
+
pybiolib-1.2.366.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|