codalab 1.7.3__tar.gz → 1.7.6__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 (179) hide show
  1. codalab-1.7.6/LICENSE.txt +12 -0
  2. codalab-1.7.6/PKG-INFO +67 -0
  3. {codalab-1.7.3 → codalab-1.7.6}/codalab/common.py +1 -1
  4. codalab-1.7.6/codalab/lib/beam/MultiReaderFileStream.py +92 -0
  5. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/SQLiteIndexedTar.py +4 -2
  6. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/upload_manager.py +3 -2
  7. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/mysql_model.py +1 -1
  8. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/download_util.py +46 -39
  9. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/file_util.py +12 -7
  10. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/tar_file_stream.py +3 -0
  11. codalab-1.7.6/codalab.egg-info/PKG-INFO +67 -0
  12. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/SOURCES.txt +2 -1
  13. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/entry_points.txt +0 -1
  14. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/requires.txt +4 -6
  15. {codalab-1.7.3 → codalab-1.7.6}/codalab_service.py +9 -1
  16. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/docker-compose.yml +2 -2
  17. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/Dockerfile.server +19 -19
  18. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/Dockerfile.worker +21 -21
  19. {codalab-1.7.3 → codalab-1.7.6}/pyproject.toml +6 -0
  20. {codalab-1.7.3 → codalab-1.7.6}/requirements.txt +4 -4
  21. codalab-1.7.6/scripts/migrate-disk-to-blob.py +601 -0
  22. {codalab-1.7.3 → codalab-1.7.6}/setup.py +3 -3
  23. codalab-1.7.3/PKG-INFO +0 -15
  24. codalab-1.7.3/codalab/lib/beam/MultiReaderFileStream.py +0 -57
  25. codalab-1.7.3/codalab/migration.py +0 -266
  26. codalab-1.7.3/codalab.egg-info/PKG-INFO +0 -15
  27. {codalab-1.7.3 → codalab-1.7.6}/MANIFEST.in +0 -0
  28. {codalab-1.7.3 → codalab-1.7.6}/README.md +0 -0
  29. {codalab-1.7.3 → codalab-1.7.6}/codalab/__init__.py +0 -0
  30. {codalab-1.7.3 → codalab-1.7.6}/codalab/bin/__init__.py +0 -0
  31. {codalab-1.7.3 → codalab-1.7.6}/codalab/bin/bundle_manager.py +0 -0
  32. {codalab-1.7.3 → codalab-1.7.6}/codalab/bin/cl.py +0 -0
  33. {codalab-1.7.3 → codalab-1.7.6}/codalab/bin/server.py +0 -0
  34. {codalab-1.7.3 → codalab-1.7.6}/codalab/bin/ws_server.py +0 -0
  35. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/__init__.py +0 -0
  36. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/dataset_bundle.py +0 -0
  37. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/derived_bundle.py +0 -0
  38. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/make_bundle.py +0 -0
  39. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/named_bundle.py +0 -0
  40. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/private_bundle.py +0 -0
  41. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/program_bundle.py +0 -0
  42. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/run_bundle.py +0 -0
  43. {codalab-1.7.3 → codalab-1.7.6}/codalab/bundles/uploaded_bundle.py +0 -0
  44. {codalab-1.7.3 → codalab-1.7.6}/codalab/client/__init__.py +0 -0
  45. {codalab-1.7.3 → codalab-1.7.6}/codalab/client/json_api_client.py +0 -0
  46. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/__init__.py +0 -0
  47. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/__init__.py +0 -0
  48. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/blobstorageuploader.py +0 -0
  49. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/filesystems.py +0 -0
  50. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/mockblobstoragefilesystem.py +0 -0
  51. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/beam/streamingzipfile.py +0 -0
  52. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/bundle_action.py +0 -0
  53. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/bundle_cli.py +0 -0
  54. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/bundle_fuse.py +0 -0
  55. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/bundle_store.py +0 -0
  56. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/bundle_util.py +0 -0
  57. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/canonicalize.py +0 -0
  58. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/cli_util.py +0 -0
  59. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/codalab_manager.py +0 -0
  60. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/completers.py +0 -0
  61. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/crypt_util.py +0 -0
  62. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/download_manager.py +0 -0
  63. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/editor_util.py +0 -0
  64. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/emailer.py +0 -0
  65. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/file_util.py +0 -0
  66. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/formatting.py +0 -0
  67. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/interactive_session.py +0 -0
  68. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/metadata_defaults.py +0 -0
  69. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/metadata_util.py +0 -0
  70. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/path_util.py +0 -0
  71. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/print_util.py +0 -0
  72. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/profiling_util.py +0 -0
  73. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/server_util.py +0 -0
  74. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/spec_util.py +0 -0
  75. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/telemetry_util.py +0 -0
  76. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/ui_actions.py +0 -0
  77. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/unicode_util.py +0 -0
  78. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/worksheet_util.py +0 -0
  79. {codalab-1.7.3 → codalab-1.7.6}/codalab/lib/zip_util.py +0 -0
  80. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/__init__.py +0 -0
  81. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/bundle_model.py +0 -0
  82. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/orm_object.py +0 -0
  83. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/sqlite_model.py +0 -0
  84. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/tables.py +0 -0
  85. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/util.py +0 -0
  86. {codalab-1.7.3 → codalab-1.7.6}/codalab/model/worker_model.py +0 -0
  87. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/__init__.py +0 -0
  88. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/bundle.py +0 -0
  89. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/dependency.py +0 -0
  90. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/metadata.py +0 -0
  91. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/metadata_spec.py +0 -0
  92. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/oauth2.py +0 -0
  93. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/permission.py +0 -0
  94. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/user.py +0 -0
  95. {codalab-1.7.3 → codalab-1.7.6}/codalab/objects/worksheet.py +0 -0
  96. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/__init__.py +0 -0
  97. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/account.py +0 -0
  98. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/bundle_actions.py +0 -0
  99. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/bundles.py +0 -0
  100. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/cli.py +0 -0
  101. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/groups.py +0 -0
  102. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/help.py +0 -0
  103. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/interpret.py +0 -0
  104. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/oauth2.py +0 -0
  105. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/schemas.py +0 -0
  106. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/users.py +0 -0
  107. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/util.py +0 -0
  108. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/workers.py +0 -0
  109. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/worksheet_block_schemas.py +0 -0
  110. {codalab-1.7.3 → codalab-1.7.6}/codalab/rest/worksheets.py +0 -0
  111. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/__init__.py +0 -0
  112. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/auth.py +0 -0
  113. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/authenticated_plugin.py +0 -0
  114. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/bundle_manager.py +0 -0
  115. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/cookie.py +0 -0
  116. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/json_api_plugin.py +0 -0
  117. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/oauth2_provider.py +0 -0
  118. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/rest_server.py +0 -0
  119. {codalab-1.7.3 → codalab-1.7.6}/codalab/server/worker_info_accessor.py +0 -0
  120. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/__init__.py +0 -0
  121. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/bundle_service_client.py +0 -0
  122. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/bundle_state.py +0 -0
  123. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/dependency_manager.py +0 -0
  124. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/docker_image_manager.py +0 -0
  125. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/docker_utils.py +0 -0
  126. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/fsm.py +0 -0
  127. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/image_manager.py +0 -0
  128. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/main.py +0 -0
  129. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/noop_image_manager.py +0 -0
  130. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/pyjson.py +0 -0
  131. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/reader.py +0 -0
  132. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/rest_client.py +0 -0
  133. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/runtime/__init__.py +0 -0
  134. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/runtime/kubernetes_runtime.py +0 -0
  135. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/singularity_image_manager.py +0 -0
  136. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/state_committer.py +0 -0
  137. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/tar_subdir_stream.py +0 -0
  138. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/un_gzip_stream.py +0 -0
  139. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/un_tar_directory.py +0 -0
  140. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/upload_util.py +0 -0
  141. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/worker.py +0 -0
  142. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/worker_monitoring.py +0 -0
  143. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/worker_run_state.py +0 -0
  144. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker/worker_thread.py +0 -0
  145. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/__init__.py +0 -0
  146. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/aws_batch_worker_manager.py +0 -0
  147. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/azure_batch_worker_manager.py +0 -0
  148. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/kubernetes_worker_manager.py +0 -0
  149. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/main.py +0 -0
  150. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/slurm_batch_worker_manager.py +0 -0
  151. {codalab-1.7.3 → codalab-1.7.6}/codalab/worker_manager/worker_manager.py +0 -0
  152. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/dependency_links.txt +0 -0
  153. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/not-zip-safe +0 -0
  154. {codalab-1.7.3 → codalab-1.7.6}/codalab.egg-info/top_level.txt +0 -0
  155. {codalab-1.7.3 → codalab-1.7.6}/docker_config/.dockerignore +0 -0
  156. {codalab-1.7.3 → codalab-1.7.6}/docker_config/__init__.py +0 -0
  157. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/__init__.py +0 -0
  158. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/docker-compose.dev.yml +0 -0
  159. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/docker-compose.ssl.yml +0 -0
  160. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/files/__init__.py +0 -0
  161. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/files/nginx.conf +0 -0
  162. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/files/nginx.conf.ssl +0 -0
  163. {codalab-1.7.3 → codalab-1.7.6}/docker_config/compose_files/files/wait-for-it.sh +0 -0
  164. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/Dockerfile.default-cpu +0 -0
  165. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/Dockerfile.default-gpu +0 -0
  166. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/Dockerfile.frontend +0 -0
  167. {codalab-1.7.3 → codalab-1.7.6}/docker_config/dockerfiles/__init__.py +0 -0
  168. {codalab-1.7.3 → codalab-1.7.6}/rc +0 -0
  169. {codalab-1.7.3 → codalab-1.7.6}/scripts/__init__.py +0 -0
  170. {codalab-1.7.3 → codalab-1.7.6}/scripts/competitiond.py +0 -0
  171. {codalab-1.7.3 → codalab-1.7.6}/scripts/create-root-user.py +0 -0
  172. {codalab-1.7.3 → codalab-1.7.6}/scripts/create_sample_worksheet.py +0 -0
  173. {codalab-1.7.3 → codalab-1.7.6}/scripts/gen-cli-docs.py +0 -0
  174. {codalab-1.7.3 → codalab-1.7.6}/scripts/gen-rest-docs.py +0 -0
  175. {codalab-1.7.3 → codalab-1.7.6}/scripts/initialize-azurite.py +0 -0
  176. {codalab-1.7.3 → codalab-1.7.6}/scripts/send-email-notifications.py +0 -0
  177. {codalab-1.7.3 → codalab-1.7.6}/scripts/test_util.py +0 -0
  178. {codalab-1.7.3 → codalab-1.7.6}/scripts/upload-mlcomp.py +0 -0
  179. {codalab-1.7.3 → codalab-1.7.6}/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.
