matrice 1.0.98850__py3-none-any.whl → 1.0.98851__py3-none-any.whl
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.
- matrice/compute_manager/task_utils.py +45 -22
- {matrice-1.0.98850.dist-info → matrice-1.0.98851.dist-info}/METADATA +1 -1
- {matrice-1.0.98850.dist-info → matrice-1.0.98851.dist-info}/RECORD +6 -6
- {matrice-1.0.98850.dist-info → matrice-1.0.98851.dist-info}/WHEEL +0 -0
- {matrice-1.0.98850.dist-info → matrice-1.0.98851.dist-info}/licenses/LICENSE.txt +0 -0
- {matrice-1.0.98850.dist-info → matrice-1.0.98851.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,9 @@
|
|
1
1
|
"""Module providing task_utils functionality."""
|
2
2
|
|
3
3
|
import os
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import shutil
|
5
|
+
import urllib.request
|
6
|
+
import zipfile
|
6
7
|
from matrice.utils import log_errors
|
7
8
|
|
8
9
|
|
@@ -30,24 +31,46 @@ def setup_workspace_and_run_task(
|
|
30
31
|
if os.path.exists(workspace_dir):
|
31
32
|
return
|
32
33
|
os.makedirs(workspace_dir, exist_ok=True)
|
33
|
-
|
34
|
-
|
35
|
-
)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
47
75
|
if model_codebase_requirements_url:
|
48
|
-
|
49
|
-
subprocess.run(
|
50
|
-
download_requirements_cmd,
|
51
|
-
shell=True,
|
52
|
-
check=True,
|
53
|
-
)
|
76
|
+
urllib.request.urlretrieve(model_codebase_requirements_url, requirements_txt_path)
|
@@ -31,7 +31,7 @@ matrice/compute_manager/prechecks.py,sha256=sarrX0DIUWRfWvCowTANiMvSi2VPZ-5tCEdZ
|
|
31
31
|
matrice/compute_manager/resources_tracker.py,sha256=84yzWYyLZmd2wENnKMk-mBUMAhE3CZ7oyZ3-5hnAwdI,16178
|
32
32
|
matrice/compute_manager/scaling.py,sha256=95gt9KxYLtcOskSpdbC0ddbduSgZuDD6bGsJX-SVlwc,22976
|
33
33
|
matrice/compute_manager/shutdown_manager.py,sha256=3m0DjItl1uSyTO7fvQb-IV8lapNX31Zul8FG0yCge0M,5245
|
34
|
-
matrice/compute_manager/task_utils.py,sha256=
|
34
|
+
matrice/compute_manager/task_utils.py,sha256=hwT3_RyCu7RTH7T83NYNHBJ8XXkS8V3sUSb3oO0QNrU,2626
|
35
35
|
matrice/data_processing/__init__.py,sha256=JqYtcyzrQGSXN2EmQBjS4rqwj0CKe0tg9x1Nd3UAAgQ,120
|
36
36
|
matrice/data_processing/client.py,sha256=AtimRASg8nH3mxwwih1EHvvHNeXl9NvJhIJHjLjSxHY,55309
|
37
37
|
matrice/data_processing/client_utils.py,sha256=q0bJg6bmlUTzy83RSuViCcpazHWgRgKgx77fqDqT2kQ,50121
|
@@ -137,8 +137,8 @@ matrice/deploy/utils/post_processing/utils/format_utils.py,sha256=ce2VpQicTYKfxu
|
|
137
137
|
matrice/deploy/utils/post_processing/utils/geometry_utils.py,sha256=BWfdM6RsdJTTLR1GqkWfdwpjMEjTCJyuBxA4zVGKdfk,9623
|
138
138
|
matrice/deploy/utils/post_processing/utils/smoothing_utils.py,sha256=gQPykV1HGh-IMMz_3fumgtrhpyCRgXMS1hOEDcLRMO0,12542
|
139
139
|
matrice/deploy/utils/post_processing/utils/tracking_utils.py,sha256=rWxuotnJ3VLMHIBOud2KLcu4yZfDp7hVPWUtNAq_2xw,8288
|
140
|
-
matrice-1.0.
|
141
|
-
matrice-1.0.
|
142
|
-
matrice-1.0.
|
143
|
-
matrice-1.0.
|
144
|
-
matrice-1.0.
|
140
|
+
matrice-1.0.98851.dist-info/licenses/LICENSE.txt,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
|
141
|
+
matrice-1.0.98851.dist-info/METADATA,sha256=HvjNufQVAR1bCTJoIT5xaBsSflOX1g3pXmezm5937uE,14624
|
142
|
+
matrice-1.0.98851.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
143
|
+
matrice-1.0.98851.dist-info/top_level.txt,sha256=P97js8ur6o5ClRqMH3Cjoab_NqbJ6sOQ3rJmVzKBvMc,8
|
144
|
+
matrice-1.0.98851.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|