codalab 1.7.2__tar.gz → 1.7.5__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.
- codalab-1.7.5/LICENSE.txt +12 -0
- {codalab-1.7.2 → codalab-1.7.5}/PKG-INFO +8 -5
- {codalab-1.7.2 → codalab-1.7.5}/codalab/common.py +1 -1
- codalab-1.7.5/codalab/lib/beam/MultiReaderFileStream.py +92 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/upload_manager.py +3 -2
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/mysql_model.py +1 -1
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/download_util.py +0 -1
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/file_util.py +9 -7
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/tar_file_stream.py +3 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/PKG-INFO +8 -5
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/SOURCES.txt +2 -1
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/requires.txt +3 -5
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.server +17 -17
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.worker +20 -20
- {codalab-1.7.2 → codalab-1.7.5}/requirements.txt +3 -3
- codalab-1.7.5/scripts/migrate-disk-to-blob.py +601 -0
- {codalab-1.7.2 → codalab-1.7.5}/setup.py +3 -3
- codalab-1.7.2/codalab/lib/beam/MultiReaderFileStream.py +0 -57
- codalab-1.7.2/codalab/migration.py +0 -465
- {codalab-1.7.2 → codalab-1.7.5}/MANIFEST.in +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/README.md +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/bundle_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/cl.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/server.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/ws_server.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/dataset_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/derived_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/make_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/named_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/private_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/program_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/run_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/uploaded_bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/client/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/client/json_api_client.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/SQLiteIndexedTar.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/blobstorageuploader.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/filesystems.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/mockblobstoragefilesystem.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/streamingzipfile.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_action.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_cli.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_fuse.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_store.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/canonicalize.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/cli_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/codalab_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/completers.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/crypt_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/download_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/editor_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/emailer.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/file_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/formatting.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/interactive_session.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/metadata_defaults.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/metadata_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/path_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/print_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/profiling_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/server_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/spec_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/telemetry_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/ui_actions.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/unicode_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/worksheet_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/zip_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/bundle_model.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/orm_object.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/sqlite_model.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/tables.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/model/worker_model.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/bundle.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/dependency.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/metadata.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/metadata_spec.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/oauth2.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/permission.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/user.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/worksheet.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/account.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/bundle_actions.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/bundles.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/cli.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/groups.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/help.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/interpret.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/oauth2.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/schemas.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/users.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/workers.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/worksheet_block_schemas.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/worksheets.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/auth.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/authenticated_plugin.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/bundle_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/cookie.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/json_api_plugin.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/oauth2_provider.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/rest_server.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/server/worker_info_accessor.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/bundle_service_client.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/bundle_state.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/dependency_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/docker_image_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/docker_utils.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/fsm.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/image_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/main.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/noop_image_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/pyjson.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/reader.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/rest_client.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/runtime/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/runtime/kubernetes_runtime.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/singularity_image_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/state_committer.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/tar_subdir_stream.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/un_gzip_stream.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/un_tar_directory.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/upload_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_monitoring.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_run_state.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_thread.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/aws_batch_worker_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/azure_batch_worker_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/kubernetes_worker_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/main.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/slurm_batch_worker_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/worker_manager.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/dependency_links.txt +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/entry_points.txt +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/not-zip-safe +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/top_level.txt +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/codalab_service.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/.dockerignore +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.dev.yml +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.ssl.yml +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.yml +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/nginx.conf +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/nginx.conf.ssl +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/wait-for-it.sh +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.default-cpu +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.default-gpu +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.frontend +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/pyproject.toml +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/rc +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/__init__.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/competitiond.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/create-root-user.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/create_sample_worksheet.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/gen-cli-docs.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/gen-rest-docs.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/initialize-azurite.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/send-email-notifications.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/test_util.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/scripts/upload-mlcomp.py +0 -0
- {codalab-1.7.2 → codalab-1.7.5}/setup.cfg +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2016, Stanford University.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
10
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
12
|
+
specific language governing permissions and limitations under the License.
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 1
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: codalab
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.5
|
|
4
4
|
Summary: CLI for CodaLab, a platform for reproducible computation
|
|
5
5
|
Home-page: https://github.com/codalab/codalab-worksheets
|
|
6
6
|
Author: CodaLab
|
|
7
7
|
Author-email: codalab.worksheets@gmail.com
|
|
8
8
|
License: Apache License 2.0
|
|
9
|
-
Description: Visit https://worksheets.codalab.org/ or setup your own server by following the instructions in the documentation (https://codalab-worksheets.readthedocs.io/en/latest/Server-Setup).
|
|
10
9
|
Keywords: codalab reproducible computation worksheets competitions
|
|
11
10
|
Platform: UNKNOWN
|
|
12
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
-
Requires-Python: ~=3.
|
|
14
|
+
Requires-Python: ~=3.9
|
|
15
|
+
License-File: LICENSE.txt
|
|
16
|
+
|
|
17
|
+
Visit https://worksheets.codalab.org/ or setup your own server by following the instructions in the documentation (https://codalab-worksheets.readthedocs.io/en/latest/Server-Setup).
|
|
18
|
+
|
|
@@ -29,7 +29,7 @@ from codalab.lib.beam.filesystems import (
|
|
|
29
29
|
|
|
30
30
|
# Increment this on master when ready to cut a release.
|
|
31
31
|
# http://semver.org/
|
|
32
|
-
CODALAB_VERSION = '1.7.
|
|
32
|
+
CODALAB_VERSION = '1.7.5'
|
|
33
33
|
BINARY_PLACEHOLDER = '<binary>'
|
|
34
34
|
URLOPEN_TIMEOUT_SECONDS = int(os.environ.get('CODALAB_URLOPEN_TIMEOUT_SECONDS', 5 * 60))
|
|
35
35
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from io import BytesIO, SEEK_SET, SEEK_END
|
|
4
|
+
from threading import Lock
|
|
5
|
+
class MultiReaderFileStream(BytesIO):
|
|
6
|
+
"""
|
|
7
|
+
FileStream that takes an input stream fileobj, and supports N readers with the following features and constraints:
|
|
8
|
+
- Each reader's postion is tracked
|
|
9
|
+
- A buffer of bytes() is stored which stores bytes from the position of the slowest reader
|
|
10
|
+
minus a LOOKBACK_LENGTH (default 32 MiB) to the fastest reader
|
|
11
|
+
- The fastest reader can be at most MAX_THRESHOLD (default 64 MiB) ahead of the slowest reader, reads made
|
|
12
|
+
further than 64MiB will sleep until the slowest reader catches up
|
|
13
|
+
"""
|
|
14
|
+
NUM_READERS = 2
|
|
15
|
+
|
|
16
|
+
def __init__(self, fileobj, lookback_length=32*1024*1024):
|
|
17
|
+
self._buffer = bytes() # Buffer of bytes read from the file object within the limits defined
|
|
18
|
+
self._buffer_start_pos = 0 # start position of buffer in the fileobj (min reader position - LOOKBACK LENGTH)
|
|
19
|
+
self._pos = [0 for _ in range(self.NUM_READERS)] # position of each reader in the fileobj
|
|
20
|
+
self._fileobj = fileobj # The original file object the readers are reading from
|
|
21
|
+
self._lock = Lock() # lock to ensure one does not concurrently read self._fileobj / write to the buffer.
|
|
22
|
+
class FileStreamReader(BytesIO):
|
|
23
|
+
def __init__(s, index):
|
|
24
|
+
s._index = index
|
|
25
|
+
|
|
26
|
+
def read(s, num_bytes=None):
|
|
27
|
+
return self.read(s._index, num_bytes)
|
|
28
|
+
|
|
29
|
+
def peek(s, num_bytes):
|
|
30
|
+
return self.peek(s._index, num_bytes)
|
|
31
|
+
|
|
32
|
+
def seek(s, offset, whence=SEEK_SET):
|
|
33
|
+
return self.seek(s._index, offset, whence)
|
|
34
|
+
|
|
35
|
+
self.readers = [FileStreamReader(i) for i in range(0, self.NUM_READERS)]
|
|
36
|
+
self.LOOKBACK_LENGTH = lookback_length
|
|
37
|
+
self.MAX_THRESHOLD = self.LOOKBACK_LENGTH * 2
|
|
38
|
+
|
|
39
|
+
def _fill_buf_bytes(self, num_bytes=0):
|
|
40
|
+
"""
|
|
41
|
+
Fills the buffer with bytes from the fileobj
|
|
42
|
+
"""
|
|
43
|
+
s = self._fileobj.read(num_bytes)
|
|
44
|
+
if not s:
|
|
45
|
+
return
|
|
46
|
+
self._buffer += s
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def read(self, index: int, num_bytes: int): # type: ignore
|
|
50
|
+
"""Read the specified number of bytes from the associated file.
|
|
51
|
+
index: index that specifies which reader is reading.
|
|
52
|
+
"""
|
|
53
|
+
s = self.peek(index, num_bytes)
|
|
54
|
+
with self._lock:
|
|
55
|
+
# Modify reader position in fileobj
|
|
56
|
+
self._pos[index] += len(s)
|
|
57
|
+
|
|
58
|
+
# If this reader is the minimum reader, we can remove some bytes from the beginning of the buffer
|
|
59
|
+
# Calculated min position of buffer minus current min position of buffer
|
|
60
|
+
diff = (min(self._pos) - self.LOOKBACK_LENGTH) - self._buffer_start_pos
|
|
61
|
+
# NOTE: it's possible for diff < 0 if seek backwards occur
|
|
62
|
+
if diff > 0:
|
|
63
|
+
self._buffer = self._buffer[diff:]
|
|
64
|
+
self._buffer_start_pos += diff
|
|
65
|
+
return s
|
|
66
|
+
|
|
67
|
+
def peek(self, index: int, num_bytes: int): # type: ignore
|
|
68
|
+
new_pos = self._pos[index] + num_bytes
|
|
69
|
+
while new_pos - self._buffer_start_pos > self.MAX_THRESHOLD:
|
|
70
|
+
time.sleep(.1) # 100 ms
|
|
71
|
+
|
|
72
|
+
with self._lock:
|
|
73
|
+
# Calculate how many new bytes need to be read
|
|
74
|
+
new_bytes_needed = new_pos - max(self._pos)
|
|
75
|
+
if new_bytes_needed > 0:
|
|
76
|
+
self._fill_buf_bytes(new_bytes_needed)
|
|
77
|
+
|
|
78
|
+
# Get the bytes in the buffer that correspond to the read function call
|
|
79
|
+
buffer_index = self._pos[index] - self._buffer_start_pos
|
|
80
|
+
s = self._buffer[buffer_index:buffer_index + num_bytes]
|
|
81
|
+
|
|
82
|
+
return s
|
|
83
|
+
|
|
84
|
+
def seek(self, index: int, offset: int, whence=SEEK_SET):
|
|
85
|
+
if whence == SEEK_END:
|
|
86
|
+
super().seek(offset, whence)
|
|
87
|
+
else:
|
|
88
|
+
assert offset >= self._buffer_start_pos
|
|
89
|
+
self._pos[index] = offset
|
|
90
|
+
|
|
91
|
+
def close(self):
|
|
92
|
+
self.__input.close()
|
|
@@ -255,11 +255,12 @@ class BlobStorageUploader(Uploader):
|
|
|
255
255
|
conn_str = os.environ.get('AZURE_STORAGE_CONNECTION_STRING', '')
|
|
256
256
|
os.environ['AZURE_STORAGE_CONNECTION_STRING'] = bundle_conn_str
|
|
257
257
|
try:
|
|
258
|
-
|
|
258
|
+
# Chunk size set to 1MiB for performance
|
|
259
|
+
CHUNK_SIZE = 1024 * 1024
|
|
259
260
|
|
|
260
261
|
def upload_file_content():
|
|
261
262
|
iteration = 0
|
|
262
|
-
ITERATIONS_PER_DISK_CHECK =
|
|
263
|
+
ITERATIONS_PER_DISK_CHECK = 32
|
|
263
264
|
bytes_uploaded = 0
|
|
264
265
|
|
|
265
266
|
with FileSystems.create(
|
|
@@ -21,7 +21,7 @@ import tempfile
|
|
|
21
21
|
# from ratarmountcore import SQLiteIndexedTar, FileInfo
|
|
22
22
|
from ratarmountcore import FileInfo
|
|
23
23
|
from codalab.lib.beam.SQLiteIndexedTar import SQLiteIndexedTar # type: ignore
|
|
24
|
-
from typing import IO, cast
|
|
24
|
+
from typing import IO, List, Optional, cast
|
|
25
25
|
|
|
26
26
|
NONE_PLACEHOLDER = '<none>'
|
|
27
27
|
|
|
@@ -50,7 +50,7 @@ def get_path_exists(path):
|
|
|
50
50
|
def tar_gzip_directory(
|
|
51
51
|
directory_path,
|
|
52
52
|
follow_symlinks=False,
|
|
53
|
-
exclude_patterns=
|
|
53
|
+
exclude_patterns=ALWAYS_IGNORE_PATTERNS,
|
|
54
54
|
exclude_names=None,
|
|
55
55
|
ignore_file=None,
|
|
56
56
|
):
|
|
@@ -79,7 +79,6 @@ def tar_gzip_directory(
|
|
|
79
79
|
if not exclude_patterns:
|
|
80
80
|
exclude_patterns = []
|
|
81
81
|
|
|
82
|
-
exclude_patterns.extend(ALWAYS_IGNORE_PATTERNS)
|
|
83
82
|
for pattern in exclude_patterns:
|
|
84
83
|
args.append('--exclude=' + pattern)
|
|
85
84
|
|
|
@@ -99,7 +98,7 @@ def tar_gzip_directory(
|
|
|
99
98
|
def zip_directory(
|
|
100
99
|
directory_path,
|
|
101
100
|
follow_symlinks=False,
|
|
102
|
-
exclude_patterns=
|
|
101
|
+
exclude_patterns=ALWAYS_IGNORE_PATTERNS,
|
|
103
102
|
exclude_names=None,
|
|
104
103
|
ignore_file=None,
|
|
105
104
|
):
|
|
@@ -135,7 +134,6 @@ def zip_directory(
|
|
|
135
134
|
if not exclude_patterns:
|
|
136
135
|
exclude_patterns = []
|
|
137
136
|
|
|
138
|
-
exclude_patterns.extend(ALWAYS_IGNORE_PATTERNS)
|
|
139
137
|
for pattern in exclude_patterns:
|
|
140
138
|
args.append(f'--exclude=*{pattern}*')
|
|
141
139
|
|
|
@@ -241,8 +239,11 @@ class OpenFile(object):
|
|
|
241
239
|
path: str
|
|
242
240
|
mode: str
|
|
243
241
|
gzipped: bool
|
|
242
|
+
exclude_patterns: Optional[List[str]]
|
|
244
243
|
|
|
245
|
-
def __init__(
|
|
244
|
+
def __init__(
|
|
245
|
+
self, path: str, mode='rb', gzipped=False, exclude_patterns=ALWAYS_IGNORE_PATTERNS
|
|
246
|
+
):
|
|
246
247
|
"""Initialize OpenFile.
|
|
247
248
|
|
|
248
249
|
Args:
|
|
@@ -255,6 +256,7 @@ class OpenFile(object):
|
|
|
255
256
|
self.path = path
|
|
256
257
|
self.mode = mode
|
|
257
258
|
self.gzipped = gzipped
|
|
259
|
+
self.exclude_patterns = exclude_patterns
|
|
258
260
|
|
|
259
261
|
def __enter__(self) -> IO[bytes]:
|
|
260
262
|
linked_bundle_path = parse_linked_bundle_url(self.path)
|
|
@@ -296,7 +298,7 @@ class OpenFile(object):
|
|
|
296
298
|
if os.path.isdir(self.path):
|
|
297
299
|
if not self.gzipped:
|
|
298
300
|
raise IOError("Directories must be gzipped.")
|
|
299
|
-
return tar_gzip_directory(self.path)
|
|
301
|
+
return tar_gzip_directory(self.path, exclude_patterns=self.exclude_patterns)
|
|
300
302
|
if self.gzipped:
|
|
301
303
|
raise IOError(
|
|
302
304
|
"Gzipping local files from disk from OpenFile is not yet supported. Please use file_util.gzip_file instead."
|
|
@@ -45,7 +45,10 @@ class TarFileStream(BytesIO):
|
|
|
45
45
|
"""Read the specified number of bytes from the associated file.
|
|
46
46
|
"""
|
|
47
47
|
while (self.pos < self.finfo.size) and (num_bytes is None or len(self._buffer) < num_bytes):
|
|
48
|
+
old_pos = self.pos
|
|
48
49
|
self._read_from_tar(num_bytes)
|
|
50
|
+
if old_pos == self.pos:
|
|
51
|
+
raise Exception(f"At {self.pos} < {self.finfo.size}, but read did not advance (prevent infinite loop)")
|
|
49
52
|
if num_bytes is None:
|
|
50
53
|
num_bytes = len(self._buffer)
|
|
51
54
|
return self._buffer.read(num_bytes)
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 1
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: codalab
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.5
|
|
4
4
|
Summary: CLI for CodaLab, a platform for reproducible computation
|
|
5
5
|
Home-page: https://github.com/codalab/codalab-worksheets
|
|
6
6
|
Author: CodaLab
|
|
7
7
|
Author-email: codalab.worksheets@gmail.com
|
|
8
8
|
License: Apache License 2.0
|
|
9
|
-
Description: Visit https://worksheets.codalab.org/ or setup your own server by following the instructions in the documentation (https://codalab-worksheets.readthedocs.io/en/latest/Server-Setup).
|
|
10
9
|
Keywords: codalab reproducible computation worksheets competitions
|
|
11
10
|
Platform: UNKNOWN
|
|
12
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
-
Requires-Python: ~=3.
|
|
14
|
+
Requires-Python: ~=3.9
|
|
15
|
+
License-File: LICENSE.txt
|
|
16
|
+
|
|
17
|
+
Visit https://worksheets.codalab.org/ or setup your own server by following the instructions in the documentation (https://codalab-worksheets.readthedocs.io/en/latest/Server-Setup).
|
|
18
|
+
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
LICENSE.txt
|
|
1
2
|
MANIFEST.in
|
|
2
3
|
README.md
|
|
3
4
|
codalab_service.py
|
|
@@ -8,7 +9,6 @@ setup.cfg
|
|
|
8
9
|
setup.py
|
|
9
10
|
codalab/__init__.py
|
|
10
11
|
codalab/common.py
|
|
11
|
-
codalab/migration.py
|
|
12
12
|
codalab.egg-info/PKG-INFO
|
|
13
13
|
codalab.egg-info/SOURCES.txt
|
|
14
14
|
codalab.egg-info/dependency_links.txt
|
|
@@ -168,6 +168,7 @@ scripts/create_sample_worksheet.py
|
|
|
168
168
|
scripts/gen-cli-docs.py
|
|
169
169
|
scripts/gen-rest-docs.py
|
|
170
170
|
scripts/initialize-azurite.py
|
|
171
|
+
scripts/migrate-disk-to-blob.py
|
|
171
172
|
scripts/send-email-notifications.py
|
|
172
173
|
scripts/test_util.py
|
|
173
174
|
scripts/upload-mlcomp.py
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
wheel==0.43.0
|
|
1
2
|
apache-beam[azure]==2.38.0
|
|
2
3
|
cachetools<5,>=3.1.0
|
|
3
4
|
google-apitools<0.5.32,>=0.5.31
|
|
@@ -10,7 +11,7 @@ setuptools>=40.0.0
|
|
|
10
11
|
argcomplete==1.12.3
|
|
11
12
|
indexed_gzip==1.7.0
|
|
12
13
|
ratarmountcore==0.1.3
|
|
13
|
-
PyYAML==
|
|
14
|
+
PyYAML==6.0.1
|
|
14
15
|
psutil==5.7.2
|
|
15
16
|
six==1.15.0
|
|
16
17
|
SQLAlchemy==1.3.19
|
|
@@ -28,7 +29,6 @@ sentry-sdk==1.14.0
|
|
|
28
29
|
requests-oauthlib==1.1.0
|
|
29
30
|
oauthlib==2.1.0
|
|
30
31
|
markdown2==2.4.0
|
|
31
|
-
wheel==0.35.1
|
|
32
32
|
urllib3==1.26.11
|
|
33
33
|
retry==0.9.2
|
|
34
34
|
spython==0.1.14
|
|
@@ -37,6 +37,4 @@ websockets==9.1
|
|
|
37
37
|
kubernetes==12.0.1
|
|
38
38
|
google-cloud-storage==2.0.0
|
|
39
39
|
httpio==0.3.0
|
|
40
|
-
|
|
41
|
-
[:python_version < "3.7"]
|
|
42
|
-
dataclasses==0.7
|
|
40
|
+
memory_profiler==0.61.0
|
|
@@ -7,27 +7,27 @@ RUN apt-get update && \
|
|
|
7
7
|
apt-get install -y --no-install-recommends software-properties-common && \
|
|
8
8
|
apt-get update && \
|
|
9
9
|
apt-get install -y --no-install-recommends \
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
build-essential \
|
|
11
|
+
curl \
|
|
12
|
+
git \
|
|
13
|
+
libfuse-dev \
|
|
14
|
+
libjpeg-dev \
|
|
15
|
+
libmysqlclient-dev \
|
|
16
|
+
libssl-dev \
|
|
17
|
+
mysql-client \
|
|
18
|
+
zip \
|
|
19
|
+
unzip \
|
|
20
|
+
rsync && \
|
|
21
|
+
rm -rf /var/lib/apt/lists/*;
|
|
22
22
|
|
|
23
23
|
### Without this Python thinks we're ASCII and unicode chars fail
|
|
24
24
|
ENV LANG C.UTF-8
|
|
25
25
|
|
|
26
|
-
#
|
|
27
|
-
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
# Python 3.9 Version of miniconda 23.5.2
|
|
27
|
+
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-py39_23.5.2-0-Linux-x86_64.sh && \
|
|
28
|
+
chmod +x ~/miniconda.sh && \
|
|
29
|
+
~/miniconda.sh -b -p /opt/conda && \
|
|
30
|
+
rm ~/miniconda.sh
|
|
31
31
|
ENV PATH /opt/conda/bin:$PATH
|
|
32
32
|
RUN conda --version
|
|
33
33
|
|
|
@@ -6,25 +6,25 @@ RUN apt-get update && \
|
|
|
6
6
|
apt-get install -y --no-install-recommends software-properties-common curl && \
|
|
7
7
|
apt-get update && \
|
|
8
8
|
apt-get install -y --no-install-recommends \
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
amazon-ecr-credential-helper \
|
|
10
|
+
build-essential \
|
|
11
|
+
libssl-dev \
|
|
12
|
+
uuid-dev \
|
|
13
|
+
libgpgme11-dev \
|
|
14
|
+
squashfs-tools \
|
|
15
|
+
libseccomp-dev \
|
|
16
|
+
pkg-config \
|
|
17
|
+
zip \
|
|
18
|
+
git \
|
|
19
|
+
wget \
|
|
20
|
+
unzip && \
|
|
21
|
+
rm -rf /var/lib/apt/lists/*;
|
|
22
22
|
|
|
23
|
-
#
|
|
24
|
-
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
# Python 3.9 Version of miniconda 23.5.2
|
|
24
|
+
RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-py39_23.5.2-0-Linux-x86_64.sh && \
|
|
25
|
+
chmod +x ~/miniconda.sh && \
|
|
26
|
+
~/miniconda.sh -b -p /opt/conda && \
|
|
27
|
+
rm ~/miniconda.sh
|
|
28
28
|
ENV PATH /opt/conda/bin:$PATH
|
|
29
29
|
RUN conda --version
|
|
30
30
|
|
|
@@ -38,8 +38,8 @@ RUN mkdir ${WORKDIR}/scripts
|
|
|
38
38
|
# Install dependencies
|
|
39
39
|
COPY requirements.txt requirements.txt
|
|
40
40
|
RUN python3 -m pip install --user --upgrade pip==20.3.4; \
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
python3 -m pip install setuptools --upgrade; \
|
|
42
|
+
python3 -m pip install --no-cache-dir -r requirements.txt;
|
|
43
43
|
|
|
44
44
|
# Install code
|
|
45
45
|
COPY setup.py setup.py
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
wheel==0.43.0
|
|
1
2
|
apache-beam[azure]==2.38.0
|
|
2
3
|
|
|
3
4
|
# GCP requirements for apache-beam. Note: when upgrading
|
|
@@ -10,7 +11,6 @@ google-auth>=1.18.0,<3
|
|
|
10
11
|
|
|
11
12
|
# Remaining requirements
|
|
12
13
|
bottle==0.12.20
|
|
13
|
-
dataclasses==0.7;python_version<'3.7'
|
|
14
14
|
docker==4.3.0
|
|
15
15
|
marshmallow-jsonapi==0.15.1
|
|
16
16
|
marshmallow==2.15.1
|
|
@@ -18,7 +18,7 @@ setuptools>=40.0.0
|
|
|
18
18
|
argcomplete==1.12.3
|
|
19
19
|
indexed_gzip==1.7.0
|
|
20
20
|
ratarmountcore==0.1.3
|
|
21
|
-
PyYAML==
|
|
21
|
+
PyYAML==6.0.1
|
|
22
22
|
psutil==5.7.2
|
|
23
23
|
six==1.15.0
|
|
24
24
|
SQLAlchemy==1.3.19
|
|
@@ -36,7 +36,6 @@ sentry-sdk==1.14.0
|
|
|
36
36
|
requests-oauthlib==1.1.0
|
|
37
37
|
oauthlib==2.1.0
|
|
38
38
|
markdown2==2.4.0
|
|
39
|
-
wheel==0.35.1
|
|
40
39
|
urllib3==1.26.11
|
|
41
40
|
retry==0.9.2
|
|
42
41
|
spython==0.1.14
|
|
@@ -45,3 +44,4 @@ websockets==9.1
|
|
|
45
44
|
kubernetes==12.0.1
|
|
46
45
|
google-cloud-storage==2.0.0
|
|
47
46
|
httpio==0.3.0
|
|
47
|
+
memory_profiler==0.61.0
|