codalab-1.7.6/PKG-INFO ADDED
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: codalab
3
+ Version: 1.7.6
4
+ Summary: CLI for CodaLab, a platform for reproducible computation
5
+ Home-page: https://github.com/codalab/codalab-worksheets
6
+ Author: CodaLab
7
+ Author-email: codalab.worksheets@gmail.com
8
+ License: Apache License 2.0
9
+ Keywords: codalab reproducible computation worksheets competitions
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Requires-Python: ~=3.9
14
+ License-File: LICENSE.txt
15
+ Requires-Dist: wheel==0.43.0
16
+ Requires-Dist: apache-beam[azure]==2.38.0
17
+ Requires-Dist: cachetools<5,>=3.1.0
18
+ Requires-Dist: google-apitools<0.5.32,>=0.5.31
19
+ Requires-Dist: google-auth<3,>=1.18.0
20
+ Requires-Dist: bottle==0.12.20
21
+ Requires-Dist: docker==4.3.0
22
+ Requires-Dist: marshmallow-jsonapi==0.15.1
23
+ Requires-Dist: marshmallow==2.15.1
24
+ Requires-Dist: setuptools<80,>=40.0.0
25
+ Requires-Dist: argcomplete==1.12.3
26
+ Requires-Dist: indexed_gzip==1.7.0
27
+ Requires-Dist: ratarmountcore==0.1.3
28
+ Requires-Dist: PyYAML==6.0.1
29
+ Requires-Dist: psutil==5.7.2
30
+ Requires-Dist: six==1.15.0
31
+ Requires-Dist: SQLAlchemy==1.3.19
32
+ Requires-Dist: watchdog>=2.0.0
33
+ Requires-Dist: fusepy==2.0.4
34
+ Requires-Dist: pygments<2.13,>=2.12
35
+ Requires-Dist: click==8.0.2
36
+ Requires-Dist: python-dateutil==2.8.1
37
+ Requires-Dist: diffimg==0.2.3
38
+ Requires-Dist: selenium==3.141.0
39
+ Requires-Dist: requests==2.25.0
40
+ Requires-Dist: azure-storage-blob==12.4.0
41
+ Requires-Dist: azure-core==1.8.0
42
+ Requires-Dist: sentry-sdk==1.14.0
43
+ Requires-Dist: requests-oauthlib==1.1.0
44
+ Requires-Dist: oauthlib==2.1.0
45
+ Requires-Dist: markdown2==2.4.0
46
+ Requires-Dist: urllib3==1.26.11
47
+ Requires-Dist: retry==0.9.2
48
+ Requires-Dist: spython==0.1.14
49
+ Requires-Dist: flufl.lock==6.0
50
+ Requires-Dist: websockets==9.1
51
+ Requires-Dist: kubernetes==12.0.1
52
+ Requires-Dist: google-cloud-storage==2.0.0
53
+ Requires-Dist: httpio==0.3.0
54
+ Requires-Dist: memory_profiler==0.61.0
55
+ Dynamic: author
56
+ Dynamic: author-email
57
+ Dynamic: classifier
58
+ Dynamic: description
59
+ Dynamic: home-page
60
+ Dynamic: keywords
61
+ Dynamic: license
62
+ Dynamic: license-file
63
+ Dynamic: requires-dist
64
+ Dynamic: requires-python
65
+ Dynamic: summary
66
+
67
+ 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).
@@ -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.3'
32
+ CODALAB_VERSION = '1.7.6'
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()
@@ -1476,7 +1476,8 @@ class SQLiteIndexedTar(MountSource):
1476
1476
  # against this. Therefore, collate all error checking by catching exceptions.
