pybiolib 1.2.1379__tar.gz → 1.2.1389__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.
Potentially problematic release.
This version of pybiolib might be problematic. Click here for more details.
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/PKG-INFO +1 -1
- pybiolib-1.2.1389/biolib/biolib_binary_format/remote_stream_seeker.py +84 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/jobs/job_result.py +1 -1
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/pyproject.toml +1 -1
- pybiolib-1.2.1379/biolib/biolib_binary_format/remote_stream_seeker.py +0 -45
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/LICENSE +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/PYPI_README.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_data_record/data_record.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/add_copilot_prompts.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/add_gui_files.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/data_record/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/data_record/data_record.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/data_record/push_data.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/data_record/remote_storage_endpoint.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/errors.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/file_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/fuse_mount/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/fuse_mount/experiment_fuse_mount.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/http_client.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/lfs/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/lfs/cache.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/libs/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/libs/fusepy/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/push_application.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/runtime.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/string_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/instructions/general-app-knowledge.instructions.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/instructions/style-general.instructions.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/instructions/style-python.instructions.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/instructions/style-react-ts.instructions.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/prompts/biolib_app_inputs.prompt.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/prompts/biolib_onboard_repo.prompt.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/copilot_template/.github/prompts/biolib_run_apps.prompt.md +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/.yarnrc.yml +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/App.tsx +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/Dockerfile +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/biolib-sdk.ts +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/dev-data/output.json +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/index.css +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/index.html +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/index.tsx +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/package.json +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/tsconfig.json +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/vite.config.mts +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/.biolib/config.yml +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/.github/workflows/biolib.yml +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/.gitignore +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/Dockerfile +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/requirements.txt +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/run.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/run.sh +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/templates.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/tree_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/account.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/account_member.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/app.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/data_record.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/experiment.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/file_node.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/push.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/resource.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/resource_permission.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/resource_version.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/result.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/typing.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/types/user.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/utils/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/utils/job_url.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/utils/multinode.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_runtime/runtime.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_session/session.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/api/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/api/client.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/app/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/app/app.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/app/search_apps.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/api_client.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/app_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/auth.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/biolib_app_api.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/biolib_job_api.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/common_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/job_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/lfs_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_api_client/user_state.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/file_in_container.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/module_input.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/module_output_v2.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/remote_endpoints.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/saved_job.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/system_exception.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/system_status_update.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_binary_format/utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_docker_client/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_download_container.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_errors.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/biolib_logging.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/auth.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/data_record.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/download_container.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/init.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/lfs.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/push.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/run.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/runtime.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/sdk.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/cli/start.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/.gitignore +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/cloud_utils/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/cloud_utils/cloud_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/cache_state.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/cache_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/job_storage.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/job_worker.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/large_file_system.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/mappings.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/utilization_reporter_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/remote_host_proxy.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/socker_listener_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/socket_sender_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/compute_node_results_proxy.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/proxy_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/webserver.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/webserver_types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/webserver_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/worker_thread.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/experiments/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/experiments/experiment.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/jobs/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/jobs/job.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/jobs/types.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/py.typed +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/runtime/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/sdk/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/tables.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/typing_utils.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/user/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/user/sign_in.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/__init__.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/app_uri.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/cache_state.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/multipart_uploader.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/seq_util.py +0 -0
- {pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/utils/zip/remote_zip.py +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from biolib.biolib_binary_format.utils import IndexableBuffer
|
|
4
|
+
from biolib.biolib_logging import logger
|
|
5
|
+
from biolib.typing_utils import Iterable
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class StreamSeeker:
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
upstream_buffer: IndexableBuffer,
|
|
12
|
+
files_data_start: int,
|
|
13
|
+
files_data_end: int,
|
|
14
|
+
max_chunk_size: int,
|
|
15
|
+
):
|
|
16
|
+
self._upstream_buffer = upstream_buffer
|
|
17
|
+
self._files_data_end = files_data_end
|
|
18
|
+
self._download_chunk_size_in_bytes = 100_000
|
|
19
|
+
self._min_chunk_size = min(100_000, max_chunk_size)
|
|
20
|
+
self._max_chunk_size = max_chunk_size
|
|
21
|
+
self._target_download_time_seconds = 1.0
|
|
22
|
+
|
|
23
|
+
self._buffer_start = files_data_start
|
|
24
|
+
self._buffer = bytearray()
|
|
25
|
+
|
|
26
|
+
def seek_and_read(self, file_start: int, file_length: int) -> Iterable[bytes]:
|
|
27
|
+
assert file_start >= self._buffer_start
|
|
28
|
+
self._buffer = self._buffer[file_start - self._buffer_start:] # Returns empty array if "out of bounds"
|
|
29
|
+
self._buffer_start = file_start
|
|
30
|
+
|
|
31
|
+
while True:
|
|
32
|
+
file_byte_count_remaining = file_length - (self._buffer_start - file_start)
|
|
33
|
+
if file_byte_count_remaining == 0:
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
start_of_fetch = self._buffer_start + len(self._buffer)
|
|
37
|
+
byte_count_left_in_stream = self._files_data_end - start_of_fetch
|
|
38
|
+
|
|
39
|
+
if byte_count_left_in_stream != 0:
|
|
40
|
+
# Only fetch if there is still data left upstream
|
|
41
|
+
if self._download_chunk_size_in_bytes > len(self._buffer):
|
|
42
|
+
# Only fetch if size of buffer is below chunk size
|
|
43
|
+
fetch_size = min(byte_count_left_in_stream, self._download_chunk_size_in_bytes)
|
|
44
|
+
|
|
45
|
+
start_time = time.monotonic()
|
|
46
|
+
fetched_data = self._upstream_buffer.get_data(
|
|
47
|
+
start=start_of_fetch,
|
|
48
|
+
length=fetch_size,
|
|
49
|
+
)
|
|
50
|
+
download_time = time.monotonic() - start_time
|
|
51
|
+
|
|
52
|
+
self._buffer.extend(fetched_data)
|
|
53
|
+
|
|
54
|
+
if download_time > 0:
|
|
55
|
+
self._adjust_chunk_size(download_time, fetch_size)
|
|
56
|
+
|
|
57
|
+
bytes_to_yield = self._buffer[:file_byte_count_remaining] # Returns empty array if "out of bounds"
|
|
58
|
+
yield bytes_to_yield
|
|
59
|
+
self._buffer = self._buffer[file_byte_count_remaining:] # Returns empty array if "out of bounds"
|
|
60
|
+
self._buffer_start += len(bytes_to_yield)
|
|
61
|
+
|
|
62
|
+
def _adjust_chunk_size(self, download_time: float, _bytes_downloaded: int) -> None:
|
|
63
|
+
new_chunk_size = self._download_chunk_size_in_bytes
|
|
64
|
+
time_ratio = download_time / self._target_download_time_seconds
|
|
65
|
+
|
|
66
|
+
if time_ratio > 1.1:
|
|
67
|
+
adjustment_factor = 1.0 / time_ratio
|
|
68
|
+
adjustment_factor = max(adjustment_factor, 0.5)
|
|
69
|
+
new_chunk_size = int(self._download_chunk_size_in_bytes * adjustment_factor)
|
|
70
|
+
elif time_ratio < 0.9:
|
|
71
|
+
adjustment_factor = 1.0 / time_ratio
|
|
72
|
+
new_chunk_size = int(self._download_chunk_size_in_bytes * adjustment_factor)
|
|
73
|
+
|
|
74
|
+
new_chunk_size = max(
|
|
75
|
+
self._min_chunk_size,
|
|
76
|
+
min(self._max_chunk_size, new_chunk_size)
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
if new_chunk_size != self._download_chunk_size_in_bytes:
|
|
80
|
+
logger.debug(
|
|
81
|
+
f"Adjusting chunk size: {self._download_chunk_size_in_bytes} -> {new_chunk_size} bytes "
|
|
82
|
+
f"(download_time={download_time:.2f}s, time_ratio={time_ratio:.2f})"
|
|
83
|
+
)
|
|
84
|
+
self._download_chunk_size_in_bytes = new_chunk_size
|
|
@@ -55,7 +55,7 @@ class JobResult:
|
|
|
55
55
|
stream_seeker = StreamSeeker(
|
|
56
56
|
files_data_start=first_file.start,
|
|
57
57
|
files_data_end=last_file.start + last_file.length,
|
|
58
|
-
|
|
58
|
+
max_chunk_size=min(total_files_data_to_download_in_bytes, 10_000_000),
|
|
59
59
|
upstream_buffer=module_output.buffer,
|
|
60
60
|
)
|
|
61
61
|
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from biolib.biolib_binary_format.utils import IndexableBuffer
|
|
2
|
-
from biolib.typing_utils import Iterable
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class StreamSeeker:
|
|
6
|
-
def __init__(
|
|
7
|
-
self,
|
|
8
|
-
upstream_buffer: IndexableBuffer,
|
|
9
|
-
files_data_start: int,
|
|
10
|
-
files_data_end: int,
|
|
11
|
-
download_chunk_size_in_bytes: int,
|
|
12
|
-
):
|
|
13
|
-
self._upstream_buffer = upstream_buffer
|
|
14
|
-
self._files_data_end = files_data_end
|
|
15
|
-
self._download_chunk_size_in_bytes = download_chunk_size_in_bytes
|
|
16
|
-
|
|
17
|
-
self._buffer_start = files_data_start
|
|
18
|
-
self._buffer = bytearray()
|
|
19
|
-
|
|
20
|
-
def seek_and_read(self, file_start: int, file_length: int) -> Iterable[bytes]:
|
|
21
|
-
assert file_start >= self._buffer_start
|
|
22
|
-
self._buffer = self._buffer[file_start - self._buffer_start:] # Returns empty array if "out of bounds"
|
|
23
|
-
self._buffer_start = file_start
|
|
24
|
-
|
|
25
|
-
while True:
|
|
26
|
-
file_byte_count_remaining = file_length - (self._buffer_start - file_start)
|
|
27
|
-
if file_byte_count_remaining == 0:
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
start_of_fetch = self._buffer_start + len(self._buffer)
|
|
31
|
-
byte_count_left_in_stream = self._files_data_end - start_of_fetch
|
|
32
|
-
|
|
33
|
-
if byte_count_left_in_stream != 0:
|
|
34
|
-
# Only fetch if there is still data left upstream
|
|
35
|
-
if self._download_chunk_size_in_bytes > len(self._buffer):
|
|
36
|
-
# Only fetch if size of buffer is below chunk size
|
|
37
|
-
self._buffer.extend(self._upstream_buffer.get_data(
|
|
38
|
-
start=start_of_fetch,
|
|
39
|
-
length=min(byte_count_left_in_stream, self._download_chunk_size_in_bytes),
|
|
40
|
-
))
|
|
41
|
-
|
|
42
|
-
bytes_to_yield = self._buffer[:file_byte_count_remaining] # Returns empty array if "out of bounds"
|
|
43
|
-
yield bytes_to_yield
|
|
44
|
-
self._buffer = self._buffer[file_byte_count_remaining:] # Returns empty array if "out of bounds"
|
|
45
|
-
self._buffer_start += len(bytes_to_yield)
|
|
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.2.1379 → pybiolib-1.2.1389}/biolib/_internal/data_record/remote_storage_endpoint.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/fuse_mount/experiment_fuse_mount.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
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/biolib-sdk.ts
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/dev-data/output.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/package.json
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/gui_template/vite.config.mts
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/.biolib/config.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/_internal/templates/init_template/requirements.txt
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
|
|
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.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/docker_image_cache.py
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/__init__.py
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/docker_executor.py
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/job_worker/executors/docker_types.py
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/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.2.1379 → pybiolib-1.2.1389}/biolib/compute_node/webserver/compute_node_results_proxy.py
RENAMED
|
File without changes
|
{pybiolib-1.2.1379 → pybiolib-1.2.1389}/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
|