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.
Files changed (177) hide show
  1. codalab-1.7.5/LICENSE.txt +12 -0
  2. {codalab-1.7.2 → codalab-1.7.5}/PKG-INFO +8 -5
  3. {codalab-1.7.2 → codalab-1.7.5}/codalab/common.py +1 -1
  4. codalab-1.7.5/codalab/lib/beam/MultiReaderFileStream.py +92 -0
  5. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/upload_manager.py +3 -2
  6. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/mysql_model.py +1 -1
  7. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/download_util.py +0 -1
  8. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/file_util.py +9 -7
  9. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/tar_file_stream.py +3 -0
  10. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/PKG-INFO +8 -5
  11. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/SOURCES.txt +2 -1
  12. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/requires.txt +3 -5
  13. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.server +17 -17
  14. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.worker +20 -20
  15. {codalab-1.7.2 → codalab-1.7.5}/requirements.txt +3 -3
  16. codalab-1.7.5/scripts/migrate-disk-to-blob.py +601 -0
  17. {codalab-1.7.2 → codalab-1.7.5}/setup.py +3 -3
  18. codalab-1.7.2/codalab/lib/beam/MultiReaderFileStream.py +0 -57
  19. codalab-1.7.2/codalab/migration.py +0 -465
  20. {codalab-1.7.2 → codalab-1.7.5}/MANIFEST.in +0 -0
  21. {codalab-1.7.2 → codalab-1.7.5}/README.md +0 -0
  22. {codalab-1.7.2 → codalab-1.7.5}/codalab/__init__.py +0 -0
  23. {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/__init__.py +0 -0
  24. {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/bundle_manager.py +0 -0
  25. {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/cl.py +0 -0
  26. {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/server.py +0 -0
  27. {codalab-1.7.2 → codalab-1.7.5}/codalab/bin/ws_server.py +0 -0
  28. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/__init__.py +0 -0
  29. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/dataset_bundle.py +0 -0
  30. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/derived_bundle.py +0 -0
  31. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/make_bundle.py +0 -0
  32. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/named_bundle.py +0 -0
  33. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/private_bundle.py +0 -0
  34. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/program_bundle.py +0 -0
  35. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/run_bundle.py +0 -0
  36. {codalab-1.7.2 → codalab-1.7.5}/codalab/bundles/uploaded_bundle.py +0 -0
  37. {codalab-1.7.2 → codalab-1.7.5}/codalab/client/__init__.py +0 -0
  38. {codalab-1.7.2 → codalab-1.7.5}/codalab/client/json_api_client.py +0 -0
  39. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/__init__.py +0 -0
  40. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/SQLiteIndexedTar.py +0 -0
  41. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/__init__.py +0 -0
  42. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/blobstorageuploader.py +0 -0
  43. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/filesystems.py +0 -0
  44. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/mockblobstoragefilesystem.py +0 -0
  45. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/beam/streamingzipfile.py +0 -0
  46. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_action.py +0 -0
  47. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_cli.py +0 -0
  48. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_fuse.py +0 -0
  49. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_store.py +0 -0
  50. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/bundle_util.py +0 -0
  51. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/canonicalize.py +0 -0
  52. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/cli_util.py +0 -0
  53. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/codalab_manager.py +0 -0
  54. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/completers.py +0 -0
  55. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/crypt_util.py +0 -0
  56. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/download_manager.py +0 -0
  57. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/editor_util.py +0 -0
  58. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/emailer.py +0 -0
  59. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/file_util.py +0 -0
  60. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/formatting.py +0 -0
  61. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/interactive_session.py +0 -0
  62. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/metadata_defaults.py +0 -0
  63. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/metadata_util.py +0 -0
  64. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/path_util.py +0 -0
  65. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/print_util.py +0 -0
  66. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/profiling_util.py +0 -0
  67. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/server_util.py +0 -0
  68. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/spec_util.py +0 -0
  69. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/telemetry_util.py +0 -0
  70. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/ui_actions.py +0 -0
  71. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/unicode_util.py +0 -0
  72. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/worksheet_util.py +0 -0
  73. {codalab-1.7.2 → codalab-1.7.5}/codalab/lib/zip_util.py +0 -0
  74. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/__init__.py +0 -0
  75. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/bundle_model.py +0 -0
  76. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/orm_object.py +0 -0
  77. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/sqlite_model.py +0 -0
  78. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/tables.py +0 -0
  79. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/util.py +0 -0
  80. {codalab-1.7.2 → codalab-1.7.5}/codalab/model/worker_model.py +0 -0
  81. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/__init__.py +0 -0
  82. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/bundle.py +0 -0
  83. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/dependency.py +0 -0
  84. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/metadata.py +0 -0
  85. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/metadata_spec.py +0 -0
  86. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/oauth2.py +0 -0
  87. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/permission.py +0 -0
  88. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/user.py +0 -0
  89. {codalab-1.7.2 → codalab-1.7.5}/codalab/objects/worksheet.py +0 -0
  90. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/__init__.py +0 -0
  91. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/account.py +0 -0
  92. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/bundle_actions.py +0 -0
  93. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/bundles.py +0 -0
  94. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/cli.py +0 -0
  95. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/groups.py +0 -0
  96. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/help.py +0 -0
  97. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/interpret.py +0 -0
  98. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/oauth2.py +0 -0
  99. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/schemas.py +0 -0
  100. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/users.py +0 -0
  101. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/util.py +0 -0
  102. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/workers.py +0 -0
  103. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/worksheet_block_schemas.py +0 -0
  104. {codalab-1.7.2 → codalab-1.7.5}/codalab/rest/worksheets.py +0 -0
  105. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/__init__.py +0 -0
  106. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/auth.py +0 -0
  107. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/authenticated_plugin.py +0 -0
  108. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/bundle_manager.py +0 -0
  109. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/cookie.py +0 -0
  110. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/json_api_plugin.py +0 -0
  111. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/oauth2_provider.py +0 -0
  112. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/rest_server.py +0 -0
  113. {codalab-1.7.2 → codalab-1.7.5}/codalab/server/worker_info_accessor.py +0 -0
  114. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/__init__.py +0 -0
  115. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/bundle_service_client.py +0 -0
  116. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/bundle_state.py +0 -0
  117. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/dependency_manager.py +0 -0
  118. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/docker_image_manager.py +0 -0
  119. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/docker_utils.py +0 -0
  120. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/fsm.py +0 -0
  121. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/image_manager.py +0 -0
  122. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/main.py +0 -0
  123. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/noop_image_manager.py +0 -0
  124. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/pyjson.py +0 -0
  125. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/reader.py +0 -0
  126. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/rest_client.py +0 -0
  127. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/runtime/__init__.py +0 -0
  128. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/runtime/kubernetes_runtime.py +0 -0
  129. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/singularity_image_manager.py +0 -0
  130. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/state_committer.py +0 -0
  131. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/tar_subdir_stream.py +0 -0
  132. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/un_gzip_stream.py +0 -0
  133. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/un_tar_directory.py +0 -0
  134. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/upload_util.py +0 -0
  135. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker.py +0 -0
  136. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_monitoring.py +0 -0
  137. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_run_state.py +0 -0
  138. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker/worker_thread.py +0 -0
  139. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/__init__.py +0 -0
  140. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/aws_batch_worker_manager.py +0 -0
  141. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/azure_batch_worker_manager.py +0 -0
  142. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/kubernetes_worker_manager.py +0 -0
  143. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/main.py +0 -0
  144. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/slurm_batch_worker_manager.py +0 -0
  145. {codalab-1.7.2 → codalab-1.7.5}/codalab/worker_manager/worker_manager.py +0 -0
  146. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/dependency_links.txt +0 -0
  147. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/entry_points.txt +0 -0
  148. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/not-zip-safe +0 -0
  149. {codalab-1.7.2 → codalab-1.7.5}/codalab.egg-info/top_level.txt +0 -0
  150. {codalab-1.7.2 → codalab-1.7.5}/codalab_service.py +0 -0
  151. {codalab-1.7.2 → codalab-1.7.5}/docker_config/.dockerignore +0 -0
  152. {codalab-1.7.2 → codalab-1.7.5}/docker_config/__init__.py +0 -0
  153. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/__init__.py +0 -0
  154. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.dev.yml +0 -0
  155. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.ssl.yml +0 -0
  156. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/docker-compose.yml +0 -0
  157. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/__init__.py +0 -0
  158. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/nginx.conf +0 -0
  159. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/nginx.conf.ssl +0 -0
  160. {codalab-1.7.2 → codalab-1.7.5}/docker_config/compose_files/files/wait-for-it.sh +0 -0
  161. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.default-cpu +0 -0
  162. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.default-gpu +0 -0
  163. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/Dockerfile.frontend +0 -0
  164. {codalab-1.7.2 → codalab-1.7.5}/docker_config/dockerfiles/__init__.py +0 -0
  165. {codalab-1.7.2 → codalab-1.7.5}/pyproject.toml +0 -0
  166. {codalab-1.7.2 → codalab-1.7.5}/rc +0 -0
  167. {codalab-1.7.2 → codalab-1.7.5}/scripts/__init__.py +0 -0
  168. {codalab-1.7.2 → codalab-1.7.5}/scripts/competitiond.py +0 -0
  169. {codalab-1.7.2 → codalab-1.7.5}/scripts/create-root-user.py +0 -0
  170. {codalab-1.7.2 → codalab-1.7.5}/scripts/create_sample_worksheet.py +0 -0
  171. {codalab-1.7.2 → codalab-1.7.5}/scripts/gen-cli-docs.py +0 -0
  172. {codalab-1.7.2 → codalab-1.7.5}/scripts/gen-rest-docs.py +0 -0
  173. {codalab-1.7.2 → codalab-1.7.5}/scripts/initialize-azurite.py +0 -0
  174. {codalab-1.7.2 → codalab-1.7.5}/scripts/send-email-notifications.py +0 -0
  175. {codalab-1.7.2 → codalab-1.7.5}/scripts/test_util.py +0 -0
  176. {codalab-1.7.2 → codalab-1.7.5}/scripts/upload-mlcomp.py +0 -0
  177. {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.2
1
+ Metadata-Version: 2.1
2
2
  Name: codalab
3
- Version: 1.7.2
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.6
12
+ Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: License :: OSI Approved :: Apache Software License
15
- Requires-Python: ~=3.6
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.2'
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
- CHUNK_SIZE = 16 * 1024
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 = 2000
263
+ ITERATIONS_PER_DISK_CHECK = 32
263
264
  bytes_uploaded = 0
264
265
 
265
266
  with FileSystems.create(
@@ -70,4 +70,4 @@ class MySQLModel(BundleModel):
70
70
  return value.encode()
71
71
 
72
72
  def decode_str(self, value):
73
- return array.array('B', [ord(char) for char in value]).tostring().decode()
73
+ return array.array('B', [ord(char) for char in value]).tobytes().decode()
@@ -317,5 +317,4 @@ def compute_target_info_blob_descendants_flat(path: str) -> Generator[TargetInfo
317
317
 
318
318
  yield cast(TargetInfo, dict(target_info, contents=None, name=""))
319
319
  for t in target_info.get('contents') or []:
320
- print("CONTENTT", t)
321
320
  yield from get_results(t)
@@ -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=None,
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=None,
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__(self, path: str, mode='rb', gzipped=False):
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.2
1
+ Metadata-Version: 2.1
2
2
  Name: codalab
3
- Version: 1.7.2
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.6
12
+ Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: License :: OSI Approved :: Apache Software License
15
- Requires-Python: ~=3.6
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==5.4
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
- 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/*;
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
- # Miniconda 4.5.11 installs Python 3.7 by default.
27
- RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh && \
28
- chmod +x ~/miniconda.sh && \
29
- ~/miniconda.sh -b -p /opt/conda && \
30
- rm ~/miniconda.sh
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
- 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/*;
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
- # Miniconda 4.5.11 installs Python 3.7 by default.
24
- RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh && \
25
- chmod +x ~/miniconda.sh && \
26
- ~/miniconda.sh -b -p /opt/conda && \
27
- rm ~/miniconda.sh
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
- python3 -m pip install setuptools --upgrade; \
42
- python3 -m pip install --no-cache-dir -r requirements.txt;
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==5.4
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