1477
1477
 
1478
1478
  try:
1479
- gzindex = tempfile.mkstemp(dir=tmpDir)[1]
1479
+ fd, gzindex = tempfile.mkstemp(dir=tmpDir)
1480
+ os.close(fd) # Only the path is needed; leaking the fd pins the file on disk after removal.
1480
1481
  with open(gzindex, 'wb') as file:
1481
1482
  if 'gzipindexes' in tables:
1482
1483
  # Try to read index files containing very large gzip indexes
@@ -1520,7 +1521,8 @@ class SQLiteIndexedTar(MountSource):
1520
1521
  # Therefore, try different paths, starting with the location where the index resides.
1521
1522
  gzindex = None
1522
1523
  for tmpDir in [os.path.dirname(self.indexFilePath), None]:
1523
- gzindex = tempfile.mkstemp(dir=tmpDir)[1]
1524
+ fd, gzindex = tempfile.mkstemp(dir=tmpDir)
1525
+ os.close(fd) # Only the path is needed; leaking the fd pins the file on disk after removal.
1524
1526
  try:
1525
1527
  fileObject.export_index(filename=gzindex)
1526
1528
  break
@@ -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()
@@ -183,6 +183,49 @@ def _compute_target_info_local(path: str, depth: Union[int, float]) -> TargetInf
183
183
  return result
