instance-repo 1.3.5.dev3__tar.gz → 1.3.5.dev5__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.
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/PKG-INFO +1 -1
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/__init__.py +1 -1
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/instances.py +19 -13
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/oss.py +1 -1
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/PKG-INFO +1 -1
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/pyproject.toml +1 -1
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/README.md +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/_routing.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/_site_defaults.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/artifacts.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/bootstrap.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/cache.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/cli.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/__init__.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/benchmarks.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/config.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/datasets.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/images.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/reports.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/scaffold.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/splits.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/versions.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/clients/workflows.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/concurrency.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/content.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/endpoints.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/errors.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/image.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/layout.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/loader.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/models.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/paths.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/release.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/repo.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/retry.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/__init__.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/acr.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/base.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/oss_discovery.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/store/registry.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/tasktoml.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/transport.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo/validate.py +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/SOURCES.txt +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/dependency_links.txt +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/entry_points.txt +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/requires.txt +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/top_level.txt +0 -0
- {instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/setup.cfg +0 -0
|
@@ -175,8 +175,8 @@ class InstancesClient:
|
|
|
175
175
|
result = self._reg.get(
|
|
176
176
|
dataset, version, instance_id, split, **overrides)
|
|
177
177
|
except TransportError as e:
|
|
178
|
-
# 路径 1: dataset 不存在(92001) → OSS 回退
|
|
179
|
-
if (e.biz_code
|
|
178
|
+
# 路径 1: dataset 不存在(92001) 或 split 不存在(92023) → OSS 回退
|
|
179
|
+
if (e.biz_code in (92001, 92023)
|
|
180
180
|
and fallback_to_oss and self._content is not None
|
|
181
181
|
and self._discovery_env_match(environment)):
|
|
182
182
|
return self._discover_instance(
|
|
@@ -204,7 +204,7 @@ class InstancesClient:
|
|
|
204
204
|
try:
|
|
205
205
|
return self._reg.query(dataset, version, split, **overrides)
|
|
206
206
|
except TransportError as e:
|
|
207
|
-
if (e.biz_code
|
|
207
|
+
if (e.biz_code in (92001, 92023)
|
|
208
208
|
and fallback_to_oss and self._content is not None
|
|
209
209
|
and self._discovery_env_match(environment)):
|
|
210
210
|
return self._discover_instances(dataset, version, split)
|
|
@@ -283,7 +283,7 @@ class InstancesClient:
|
|
|
283
283
|
data, pagination = self._t.request_with_meta(
|
|
284
284
|
"GET", f"{self._BASE}?{query}")
|
|
285
285
|
except TransportError as e:
|
|
286
|
-
if (e.biz_code
|
|
286
|
+
if (e.biz_code in (92001, 92023)
|
|
287
287
|
and fallback_to_oss and self._content is not None
|
|
288
288
|
and self._discovery_env_match(environment)):
|
|
289
289
|
return self._discover_instances_paged(
|
|
@@ -463,17 +463,18 @@ class InstancesClient:
|
|
|
463
463
|
("dataset_name", dataset.strip()),
|
|
464
464
|
("split", split),
|
|
465
465
|
("prefix", full_prefix),
|
|
466
|
-
("page_size", str(int(page_size)))
|
|
467
|
-
|
|
468
|
-
params.append(("version", version.strip()))
|
|
466
|
+
("page_size", str(int(page_size))),
|
|
467
|
+
("version", (version or "").strip())]
|
|
469
468
|
if (dataset_split_id or "").strip():
|
|
470
469
|
params.append(("dataset_split_id", dataset_split_id.strip()))
|
|
471
470
|
if tk:
|
|
472
471
|
params.append(("token", tk))
|
|
473
472
|
if env:
|
|
474
473
|
params.append(("environment", env))
|
|
475
|
-
|
|
476
|
-
|
|
474
|
+
# metadata_model 必须始终发送——apiserver 据此决定走 split_first
|
|
475
|
+
# 还是 version_first 路径。缺失时 apiserver 默认 version_first,
|
|
476
|
+
# 会对 split_first 数据集错误要求 version 非空(92005)。
|
|
477
|
+
params.append(("metadata_model", mm or "split_first"))
|
|
477
478
|
qs = "&".join(f"{k}={quote(v, safe='')}" for k, v in params)
|
|
478
479
|
data = self._t.get(f"/apis/v1/datasets/objects?{qs}")
|
|
479
480
|
if not isinstance(data, dict):
|
|
@@ -769,9 +770,11 @@ class InstancesClient:
|
|
|
769
770
|
put = self._content.put(instance_id, dataset, version, split, tgz,
|
|
770
771
|
meta.to_canonical_json(), overwrite=overwrite,
|
|
771
772
|
layout=lay)
|
|
773
|
+
_tgz_size = tgz.stat().st_size
|
|
772
774
|
skipped = bool(put.get("skipped"))
|
|
773
775
|
_upload_elapsed = _time.monotonic() - _t0 - _pack_elapsed
|
|
774
|
-
|
|
776
|
+
if skipped:
|
|
777
|
+
_tgz_size = 0
|
|
775
778
|
logger.info("push %s: pack=%.1fs (%d bytes) upload=%.1fs skipped=%s",
|
|
776
779
|
instance_id, _pack_elapsed, _tgz_size,
|
|
777
780
|
_upload_elapsed, skipped)
|
|
@@ -1184,9 +1187,12 @@ class InstancesClient:
|
|
|
1184
1187
|
try:
|
|
1185
1188
|
meta = self._reg.get(dataset, version, instance_id, split)
|
|
1186
1189
|
except TransportError as e:
|
|
1187
|
-
if (e.biz_code
|
|
1190
|
+
if (e.biz_code in (92001, 92023) and fallback_to_oss
|
|
1188
1191
|
and self._content is not None):
|
|
1189
|
-
# dataset 未注册
|
|
1192
|
+
# 92001: dataset 未注册
|
|
1193
|
+
# 92023: dataset 已注册但 split 在当前 environment 不存在
|
|
1194
|
+
# (如数据在 online 但 SDK 查了 pre)
|
|
1195
|
+
# 两种情况均回退到 OSS 直接下载(私网 + 系统调用方语义)
|
|
1190
1196
|
return self._pull_unregistered(
|
|
1191
1197
|
dataset, version, instance_id, dest_dir, split,
|
|
1192
1198
|
path=path)
|
|
@@ -1444,7 +1450,7 @@ class InstancesClient:
|
|
|
1444
1450
|
return []
|
|
1445
1451
|
# path 非空时,LIST 直接用子前缀缩小范围
|
|
1446
1452
|
list_prefix = asset_prefix + path_prefix if path_prefix else asset_prefix
|
|
1447
|
-
keys = list_fn(list_prefix)
|
|
1453
|
+
keys = list_fn(list_prefix, list_only=True, dataset=dataset)
|
|
1448
1454
|
if not keys:
|
|
1449
1455
|
return []
|
|
1450
1456
|
for key in keys:
|
|
@@ -629,7 +629,7 @@ class OssContentStore(BaseContentStore):
|
|
|
629
629
|
if oss_prefix and not oss_prefix.endswith("/"):
|
|
630
630
|
oss_prefix += "/"
|
|
631
631
|
|
|
632
|
-
keys = self.list_objects(oss_prefix)
|
|
632
|
+
keys = self.list_objects(oss_prefix, list_only=True, dataset=dataset)
|
|
633
633
|
|
|
634
634
|
def _download_one(key: str) -> Path:
|
|
635
635
|
rel = key[len(oss_prefix):]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{instance_repo-1.3.5.dev3 → instance_repo-1.3.5.dev5}/instance_repo.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|