pybiolib 1.1.1995__py3-none-any.whl → 1.1.2003__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/_internal/data_record/remote_storage_endpoint.py +16 -5
- biolib/compute_node/job_worker/executors/docker_executor.py +1 -0
- {pybiolib-1.1.1995.dist-info → pybiolib-1.1.2003.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1995.dist-info → pybiolib-1.1.2003.dist-info}/RECORD +7 -7
- {pybiolib-1.1.1995.dist-info → pybiolib-1.1.2003.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1995.dist-info → pybiolib-1.1.2003.dist-info}/WHEEL +0 -0
- {pybiolib-1.1.1995.dist-info → pybiolib-1.1.2003.dist-info}/entry_points.txt +0 -0
@@ -1,23 +1,34 @@
|
|
1
|
+
import os
|
1
2
|
from datetime import datetime, timedelta
|
3
|
+
from urllib.parse import urlparse
|
2
4
|
|
3
5
|
from biolib.api import client as api_client
|
4
6
|
from biolib.biolib_api_client.lfs_types import LargeFileSystemVersion
|
5
7
|
from biolib.biolib_binary_format.utils import RemoteEndpoint
|
6
8
|
from biolib.biolib_logging import logger
|
9
|
+
from biolib.typing_utils import Optional
|
7
10
|
|
8
11
|
|
9
12
|
class DataRecordRemoteStorageEndpoint(RemoteEndpoint):
|
10
13
|
def __init__(self, resource_version_uuid: str):
|
11
14
|
self._resource_version_uuid: str = resource_version_uuid
|
12
|
-
self._expires_at = None
|
13
|
-
self._presigned_url = None
|
15
|
+
self._expires_at: Optional[datetime] = None
|
16
|
+
self._presigned_url: Optional[str] = None
|
14
17
|
|
15
|
-
def get_remote_url(self):
|
16
|
-
if not self._presigned_url or datetime.utcnow() > self._expires_at:
|
18
|
+
def get_remote_url(self) -> str:
|
19
|
+
if not self._presigned_url or not self._expires_at or datetime.utcnow() > self._expires_at:
|
17
20
|
lfs_version: LargeFileSystemVersion = api_client.get(
|
18
21
|
path=f'/lfs/versions/{self._resource_version_uuid}/',
|
19
22
|
).json()
|
20
|
-
|
23
|
+
|
24
|
+
app_caller_proxy_job_storage_base_url = os.getenv('BIOLIB_CLOUD_JOB_STORAGE_BASE_URL', '')
|
25
|
+
if app_caller_proxy_job_storage_base_url:
|
26
|
+
# Done to hit App Caller Proxy when downloading from inside an app
|
27
|
+
parsed_url = urlparse(lfs_version['presigned_download_url'])
|
28
|
+
self._presigned_url = f'{app_caller_proxy_job_storage_base_url}{parsed_url.path}?{parsed_url.query}'
|
29
|
+
else:
|
30
|
+
self._presigned_url = lfs_version['presigned_download_url']
|
31
|
+
|
21
32
|
self._expires_at = datetime.utcnow() + timedelta(minutes=8)
|
22
33
|
logger.debug(
|
23
34
|
f'DataRecord "{self._resource_version_uuid}" fetched presigned URL '
|
@@ -356,6 +356,7 @@ class DockerExecutor:
|
|
356
356
|
cloud_job = self._options['cloud_job']
|
357
357
|
create_container_args['mem_limit'] = f'{cloud_job["reserved_memory_in_bytes"]}b'
|
358
358
|
create_container_args['nano_cpus'] = cloud_job['reserved_cpu_in_nano_shares']
|
359
|
+
create_container_args['pids_limit'] = 10_000
|
359
360
|
|
360
361
|
biolib_identity_user_email: Optional[str] = cloud_job.get('biolib_identity_user_email')
|
361
362
|
if biolib_identity_user_email:
|
@@ -4,7 +4,7 @@ biolib/__init__.py,sha256=nfZvVkrHZLvjvvlAvFzhvem9NMfqgmw8NWaCH9HGzew,4045
|
|
4
4
|
biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
biolib/_internal/data_record/__init__.py,sha256=1Bk303i3rFet9veS56fIsrBYtT5X3n9vcsYMA6T6c5o,36
|
6
6
|
biolib/_internal/data_record/data_record.py,sha256=ctijrrZ-LfUxtwzS8PEVa1VBuBLVWEhmo2yHcEDkC0A,7178
|
7
|
-
biolib/_internal/data_record/remote_storage_endpoint.py,sha256=
|
7
|
+
biolib/_internal/data_record/remote_storage_endpoint.py,sha256=hILu0TmFx-ZyDYbWPC4QEPogP0RRVEqwgJc8OEHYp50,1742
|
8
8
|
biolib/_internal/fuse_mount/__init__.py,sha256=B_tM6RM2dBw-vbpoHJC4X3tOAaN1H2RDvqYJOw3xFwg,55
|
9
9
|
biolib/_internal/fuse_mount/experiment_fuse_mount.py,sha256=08aUdEq_bvqLBft_gSLjOClKDy5sBnMts1RfJf7AP_U,7012
|
10
10
|
biolib/_internal/http_client.py,sha256=DdooXei93JKGYGV4aQmzue_oFzvHkozg2UCxgk9dfDM,5081
|
@@ -63,7 +63,7 @@ biolib/compute_node/job_worker/cache_state.py,sha256=MwjSRzcJJ_4jybqvBL4xdgnDYSI
|
|
63
63
|
biolib/compute_node/job_worker/cache_types.py,sha256=ajpLy8i09QeQS9dEqTn3T6NVNMY_YsHQkSD5nvIHccQ,818
|
64
64
|
biolib/compute_node/job_worker/docker_image_cache.py,sha256=ansHIkJIq_EMW1nZNlW-RRLVVeKWTbzNICYaOHpKiRE,7460
|
65
65
|
biolib/compute_node/job_worker/executors/__init__.py,sha256=bW6t1qi3PZTlHM4quaTLa8EI4ALTCk83cqcVJfJfJfE,145
|
66
|
-
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=
|
66
|
+
biolib/compute_node/job_worker/executors/docker_executor.py,sha256=81ltJvSDpCPBgbffnSQF-fiRpk_94sWZWJRcP0IW_5k,27393
|
67
67
|
biolib/compute_node/job_worker/executors/docker_types.py,sha256=VhsU1DKtJjx_BbCkVmiPZPH4ROiL1ygW1Y_s1Kbpa2o,216
|
68
68
|
biolib/compute_node/job_worker/executors/tars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
69
69
|
biolib/compute_node/job_worker/executors/types.py,sha256=yP5gG39hr-DLnw9bOE--VHi-1arDbIYiGuV1rlTbbHI,1466
|
@@ -109,8 +109,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
109
109
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
110
110
|
biolib/utils/seq_util.py,sha256=jC5WhH63FTD7SLFJbxQGA2hOt9NTwq9zHl_BEec1Z0c,4907
|
111
111
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
112
|
-
pybiolib-1.1.
|
113
|
-
pybiolib-1.1.
|
114
|
-
pybiolib-1.1.
|
115
|
-
pybiolib-1.1.
|
116
|
-
pybiolib-1.1.
|
112
|
+
pybiolib-1.1.2003.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
113
|
+
pybiolib-1.1.2003.dist-info/METADATA,sha256=OllzY7bgzHEQu23N9rHAK3GyFKRCycBbpcwD3q0Xjq8,1508
|
114
|
+
pybiolib-1.1.2003.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
115
|
+
pybiolib-1.1.2003.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
116
|
+
pybiolib-1.1.2003.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|