184
184
 
185
185
 
186
+ def _get_archive_target_info(
187
+ tf: Any, path: str, depth: Union[int, float], process_contents: Any
188
+ ) -> TargetInfo:
189
+ """Gets the target info of the specified path within an opened indexed archive (tf).
190
+ If the specified path is a directory and additional depth is requested, this
191
+ function is recursively called to retrieve the target info of files within
192
+ the directory, much like _compute_target_info_local.
193
+
194
+ This is a module-level function (rather than a recursive closure) on purpose: a
195
+ recursive closure references itself through its closure cell, creating a reference
196
+ cycle that also captures tf. That kept every opened archive (its SQLite index
197
+ connection, temp files and in-memory gzip index) alive until the cyclic garbage
198
+ collector happened to run, leaking memory and disk on the REST server.
199
+ """
200
+ if not path.startswith("/"):
201
+ path = "/" + path
202
+ finfo = cast(FileInfo, tf.getFileInfo(path))
203
+ if finfo is None:
204
+ # Not found
205
+ raise PathException("File not found.")
206
+ result: TargetInfo = {
207
+ 'name': os.path.basename(path), # get last part of path
208
+ 'size': finfo.size,
209
+ 'perm': finfo.mode & 0o777,
210
+ 'type': '',
211
+ }
212
+ if stat.S_ISLNK(finfo.mode):
213
+ result['type'] = 'link'
214
+ result['link'] = finfo.linkname
215
+ elif not stat.S_ISDIR(finfo.mode):
216
+ result['type'] = 'file'
217
+ else:
218
+ result['type'] = 'directory'
219
+ if depth > 0:
220
+ listing = cast(Dict[str, FileInfo], tf.listDir(path) or {})
221
+ result['contents'] = process_contents(
222
+ _get_archive_target_info(tf, path + "/" + file_name, depth - 1, process_contents)
223
+ for file_name in listing
224
+ if file_name != "."
225
+ )
226
+ return result
227
+
228
+
186
229
  def _compute_target_info_blob(
187
230
  path: str, depth: Union[int, float], return_generators=False
188
231
  ) -> TargetInfo:
