pybiolib 1.1.1874__tar.gz → 1.1.1881__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.1874 → pybiolib-1.1.1881}/PKG-INFO +1 -1
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/data_record/data_record.py +20 -19
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/http_client.py +16 -17
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/push_application.py +22 -37
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/runtime.py +3 -2
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/runtime/__init__.py +1 -1
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/pyproject.toml +1 -1
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/LICENSE +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/README.md +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/data_record/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/data_record/remote_storage_endpoint.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/utils/__init__.py +1 -1
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/api/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/api/client.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/app/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/app/app.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/app/search_apps.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/api_client.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/app_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/auth.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/biolib_app_api.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/biolib_job_api.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/common_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/job_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/lfs_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_api_client/user_state.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/file_in_container.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/module_input.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/module_output_v2.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/remote_endpoints.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/remote_stream_seeker.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/saved_job.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/system_exception.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/system_status_update.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_binary_format/utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_docker_client/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_download_container.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_errors.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/biolib_logging.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/auth.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/data_record.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/download_container.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/init.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/lfs.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/push.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/run.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/runtime.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/cli/start.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/.gitignore +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/cloud_utils/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/cloud_utils/cloud_utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/cache_state.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/cache_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/job_storage.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/job_worker.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/large_file_system.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/mappings.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/utilization_reporter_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/remote_host_proxy.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/socker_listener_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/socket_sender_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/webserver.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/webserver_types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/webserver_utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/webserver/worker_thread.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/experiments/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/experiments/experiment.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/experiments/types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/jobs/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/jobs/job.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/jobs/job_result.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/jobs/types.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/lfs/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/lfs/cache.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/lfs/utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/sdk/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/tables.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/templates/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/templates/example_app.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/typing_utils.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/user/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/user/sign_in.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/__init__.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/app_uri.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/cache_state.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/multipart_uploader.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/seq_util.py +0 -0
- {pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/utils/zip/remote_zip.py +0 -0
@@ -3,16 +3,16 @@ from collections import namedtuple
|
|
3
3
|
from datetime import datetime
|
4
4
|
from fnmatch import fnmatch
|
5
5
|
from struct import Struct
|
6
|
-
from typing import
|
6
|
+
from typing import Callable, Dict, List, Optional, Union, cast
|
7
7
|
|
8
8
|
from biolib import lfs
|
9
9
|
from biolib._internal.data_record.remote_storage_endpoint import DataRecordRemoteStorageEndpoint
|
10
10
|
from biolib._internal.http_client import HttpClient
|
11
|
+
from biolib.api import client as api_client
|
11
12
|
from biolib.biolib_api_client import AppGetResponse
|
12
13
|
from biolib.biolib_binary_format import LazyLoadedFile
|
13
14
|
from biolib.biolib_binary_format.utils import RemoteIndexableBuffer
|
14
15
|
from biolib.biolib_logging import logger
|
15
|
-
from biolib.api import client as api_client
|
16
16
|
from biolib.utils.app_uri import parse_app_uri
|
17
17
|
from biolib.utils.zip.remote_zip import RemoteZip # type: ignore
|
18
18
|
|
@@ -20,7 +20,6 @@ PathFilter = Union[str, Callable[[str], bool]]
|
|
20
20
|
|
21
21
|
|
22
22
|
class DataRecord:
|
23
|
-
|
24
23
|
def __init__(self, uri: str):
|
25
24
|
self._uri = uri
|
26
25
|
uri_parsed = parse_app_uri(uri, use_account_as_name_default=False)
|
@@ -97,18 +96,21 @@ class DataRecord:
|
|
97
96
|
def _get_file(remote_storage_endpoint: DataRecordRemoteStorageEndpoint, file_info: Dict) -> LazyLoadedFile:
|
98
97
|
local_file_header_signature_bytes = b'\x50\x4b\x03\x04'
|
99
98
|
local_file_header_struct = Struct('<H2sHHHIIIHH')
|
100
|
-
LocalFileHeader = namedtuple(
|
101
|
-
'
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
99
|
+
LocalFileHeader = namedtuple(
|
100
|
+
'LocalFileHeader',
|
101
|
+
(
|
102
|
+
'version',
|
103
|
+
'flags',
|
104
|
+
'compression_raw',
|
105
|
+
'mod_time',
|
106
|
+
'mod_date',
|
107
|
+
'crc_32_expected',
|
108
|
+
'compressed_size_raw',
|
109
|
+
'uncompressed_size_raw',
|
110
|
+
'file_name_len',
|
111
|
+
'extra_field_len',
|
112
|
+
),
|
113
|
+
)
|
112
114
|
|
113
115
|
local_file_header_start = file_info['header_offset'] + len(local_file_header_signature_bytes)
|
114
116
|
local_file_header_end = local_file_header_start + local_file_header_struct.size
|
@@ -120,11 +122,10 @@ class DataRecord:
|
|
120
122
|
timeout_in_seconds=300,
|
121
123
|
)
|
122
124
|
local_file_header = LocalFileHeader._make(
|
123
|
-
local_file_header_struct.unpack(local_file_header_response.content)
|
125
|
+
local_file_header_struct.unpack(local_file_header_response.content)
|
126
|
+
)
|
124
127
|
file_start: int = (
|
125
|
-
|
126
|
-
local_file_header.file_name_len +
|
127
|
-
local_file_header.extra_field_len
|
128
|
+
local_file_header_end + local_file_header.file_name_len + local_file_header.extra_field_len
|
128
129
|
)
|
129
130
|
return file_start
|
130
131
|
|
@@ -1,25 +1,24 @@
|
|
1
1
|
import json
|
2
2
|
import platform
|
3
|
-
import time
|
4
3
|
import socket
|
5
4
|
import ssl
|
6
5
|
import subprocess
|
7
|
-
import
|
6
|
+
import time
|
8
7
|
import urllib.error
|
9
8
|
import urllib.parse
|
9
|
+
import urllib.request
|
10
10
|
|
11
11
|
from biolib.biolib_logging import logger_no_user_data
|
12
|
-
from biolib.typing_utils import Dict, Optional, Union,
|
12
|
+
from biolib.typing_utils import Dict, Literal, Optional, Union, cast
|
13
|
+
|
14
|
+
_HttpMethod = Literal['GET', 'POST', 'PATCH', 'PUT']
|
13
15
|
|
14
16
|
|
15
17
|
def _create_ssl_context():
|
16
18
|
context = ssl.create_default_context()
|
17
19
|
try:
|
18
20
|
if platform.system() == 'Darwin':
|
19
|
-
certificates = subprocess.check_output(
|
20
|
-
"security find-certificate -a -p",
|
21
|
-
shell=True
|
22
|
-
).decode('utf-8')
|
21
|
+
certificates = subprocess.check_output('security find-certificate -a -p', shell=True).decode('utf-8')
|
23
22
|
context.load_verify_locations(cadata=certificates)
|
24
23
|
except BaseException:
|
25
24
|
pass
|
@@ -33,7 +32,7 @@ class HttpError(urllib.error.HTTPError):
|
|
33
32
|
code=http_error.code,
|
34
33
|
msg=http_error.msg, # type: ignore
|
35
34
|
hdrs=http_error.hdrs, # type: ignore
|
36
|
-
fp=http_error.fp
|
35
|
+
fp=http_error.fp,
|
37
36
|
)
|
38
37
|
|
39
38
|
def __str__(self):
|
@@ -61,12 +60,12 @@ class HttpClient:
|
|
61
60
|
|
62
61
|
@staticmethod
|
63
62
|
def request(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
url: str,
|
64
|
+
method: Optional[_HttpMethod] = None,
|
65
|
+
data: Optional[Union[Dict, bytes]] = None,
|
66
|
+
headers: Optional[Dict[str, str]] = None,
|
67
|
+
retries: int = 5,
|
68
|
+
timeout_in_seconds: Optional[int] = None,
|
70
69
|
) -> HttpResponse:
|
71
70
|
if not HttpClient.ssl_context:
|
72
71
|
HttpClient.ssl_context = _create_ssl_context()
|
@@ -91,9 +90,9 @@ class HttpClient:
|
|
91
90
|
logger_no_user_data.debug(f'Retrying HTTP {method} request...')
|
92
91
|
try:
|
93
92
|
with urllib.request.urlopen(
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
request,
|
94
|
+
context=HttpClient.ssl_context,
|
95
|
+
timeout=timeout_in_seconds,
|
97
96
|
) as response:
|
98
97
|
return HttpResponse(response)
|
99
98
|
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import os
|
2
2
|
import re
|
3
3
|
from pathlib import Path
|
4
|
-
|
4
|
+
|
5
5
|
import rich.progress
|
6
|
+
import yaml
|
6
7
|
|
7
|
-
from biolib
|
8
|
-
from biolib.typing_utils import Optional, Set, TypedDict, Iterable
|
8
|
+
from biolib import api, utils
|
9
9
|
from biolib.biolib_api_client import BiolibApiClient
|
10
|
-
from biolib.biolib_docker_client import BiolibDockerClient
|
11
10
|
from biolib.biolib_api_client.biolib_app_api import BiolibAppApi
|
11
|
+
from biolib.biolib_docker_client import BiolibDockerClient
|
12
12
|
from biolib.biolib_errors import BioLibError
|
13
13
|
from biolib.biolib_logging import logger
|
14
|
-
from biolib import
|
14
|
+
from biolib.lfs.utils import get_files_and_size_of_directory, get_iterable_zip_stream
|
15
|
+
from biolib.typing_utils import Iterable, Optional, Set, TypedDict
|
15
16
|
|
16
17
|
REGEX_MARKDOWN_INLINE_IMAGE = re.compile(r'!\[(?P<alt>.*)\]\((?P<src>.*)\)')
|
17
18
|
|
@@ -38,9 +39,7 @@ def process_docker_status_updates(status_updates: Iterable[DockerStatusUpdate],
|
|
38
39
|
progress_detail = update['progressDetail']
|
39
40
|
|
40
41
|
if layer_id not in layer_id_to_task_id:
|
41
|
-
layer_id_to_task_id[layer_id] = progress.add_task(
|
42
|
-
description=f'[cyan]{action} layer {layer_id}'
|
43
|
-
)
|
42
|
+
layer_id_to_task_id[layer_id] = progress.add_task(description=f'[cyan]{action} layer {layer_id}')
|
44
43
|
|
45
44
|
if progress_detail and 'current' in progress_detail and 'total' in progress_detail:
|
46
45
|
progress.update(
|
@@ -60,7 +59,7 @@ def process_docker_status_updates(status_updates: Iterable[DockerStatusUpdate],
|
|
60
59
|
|
61
60
|
|
62
61
|
def set_app_version_as_active(
|
63
|
-
|
62
|
+
app_version_uuid: str,
|
64
63
|
):
|
65
64
|
logger.debug(f'Setting app version {app_version_uuid} as active.')
|
66
65
|
api.client.patch(
|
@@ -70,10 +69,10 @@ def set_app_version_as_active(
|
|
70
69
|
|
71
70
|
|
72
71
|
def push_application(
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
app_uri: str,
|
73
|
+
app_path: str,
|
74
|
+
app_version_to_copy_images_from: Optional[str],
|
75
|
+
is_dev_version: Optional[bool],
|
77
76
|
):
|
78
77
|
app_path_absolute = Path(app_path).resolve()
|
79
78
|
|
@@ -96,7 +95,7 @@ def push_application(
|
|
96
95
|
|
97
96
|
input_files_maps_to_root = False
|
98
97
|
try:
|
99
|
-
with open(config_yml_path
|
98
|
+
with open(config_yml_path) as config_yml_file:
|
100
99
|
config = yaml.safe_load(config_yml_file.read())
|
101
100
|
|
102
101
|
license_file_relative_path = config.get('license_file', 'LICENSE')
|
@@ -109,7 +108,7 @@ def push_application(
|
|
109
108
|
raise BioLibError(f'Could not find {description_file_relative_path}')
|
110
109
|
|
111
110
|
zip_filters.add(description_file_relative_path)
|
112
|
-
with open(description_file_absolute_path
|
111
|
+
with open(description_file_absolute_path) as description_file:
|
113
112
|
description_file_content = description_file.read()
|
114
113
|
|
115
114
|
for _, img_src_path in re.findall(REGEX_MARKDOWN_INLINE_IMAGE, description_file_content):
|
@@ -171,8 +170,9 @@ def push_application(
|
|
171
170
|
author=app['account_handle'],
|
172
171
|
set_as_active=False,
|
173
172
|
zip_binary=source_files_zip_bytes,
|
174
|
-
app_version_id_to_copy_images_from=app_response['app_version']['public_id']
|
175
|
-
|
173
|
+
app_version_id_to_copy_images_from=app_response['app_version']['public_id']
|
174
|
+
if app_version_to_copy_images_from
|
175
|
+
else None,
|
176
176
|
)
|
177
177
|
|
178
178
|
# Don't push docker images if copying from another app version
|
@@ -180,18 +180,6 @@ def push_application(
|
|
180
180
|
if not app_version_to_copy_images_from and docker_tags:
|
181
181
|
logger.info('Found docker images to push.')
|
182
182
|
|
183
|
-
try:
|
184
|
-
yaml_file = open(f'{app_path}/.biolib/config.yml', 'r', encoding='utf-8')
|
185
|
-
|
186
|
-
except Exception as error: # pylint: disable=broad-except
|
187
|
-
raise BioLibError('Could not open the config file .biolib/config.yml') from error
|
188
|
-
|
189
|
-
try:
|
190
|
-
config_data = yaml.safe_load(yaml_file)
|
191
|
-
|
192
|
-
except Exception as error: # pylint: disable=broad-except
|
193
|
-
raise BioLibError('Could not parse .biolib/config.yml. Please make sure it is valid YAML') from error
|
194
|
-
|
195
183
|
# Auth to be sent to proxy
|
196
184
|
# The tokens are sent as "{access_token},{job_id}". We leave job_id blank on push.
|
197
185
|
tokens = f'{BiolibApiClient.get().access_token},'
|
@@ -200,14 +188,12 @@ def push_application(
|
|
200
188
|
docker_client = BiolibDockerClient.get_docker_client()
|
201
189
|
|
202
190
|
for module_name, repo_and_tag in docker_tags.items():
|
203
|
-
docker_image_definition =
|
191
|
+
docker_image_definition = config['modules'][module_name]['image']
|
204
192
|
repo, tag = repo_and_tag.split(':')
|
205
193
|
|
206
194
|
if docker_image_definition.startswith('dockerhub://'):
|
207
195
|
docker_image_name = docker_image_definition.replace('dockerhub://', 'docker.io/', 1)
|
208
|
-
logger.info(
|
209
|
-
f'Pulling image {docker_image_name} defined on module {module_name} from Dockerhub.'
|
210
|
-
)
|
196
|
+
logger.info(f'Pulling image {docker_image_name} defined on module {module_name} from Dockerhub.')
|
211
197
|
dockerhub_repo, dockerhub_tag = docker_image_name.split(':')
|
212
198
|
pull_status_updates: Iterable[DockerStatusUpdate] = docker_client.api.pull(
|
213
199
|
decode=True,
|
@@ -238,7 +224,7 @@ def push_application(
|
|
238
224
|
|
239
225
|
process_docker_status_updates(push_status_updates, action='Pushing')
|
240
226
|
|
241
|
-
except Exception as exception:
|
227
|
+
except Exception as exception:
|
242
228
|
raise BioLibError(f'Failed to tag and push image {docker_image_name}.') from exception
|
243
229
|
|
244
230
|
logger.info(f'Successfully pushed {docker_image_name}')
|
@@ -249,10 +235,9 @@ def push_application(
|
|
249
235
|
data={'set_as_active': not is_dev_version},
|
250
236
|
)
|
251
237
|
|
252
|
-
sematic_version =
|
253
|
-
f"{new_app_version_json['major']}.{new_app_version_json['minor']}.{new_app_version_json['patch']}"
|
238
|
+
sematic_version = f"{new_app_version_json['major']}.{new_app_version_json['minor']}.{new_app_version_json['patch']}"
|
254
239
|
logger.info(
|
255
240
|
f"Successfully pushed new {'development ' if is_dev_version else ''}version {sematic_version} of {app_uri}."
|
256
241
|
)
|
257
242
|
|
258
|
-
return {
|
243
|
+
return {'app_uri': app_uri, 'sematic_version': sematic_version}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import json
|
2
|
-
|
2
|
+
|
3
3
|
from biolib import api
|
4
|
+
from biolib.typing_utils import Optional, TypedDict, cast
|
4
5
|
|
5
6
|
|
6
7
|
class RuntimeJobDataDict(TypedDict):
|
@@ -52,7 +53,7 @@ class Runtime:
|
|
52
53
|
def _try_to_get_job_data() -> Optional[RuntimeJobDataDict]:
|
53
54
|
if not Runtime._job_data:
|
54
55
|
try:
|
55
|
-
with open('/biolib/secrets/biolib_system_secret'
|
56
|
+
with open('/biolib/secrets/biolib_system_secret') as file:
|
56
57
|
job_data: RuntimeJobDataDict = json.load(file)
|
57
58
|
except BaseException:
|
58
59
|
return None
|
@@ -6,7 +6,7 @@ def set_main_result_prefix(result_prefix: str) -> None:
|
|
6
6
|
warnings.warn(
|
7
7
|
'The "biolib.runtime.set_main_result_prefix" function is deprecated. '
|
8
8
|
'It will be removed in future releases from mid 2024. '
|
9
|
-
'Please use "biolib.sdk.
|
9
|
+
'Please use "from biolib.sdk import Runtime" and then "Runtime.set_main_result_prefix" instead.',
|
10
10
|
DeprecationWarning,
|
11
11
|
stacklevel=2,
|
12
12
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/_internal/data_record/remote_storage_endpoint.py
RENAMED
File without changes
|
@@ -5,8 +5,8 @@ import uuid
|
|
5
5
|
def open_browser_window_from_notebook(url_to_open: str) -> None:
|
6
6
|
try:
|
7
7
|
from IPython.display import ( # type:ignore # pylint: disable=import-error, import-outside-toplevel
|
8
|
-
display,
|
9
8
|
Javascript,
|
9
|
+
display,
|
10
10
|
update_display,
|
11
11
|
)
|
12
12
|
except ImportError as error:
|
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
|
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.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/docker_image_cache.py
RENAMED
File without changes
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/__init__.py
RENAMED
File without changes
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/docker_executor.py
RENAMED
File without changes
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/docker_types.py
RENAMED
File without changes
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/biolib/compute_node/job_worker/executors/tars/__init__.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
|
{pybiolib-1.1.1874 → pybiolib-1.1.1881}/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
|