matrice 1.0.98850__tar.gz → 1.0.98851__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 (150) hide show
  1. {matrice-1.0.98850/src/matrice.egg-info → matrice-1.0.98851}/PKG-INFO +1 -1
  2. {matrice-1.0.98850 → matrice-1.0.98851}/setup.py +1 -1
  3. matrice-1.0.98851/src/matrice/compute_manager/task_utils.py +76 -0
  4. {matrice-1.0.98850 → matrice-1.0.98851/src/matrice.egg-info}/PKG-INFO +1 -1
  5. matrice-1.0.98850/src/matrice/compute_manager/task_utils.py +0 -53
  6. {matrice-1.0.98850 → matrice-1.0.98851}/LICENSE.txt +0 -0
  7. {matrice-1.0.98850 → matrice-1.0.98851}/README.md +0 -0
  8. {matrice-1.0.98850 → matrice-1.0.98851}/setup.cfg +0 -0
  9. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/__init__.py +0 -0
  10. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/action.py +0 -0
  11. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/actionTracker.py +0 -0
  12. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/action_tracker.py +0 -0
  13. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/annotation.py +0 -0
  14. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute.py +0 -0
  15. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/__init__.py +0 -0
  16. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/action_instance.py +0 -0
  17. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/actions_manager.py +0 -0
  18. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/actions_scaledown_manager.py +0 -0
  19. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/instance_manager.py +0 -0
  20. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/instance_utils.py +0 -0
  21. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/prechecks.py +0 -0
  22. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/resources_tracker.py +0 -0
  23. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/scaling.py +0 -0
  24. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/compute_manager/shutdown_manager.py +0 -0
  25. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/__init__.py +0 -0
  26. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/client.py +0 -0
  27. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/client_utils.py +0 -0
  28. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_augmentation.py +0 -0
  29. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/__init__.py +0 -0
  30. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/imagenet_classification.py +0 -0
  31. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/labelbox_classification.py +0 -0
  32. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/labelbox_detection.py +0 -0
  33. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/mscoco_detection.py +0 -0
  34. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/pascalvoc_detection.py +0 -0
  35. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/unlabelled.py +0 -0
  36. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_davis_segmentation.py +0 -0
  37. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_detection_mscoco.py +0 -0
  38. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_imagenet_classification.py +0 -0
  39. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_kinetics_activity_recognition.py +0 -0
  40. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_mot_tracking.py +0 -0
  41. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_mscoco_detection.py +0 -0
  42. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/video_youtube_bb_tracking.py +0 -0
  43. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_formats/yolo_detection.py +0 -0
  44. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_labelling.py +0 -0
  45. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_prep.py +0 -0
  46. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/data_processor.py +0 -0
  47. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/image_augmentations.py +0 -0
  48. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/image_data_augmentation.py +0 -0
  49. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/pipeline.py +0 -0
  50. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/server.py +0 -0
  51. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/server_utils.py +0 -0
  52. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/data_processing/video_server.py +0 -0
  53. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/dataset.py +0 -0
  54. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/__init__.py +0 -0
  55. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/__init__.py +0 -0
  56. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/camera_manager.py +0 -0
  57. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/client.py +0 -0
  58. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/client_stream_utils.py +0 -0
  59. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/client_utils.py +0 -0
  60. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/streaming_gateway/__init__.py +0 -0
  61. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/streaming_gateway/auto_streaming.py +0 -0
  62. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/streaming_gateway/streaming_gateway.py +0 -0
  63. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/streaming_gateway/streaming_gateway_utils.py +0 -0
  64. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/client/streaming_gateway/streaming_results_handler.py +0 -0
  65. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/__init__.py +0 -0
  66. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/inference/__init__.py +0 -0
  67. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/inference/inference_interface.py +0 -0
  68. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/inference/model_manager.py +0 -0
  69. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/inference/triton_utils.py +0 -0
  70. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/proxy/__init__.py +0 -0
  71. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/proxy/proxy_interface.py +0 -0
  72. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/proxy/proxy_utils.py +0 -0
  73. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/server.py +0 -0
  74. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/server/stream_worker.py +0 -0
  75. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/__init__.py +0 -0
  76. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/boundary_drawing_internal/__init__.py +0 -0
  77. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/boundary_drawing_internal/boundary_drawing_internal.py +0 -0
  78. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/boundary_drawing_internal/boundary_drawing_tool.py +0 -0
  79. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/boundary_drawing_internal/example_usage.py +0 -0
  80. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/kafka_utils.py +0 -0
  81. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/__init__.py +0 -0
  82. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/__init__.py +0 -0
  83. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/base.py +0 -0
  84. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/config.py +0 -0
  85. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/kalman_filter.py +0 -0
  86. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/matching.py +0 -0
  87. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/strack.py +0 -0
  88. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/advanced_tracker/tracker.py +0 -0
  89. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/core/__init__.py +0 -0
  90. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/core/base.py +0 -0
  91. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/core/config.py +0 -0
  92. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/core/config_utils.py +0 -0
  93. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/processor.py +0 -0
  94. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/__init__.py +0 -0
  95. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/run_tests.py +0 -0
  96. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_advanced_customer_service.py +0 -0
  97. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_basic_counting_tracking.py +0 -0
  98. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_comprehensive.py +0 -0
  99. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_config.py +0 -0
  100. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_customer_service.py +0 -0
  101. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_data_generators.py +0 -0
  102. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_people_counting.py +0 -0
  103. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_processor.py +0 -0
  104. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_utilities.py +0 -0
  105. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/test_cases/test_utils.py +0 -0
  106. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/__init__.py +0 -0
  107. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/advanced_customer_service.py +0 -0
  108. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/basic_counting_tracking.py +0 -0
  109. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/color_detection.py +0 -0
  110. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/color_map_utils.py +0 -0
  111. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/customer_service.py +0 -0
  112. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/fire_detection.py +0 -0
  113. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/flare_analysis.py +0 -0
  114. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/license_plate_detection.py +0 -0
  115. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/people_counting.py +0 -0
  116. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/ppe_compliance.py +0 -0
  117. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/usecases/vehicle_monitoring.py +0 -0
  118. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/__init__.py +0 -0
  119. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/advanced_counting_utils.py +0 -0
  120. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/advanced_helper_utils.py +0 -0
  121. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/advanced_tracking_utils.py +0 -0
  122. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/alerting_utils.py +0 -0
  123. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/category_mapping_utils.py +0 -0
  124. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/color_utils.py +0 -0
  125. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/counting_utils.py +0 -0
  126. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/filter_utils.py +0 -0
  127. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/format_utils.py +0 -0
  128. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/geometry_utils.py +0 -0
  129. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/smoothing_utils.py +0 -0
  130. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deploy/utils/post_processing/utils/tracking_utils.py +0 -0
  131. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/deployment.py +0 -0
  132. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/docker_utils.py +0 -0
  133. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/drift_monitor.py +0 -0
  134. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/exported_model.py +0 -0
  135. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/local_test.py +0 -0
  136. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/metrics_calculator.py +0 -0
  137. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/metrics_calculator_oop.py +0 -0
  138. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/model_store.py +0 -0
  139. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/models.py +0 -0
  140. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/projects.py +0 -0
  141. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/rpc.py +0 -0
  142. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/scaling.py +0 -0
  143. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/session.py +0 -0
  144. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/testing.py +0 -0
  145. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/token_auth.py +0 -0
  146. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice/utils.py +0 -0
  147. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice.egg-info/SOURCES.txt +0 -0
  148. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice.egg-info/dependency_links.txt +0 -0
  149. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice.egg-info/requires.txt +0 -0
  150. {matrice-1.0.98850 → matrice-1.0.98851}/src/matrice.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.98850