@@ -216,44 +259,9 @@ def _compute_target_info_blob(
216
259
  process_contents = list if return_generators is False else lambda x: x
217
260
 
218
261
  with OpenIndexedArchiveFile(linked_bundle_path.bundle_path) as tf:
219
- islink = lambda finfo: stat.S_ISLNK(finfo.mode)
220
- readlink = lambda finfo: finfo.linkname
221
- isfile = lambda finfo: not stat.S_ISDIR(finfo.mode)
222
- isdir = lambda finfo: stat.S_ISDIR(finfo.mode)
223
- listdir = lambda path: cast(Dict[str, FileInfo], tf.listDir(path) or {})
224
-
262
+ # Non-recursive wrapper; see _get_archive_target_info for why recursion lives at module level.
225
263
  def _get_info(path: str, depth: Union[int, float]) -> TargetInfo:
226
- """This function is called to get the target info of the specified path.
227
- If the specified path is a directory and additional depth is requested, this
228
- function is recursively called to retrieve the target info of files within
229
- the directory, much like _compute_target_info_local.
230
- """
231
- if not path.startswith("/"):
232
- path = "/" + path
233
- finfo = cast(FileInfo, tf.getFileInfo(path))
234
- if finfo is None:
235
- # Not found
236
- raise PathException("File not found.")
237
- result: TargetInfo = {
238
- 'name': os.path.basename(path), # get last part of path
239
- 'size': finfo.size,
240
- 'perm': finfo.mode & 0o777,
241
- 'type': '',
242
- }
243
- if islink(finfo):
244
- result['type'] = 'link'
245
- result['link'] = readlink(finfo)
246
- elif isfile(finfo):
247
- result['type'] = 'file'
248
- elif isdir(finfo):
249
- result['type'] = 'directory'
250
- if depth > 0:
251
- result['contents'] = process_contents(
252
- _get_info(path + "/" + file_name, depth - 1)
253
- for file_name in listdir(path)
254
- if file_name != "."
255
- )
256
- return result
264
+ return _get_archive_target_info(tf, path, depth, process_contents)
257
265
 
258
266
  if not linked_bundle_path.is_archive_dir:
259
267
  # Return the contents of the single .gz file.
@@ -290,7 +298,7 @@ def _compute_target_info_blob(
290
298
  if depth > 0:
291
299
  result['contents'] = process_contents(
292
300
  _get_info(file_name, depth - 1)
293
- for file_name in listdir("/")
301
+ for file_name in cast(Dict[str, FileInfo], tf.listDir("/") or {})
294
302
  if file_name != "."
295
303
  )
296
304
  return result
@@ -317,5 +325,4 @@ def compute_target_info_blob_descendants_flat(path: str) -> Generator[TargetInfo
317
325
 
318
326
  yield cast(TargetInfo, dict(target_info, contents=None, name=""))
319
327
  for t in target_info.get('contents') or []:
320
- print("CONTENTT", t)
321
328
  yield from get_results(t)
@@ -217,13 +217,18 @@ class OpenIndexedArchiveFile(object):
217
217
  )
218
218
 
219
219
  def __enter__(self) -> SQLiteIndexedTar:
220
- return SQLiteIndexedTar(
221
- fileObject=self.f,
222
- tarFileName="contents",
223
- writeIndex=False,
224
- clearIndexCache=False,
225
- indexFilePath=self.index_file_name,
226
- )
220
+ try:
221
+ return SQLiteIndexedTar(
222
+ fileObject=self.f,
223
+ tarFileName="contents",
224
+ writeIndex=False,
225
+ clearIndexCache=False,
226
+ indexFilePath=self.index_file_name,
227
+ )
228
+ except Exception:
229
+ # __exit__ is not called when __enter__ raises, so clean up the temp index here.
230
+ os.remove(self.index_file_name)
231
+ raise
227
232
 
228
233
  def __exit__(self, type, value, traceback):
229
234
  os.remove(self.index_file_name)
@@ -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)
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: codalab
3
+ Version: 1.7.6
4
+ Summary: CLI for CodaLab, a platform for reproducible computation
5
+ Home-page: https://github.com/codalab/codalab-worksheets
6
+ Author: CodaLab
7
+ Author-email: codalab.worksheets@gmail.com
8
+ License: Apache License 2.0
9
+ Keywords: codalab reproducible computation worksheets competitions
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Requires-Python: ~=3.9
14
+ License-File: LICENSE.txt
15
+ Requires-Dist: wheel==0.43.0
16
+ Requires-Dist: apache-beam[azure]==2.38.0
17
+ Requires-Dist: cachetools<5,>=3.1.0
18
+ Requires-Dist: google-apitools<0.5.32,>=0.5.31
19
+ Requires-Dist: google-auth<3,>=1.18.0
20
+ Requires-Dist: bottle==0.12.20
21
+ Requires-Dist: docker==4.3.0
22
+ Requires-Dist: marshmallow-jsonapi==0.15.1
23
+ Requires-Dist: marshmallow==2.15.1
24
+ Requires-Dist: setuptools<80,>=40.0.0
25
+ Requires-Dist: argcomplete==1.12.3
26
+ Requires-Dist: indexed_gzip==1.7.0
27
+ Requires-Dist: ratarmountcore==0.1.3
28
+ Requires-Dist: PyYAML==6.0.1
29
+ Requires-Dist: psutil==5.7.2
30
+ Requires-Dist: six==1.15.0
31
+ Requires-Dist: SQLAlchemy==1.3.19
32
+ Requires-Dist: watchdog>=2.0.0
33
+ Requires-Dist: fusepy==2.0.4
34
+ Requires-Dist: pygments<2.13,>=2.12
35
+ Requires-Dist: click==8.0.2
36
+ Requires-Dist: python-dateutil==2.8.1
37
+ Requires-Dist: diffimg==0.2.3
38
+ Requires-Dist: selenium==3.141.0
39
+ Requires-Dist: requests==2.25.0
40
+ Requires-Dist: azure-storage-blob==12.4.0
41
+ Requires-Dist: azure-core==1.8.0
42
+ Requires-Dist: sentry-sdk==1.14.0
43
+ Requires-Dist: requests-oauthlib==1.1.0
44
+ Requires-Dist: oauthlib==2.1.0
45
+ Requires-Dist: markdown2==2.4.0
46
+ Requires-Dist: urllib3==1.26.11
47
+ Requires-Dist: retry==0.9.2
48
+ Requires-Dist: spython==0.1.14
49
+ Requires-Dist: flufl.lock==6.0
50
+ Requires-Dist: websockets==9.1
51
+ Requires-Dist: kubernetes==12.0.1
52
+ Requires-Dist: google-cloud-storage==2.0.0
53
+ Requires-Dist: httpio==0.3.0
54
+ Requires-Dist: memory_profiler==0.61.0
55
+ Dynamic: author
56
+ Dynamic: author-email
57
+ Dynamic: classifier
58
+ Dynamic: description
59
+ Dynamic: home-page
60
+ Dynamic: keywords
61
+ Dynamic: license
62
+ Dynamic: license-file
63
+ Dynamic: requires-dist
64
+ Dynamic: requires-python
65
+ Dynamic: summary
66
+
67
+ 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).
@@ -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
@@ -7,4 +7,3 @@ cl-worker = codalab.worker.main:main
7
7
  cl-worker-manager = codalab.worker_manager.main:main
