pybiolib 1.1.988__tar.gz → 1.1.997__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.
- {pybiolib-1.1.988 → pybiolib-1.1.997}/PKG-INFO +1 -1
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/remote_endpoints.py +3 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/utils.py +49 -7
- {pybiolib-1.1.988 → pybiolib-1.1.997}/pyproject.toml +1 -1
- {pybiolib-1.1.988 → pybiolib-1.1.997}/LICENSE +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/README.md +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/api/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/api/client.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/app/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/app/app.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/app/search_apps.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/app/utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/api_client.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/app_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/auth.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/biolib_account_api.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/biolib_app_api.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/biolib_job_api.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/biolib_large_file_system_api.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/common_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/job_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/lfs_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/user_state.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/common_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/encrypted_module_output.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/module_input.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/module_output.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/rsa_encrypted_aes_package.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/saved_job.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/system_exception.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/system_status_update.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/unencrypted_module_output.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_docker_client/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_errors.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_logging.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_push.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/init.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/lfs.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/push.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/run.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/runtime.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli/start.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/cli_utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/.gitignore +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/cloud_utils/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/cloud_utils/cloud_utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/cache_state.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/cache_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/base_executor.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/remote/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/remote/remote_executor.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/job_storage.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/job_worker.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/large_file_system.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/mappings.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/remote_host_proxy.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/socker_listener_thread.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/socket_sender_thread.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/webserver.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/webserver_types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/webserver_utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/worker_thread.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/experiments/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/experiments/experiment.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/experiments/types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/jobs/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/jobs/job.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/jobs/job_result.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/jobs/types.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/lfs/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/lfs/cache.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/lfs/utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/runtime/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/runtime/results.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/start_cli.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/tables.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/templates/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/templates/example_app.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/typing_utils.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/user/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/user/sign_in.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/utils/__init__.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/utils/cache_state.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/utils/multipart_uploader.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/utils/seq_util.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/utils/zip/remote_zip.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/validators/validate_app_version.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/validators/validate_argument.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/validators/validate_module.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/validators/validate_zip_file.py +0 -0
- {pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/validators/validator_utils.py +0 -0
@@ -1,6 +1,8 @@
|
|
1
1
|
import datetime
|
2
2
|
from urllib.parse import urlparse, parse_qs
|
3
3
|
|
4
|
+
from biolib.biolib_logging import logger
|
5
|
+
|
4
6
|
from biolib.biolib_api_client.biolib_job_api import BiolibJobApi
|
5
7
|
from biolib.biolib_binary_format.utils import RemoteEndpoint
|
6
8
|
|
@@ -23,5 +25,6 @@ class RemoteJobStorageResultEndpoint(RemoteEndpoint):
|
|
23
25
|
query_params = parse_qs(parsed_url.query)
|
24
26
|
time_at_generation = datetime.datetime.strptime(query_params['X-Amz-Date'][0], '%Y%m%dT%H%M%SZ')
|
25
27
|
self._expires_at = time_at_generation + datetime.timedelta(seconds=int(query_params['X-Amz-Expires'][0]))
|
28
|
+
logger.debug(f'Job "{self._job_id}" fetched presigned URL with expiry at {self._expires_at.isoformat()}')
|
26
29
|
|
27
30
|
return self.presigned_url
|
@@ -1,10 +1,12 @@
|
|
1
1
|
from abc import ABC, abstractmethod
|
2
|
-
|
3
2
|
import io
|
3
|
+
import time
|
4
4
|
|
5
5
|
import requests
|
6
|
+
from requests import Response
|
6
7
|
|
7
|
-
from biolib.
|
8
|
+
from biolib.biolib_logging import logger
|
9
|
+
from biolib.typing_utils import Iterable, Optional, Dict
|
8
10
|
from biolib.utils.multipart_uploader import get_chunk_iterator_from_bytes
|
9
11
|
|
10
12
|
|
@@ -49,6 +51,46 @@ class IndexableBuffer(ABC):
|
|
49
51
|
return data
|
50
52
|
|
51
53
|
|
54
|
+
def _get_request_with_retries_for_timeout(
|
55
|
+
url: str,
|
56
|
+
headers: Optional[Dict[str, str]] = None,
|
57
|
+
stream: bool = False,
|
58
|
+
) -> Response:
|
59
|
+
retries = 10
|
60
|
+
for retry_count in range(retries):
|
61
|
+
if retry_count > 0:
|
62
|
+
time.sleep(1 * retry_count)
|
63
|
+
logger.debug('Retrying HTTP GET request...')
|
64
|
+
|
65
|
+
try:
|
66
|
+
response = requests.get(
|
67
|
+
headers=headers,
|
68
|
+
stream=stream,
|
69
|
+
timeout=10,
|
70
|
+
url=url,
|
71
|
+
)
|
72
|
+
except requests.exceptions.ReadTimeout:
|
73
|
+
logger.debug('Got read timeout of HTTP GET request')
|
74
|
+
continue
|
75
|
+
|
76
|
+
if response.status_code == 502:
|
77
|
+
logger.debug('Got 502 status for HTTP GET')
|
78
|
+
continue
|
79
|
+
|
80
|
+
if response.status_code == 400:
|
81
|
+
logger.error(
|
82
|
+
f'GET request for "{url}" got response with status {response.status_code} and '
|
83
|
+
f'content: {response.content.decode()}'
|
84
|
+
)
|
85
|
+
|
86
|
+
if not response.ok:
|
87
|
+
raise Exception(f'GET request for "{url}" got response with status {response.status_code}')
|
88
|
+
|
89
|
+
return response
|
90
|
+
|
91
|
+
raise Exception(f'Failed to complete HTTP GET request for "{url}" after {retries} retries')
|
92
|
+
|
93
|
+
|
52
94
|
class RemoteIndexableBuffer(IndexableBuffer):
|
53
95
|
|
54
96
|
def __init__(self, endpoint: RemoteEndpoint):
|
@@ -63,9 +105,10 @@ class RemoteIndexableBuffer(IndexableBuffer):
|
|
63
105
|
return bytes(0)
|
64
106
|
|
65
107
|
end = start + length - 1
|
66
|
-
response =
|
67
|
-
|
68
|
-
|
108
|
+
response = _get_request_with_retries_for_timeout(
|
109
|
+
url=self._endpoint.get_remote_url(),
|
110
|
+
headers={'range': f'bytes={start}-{end}'},
|
111
|
+
)
|
69
112
|
|
70
113
|
data: bytes = response.content
|
71
114
|
if len(data) != length:
|
@@ -81,11 +124,10 @@ class RemoteIndexableBuffer(IndexableBuffer):
|
|
81
124
|
return []
|
82
125
|
|
83
126
|
end = start + length - 1
|
84
|
-
response =
|
127
|
+
response = _get_request_with_retries_for_timeout(
|
85
128
|
url=self._endpoint.get_remote_url(),
|
86
129
|
headers={'range': f'bytes={start}-{end}'},
|
87
130
|
stream=True,
|
88
|
-
timeout=60,
|
89
131
|
)
|
90
132
|
return response.iter_content(chunk_size=chunk_size)
|
91
133
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_api_client/biolib_large_file_system_api.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/encrypted_module_output.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/rsa_encrypted_aes_package.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/biolib_binary_format/unencrypted_module_output.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/base_executor.py
RENAMED
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/docker_executor.py
RENAMED
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/docker_types.py
RENAMED
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/remote/__init__.py
RENAMED
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/executors/tars/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.988 → pybiolib-1.1.997}/biolib/compute_node/webserver/gunicorn_flask_application.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|