3
+ Version: 1.0.98851
4
4
  Summary: SDK for connecting to matrice.ai services
5
5
  Home-page: https://github.com/matrice-ai/python-sdk
6
6
  Author: Matrice.ai
@@ -15,7 +15,7 @@ setup(
15
15
  name="matrice",
16
16
 
17
17
 
18
- version = "1.0.98850",
18
+ version = "1.0.98851",
19
19
 
20
20
 
21
21
  description="SDK for connecting to matrice.ai services",
@@ -0,0 +1,76 @@
1
+ """Module providing task_utils functionality."""
2
+
3
+ import os
4
+ import shutil
5
+ import urllib.request
6
+ import zipfile
7
+ from matrice.utils import log_errors
8
+
9
+
10
+ @log_errors(raise_exception=True, log_error=True)
11
+ def setup_workspace_and_run_task(
12
+ work_fs,
13
+ action_id,
14
+ model_codebase_url,
15
+ model_codebase_requirements_url,
16
+ ):
17
+ """Set up workspace and run task with provided parameters.
18
+
19
+ Args:
20
+ work_fs: Working filesystem path
21
+ action_id: Unique identifier for the action
22
+ model_codebase_url: URL to download model codebase from
23
+ model_codebase_requirements_url: URL to download requirements from
24
+
25
+ Returns:
26
+ None
27
+ """
28
+ workspace_dir = f"{work_fs}/{action_id}"
29
+ codebase_zip_path = f"{workspace_dir}/file.zip"
30
+ requirements_txt_path = f"{workspace_dir}/requirements.txt"
31
+ if os.path.exists(workspace_dir):
32
+ return
33
+ os.makedirs(workspace_dir, exist_ok=True)
34
+
35
+ # Download codebase ZIP file
36
+ urllib.request.urlretrieve(model_codebase_url, codebase_zip_path)
37
+
38
+ # Extract ZIP file with overwrite
39
+ with zipfile.ZipFile(codebase_zip_path, 'r') as zip_ref:
40
+ zip_ref.extractall(workspace_dir)
41
+
42
+ # Move files from subdirectories to workspace root (equivalent to rsync -av)
43
+ for root, dirs, files in os.walk(workspace_dir):
44
+ # Skip the workspace_dir itself to avoid moving files to themselves
45
+ if root == workspace_dir:
46
+ continue
47
+
48
+ for file in files:
49
+ src_file = os.path.join(root, file)
50
+ dst_file = os.path.join(workspace_dir, file)
51
+
52
+ # If destination file exists, overwrite it (equivalent to rsync -av behavior)
53
+ if os.path.exists(dst_file):
54
+ os.remove(dst_file)
55
+
56
+ shutil.move(src_file, dst_file)
57
+
58
+ # Remove empty directories after moving files
59
+ for dir_name in dirs:
60
+ dir_path = os.path.join(root, dir_name)
61
+ if os.path.exists(dir_path) and not os.listdir(dir_path):
62
+ os.rmdir(dir_path)
63
+
64
+ # Clean up any remaining empty subdirectories
65
+ for root, dirs, files in os.walk(workspace_dir, topdown=False):
66
+ if root == workspace_dir:
67
+ continue
68
+ if not files and not dirs:
69
+ try:
70
+ os.rmdir(root)
71
+ except OSError:
72
+ pass # Directory might not be empty or might not exist
73
+
74
+ # Download requirements.txt if URL is provided
75
+ if model_codebase_requirements_url:
76
+ urllib.request.urlretrieve(model_codebase_requirements_url, requirements_txt_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matrice
3
- Version: 1.0.98850
3
+ Version: 1.0.98851
4
4
  Summary: SDK for connecting to matrice.ai services
5
5
  Home-page: https://github.com/matrice-ai/python-sdk
6
6
  Author: Matrice.ai
@@ -1,53 +0,0 @@
1
- """Module providing task_utils functionality."""
2
-
3
- import os
4
- import shlex
5
- import subprocess
6
- from matrice.utils import log_errors
7
-
8
-
9
- @log_errors(raise_exception=True, log_error=True)
10
- def setup_workspace_and_run_task(
11
- work_fs,
12
- action_id,
13
- model_codebase_url,
14
- model_codebase_requirements_url,
15
- ):
16
- """Set up workspace and run task with provided parameters.
17
-
18
- Args:
19
- work_fs: Working filesystem path
20
- action_id: Unique identifier for the action
21
- model_codebase_url: URL to download model codebase from
22
- model_codebase_requirements_url: URL to download requirements from
23
-
24
- Returns:
25
- None
26
- """
27
- workspace_dir = f"{work_fs}/{action_id}"
28
- codebase_zip_path = f"{workspace_dir}/file.zip"
29
- requirements_txt_path = f"{workspace_dir}/requirements.txt"
30
- if os.path.exists(workspace_dir):
31
- return
32
- os.makedirs(workspace_dir, exist_ok=True)
33
- download_codebase_cmd = (
34
- f"curl -L -o {shlex.quote(codebase_zip_path)} {shlex.quote(model_codebase_url)}"
35
- )
36
- subprocess.run(
37
- download_codebase_cmd,
38
- shell=True,
39
- check=True,
40
- )
41
- unzip_codebase_cmd = (
42
- f"unzip -o {shlex.quote(codebase_zip_path)} -d {shlex.quote(workspace_dir)}"
43
- )
44
- subprocess.run(unzip_codebase_cmd, shell=True, check=True)
45
- move_files_cmd = f"rsync -av {shlex.quote(workspace_dir)}/*/ {shlex.quote(workspace_dir)}/ "
46
- subprocess.run(move_files_cmd, shell=True, check=True)
47
- if model_codebase_requirements_url:
48
- download_requirements_cmd = f"curl -L -o {shlex.quote(requirements_txt_path)} {shlex.quote(model_codebase_requirements_url)}"
49
- subprocess.run(
50
- download_requirements_cmd,
51
- shell=True,
52
- check=True,
53
- )
File without changes
File without changes
File without changes