8
8
  cl-ws-server = codalab.bin.ws_server:main
9
9
  codalab-service = codalab_service:main
10
-
@@ -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
@@ -6,11 +7,11 @@ bottle==0.12.20
6
7
  docker==4.3.0
7
8
  marshmallow-jsonapi==0.15.1
8
9
  marshmallow==2.15.1
9
- setuptools>=40.0.0
10
+ setuptools<80,>=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
@@ -21,6 +21,7 @@ from __future__ import print_function
21
21
  import argparse
22
22
  import errno
23
23
  import os
24
+ import shutil
24
25
  import socket
25
26
  import subprocess
26
27
  import yaml
@@ -856,9 +857,16 @@ class CodalabServiceManager(object):
856
857
  print('')
857
858
  return success
858
859
 
860
+ @staticmethod
861
+ def _compose_binary():
862
+ """Use the legacy `docker-compose` if installed, else the `docker compose` plugin.
863
+ `--compatibility` keeps the v1 container names (e.g. codalab_rest-server_1) that tests rely on."""
864
+ return 'docker-compose' if shutil.which('docker-compose') else 'docker compose --compatibility'
865
+
859
866
  def _run_compose_cmd(self, cmd):
860
867
  compose_files_str = ' '.join('-f ' + f for f in self.compose_files)
861
- command_string = 'docker-compose -p %s --project-directory %s %s %s' % (
868
+ command_string = '%s -p %s --project-directory %s %s %s' % (
869
+ self._compose_binary(),
862
870
  self.args.instance_name,
863
871
  self.compose_cwd,
864
872
  compose_files_str,
@@ -310,7 +310,7 @@ services:
310
310
  <<: *codalab-server
311
311
  volumes:
312
312
  - "${CODALAB_HOME}:${CODALAB_HOME}"
313
- - ${CODALAB_WORKER_MANAGER_CPU_KUBERNETES_CERT_PATH}:${CODALAB_WORKER_MANAGER_CPU_KUBERNETES_CERT_PATH}:ro
313
+ - ${CODALAB_WORKER_MANAGER_CPU_KUBERNETES_CERT_PATH:-/dev/null}:${CODALAB_WORKER_MANAGER_CPU_KUBERNETES_CERT_PATH:-/dev/null}:ro
314
314
  networks:
315
315
  - rest-server
316
316
 
@@ -345,7 +345,7 @@ services:
345
345
  <<: *codalab-server
346
346
  volumes:
347
347
  - "${CODALAB_HOME}:${CODALAB_HOME}"
348
- - ${CODALAB_WORKER_MANAGER_GPU_KUBERNETES_CERT_PATH}:${CODALAB_WORKER_MANAGER_GPU_KUBERNETES_CERT_PATH}:ro
348
+ - ${CODALAB_WORKER_MANAGER_GPU_KUBERNETES_CERT_PATH:-/dev/null}:${CODALAB_WORKER_MANAGER_GPU_KUBERNETES_CERT_PATH:-/dev/null}:ro
349
349
  networks:
350
350
  - rest-server
351
351
 
@@ -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
 
@@ -42,12 +42,12 @@ COPY requirements.txt requirements.txt
42
42
  COPY requirements.docs.txt requirements.docs.txt
43
43
  COPY requirements.dev.txt requirements.dev.txt
44
44
  COPY requirements-server.txt requirements-server.txt
45
- RUN python3 -m pip install setuptools --upgrade
45
+ RUN python3 -m pip install "setuptools<80" --upgrade
46
46
  RUN python3 -m pip install --no-cache-dir -r requirements-server.txt
47
47
 
48
48
  # Install code
49
49
  COPY setup.py setup.py
50
- RUN python3 -m pip install --no-cache-dir -e .
50
+ RUN python3 -m pip install --no-cache-dir --no-build-isolation -e .
51
51
  COPY alembic alembic
52
52
  COPY alembic.ini alembic.ini
53
53
  COPY codalab codalab