simulo-interfaces 0.4.0__tar.gz → 0.6.0__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.
- {simulo_interfaces-0.4.0/src/simulo_interfaces.egg-info → simulo_interfaces-0.6.0}/PKG-INFO +1 -1
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/pyproject.toml +1 -1
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/ids.py +2 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/platform/__init__.py +277 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/platform/app.py +76 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/asset.py +6 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/platform/asset_catalog.py +1222 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/platform/enums.py +106 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/runs.py +57 -2
- simulo_interfaces-0.6.0/src/simulo/interfaces/platform/runtime.py +34 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/submit.py +394 -45
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/components.py +76 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/env.py +56 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/player.py +35 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/policy.py +31 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/scenario.py +37 -0
- simulo_interfaces-0.6.0/src/simulo/interfaces/runtime/task.py +70 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/runtime/trainer.py +32 -7
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0/src/simulo_interfaces.egg-info}/PKG-INFO +1 -1
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo_interfaces.egg-info/SOURCES.txt +1 -0
- simulo_interfaces-0.4.0/src/simulo/interfaces/platform/__init__.py +0 -133
- simulo_interfaces-0.4.0/src/simulo/interfaces/platform/app.py +0 -47
- simulo_interfaces-0.4.0/src/simulo/interfaces/platform/enums.py +0 -49
- simulo_interfaces-0.4.0/src/simulo/interfaces/platform/runtime.py +0 -19
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/components.py +0 -35
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/env.py +0 -27
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/player.py +0 -19
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/policy.py +0 -16
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/scenario.py +0 -13
- simulo_interfaces-0.4.0/src/simulo/interfaces/runtime/task.py +0 -21
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/MANIFEST.in +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/PYPI.md +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/setup.cfg +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/__init__.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/exceptions.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/callbacks.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/debug.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/domain.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/platform/volume.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/py.typed +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/runtime/__init__.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/runtime/anomaly.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo/interfaces/runtime/tensors.py +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo_interfaces.egg-info/dependency_links.txt +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo_interfaces.egg-info/requires.txt +0 -0
- {simulo_interfaces-0.4.0 → simulo_interfaces-0.6.0}/src/simulo_interfaces.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "simulo-interfaces"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.6.0"
|
|
8
8
|
description = "Type contracts for the Simulo SDK. Installed automatically as a dependency of the simulo package."
|
|
9
9
|
readme = "PYPI.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -19,3 +19,5 @@ ResourceUri = NewType("ResourceUri", str) # e.g. "robot/so-arm-100:v3"
|
|
|
19
19
|
Digest = NewType("Digest", str) # content-addressed package source digest
|
|
20
20
|
RecordingId = NewType("RecordingId", str) # a job-produced MCAP recording (PR-0 wire contract)
|
|
21
21
|
WorkerId = NewType("WorkerId", str) # a claiming worker process (PR-0 wire contract)
|
|
22
|
+
AssetId = NewType("AssetId", str) # a catalog asset (USD Asset Catalogs wire contract, PR-1)
|
|
23
|
+
AssetVersionId = NewType("AssetVersionId", str) # one immutable asset version (PR-1)
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"""Part B — platform/workspace domain contracts.
|
|
2
|
+
|
|
3
|
+
Wire-stable enums, frozen domain dataclasses (Project, Package, Job, Resource,
|
|
4
|
+
Checkpoint, TrainedModel, Tag), and the cloud-execution Protocols (App, Runtime,
|
|
5
|
+
Asset, Volume, job callbacks, and debug/replay/visualization sessions). All
|
|
6
|
+
implementation-free (Rule #11) — concrete behaviour lives in the future
|
|
7
|
+
``simulo`` client and the ``simulo-backend`` SDK.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from simulo.interfaces.platform.app import AppProtocol, JobFunctionProtocol, Mount
|
|
11
|
+
from simulo.interfaces.platform.asset import AssetProtocol
|
|
12
|
+
from simulo.interfaces.platform.asset_catalog import (
|
|
13
|
+
ADMIN_ASSET_ROUTE_TEMPLATE,
|
|
14
|
+
ADMIN_ASSET_VERSION_BY_NUMBER_ROUTE_TEMPLATE,
|
|
15
|
+
ADMIN_ASSET_VERSION_DEPRECATE_ROUTE_TEMPLATE,
|
|
16
|
+
ADMIN_ASSET_VERSION_ROUTE_TEMPLATE,
|
|
17
|
+
ADMIN_ASSET_VERSION_UPLOAD_COMPLETE_ROUTE_TEMPLATE,
|
|
18
|
+
ADMIN_ASSET_VERSION_UPLOAD_PARTS_ROUTE_TEMPLATE,
|
|
19
|
+
ADMIN_ASSET_VERSION_VALIDATE_ROUTE_TEMPLATE,
|
|
20
|
+
ADMIN_ASSET_VERSIONS_ROUTE_TEMPLATE,
|
|
21
|
+
ASSET_BASE_MODES,
|
|
22
|
+
ASSET_CORRUPT_CODE,
|
|
23
|
+
ASSET_DIGEST_MISMATCH_CODE,
|
|
24
|
+
ASSET_FACTS_SCHEMA_VERSION,
|
|
25
|
+
ASSET_KINDS,
|
|
26
|
+
ASSET_LIFECYCLE_ROLES,
|
|
27
|
+
ASSET_LIST_SCOPES,
|
|
28
|
+
ASSET_MISSING_CODE,
|
|
29
|
+
ASSET_NOT_EXPORTABLE_CODE,
|
|
30
|
+
ASSET_NOT_FOUND_CODE,
|
|
31
|
+
ASSET_ORIGIN_TYPES,
|
|
32
|
+
ASSET_PUBLISH_ROLES,
|
|
33
|
+
ASSET_RECONVERT_ROUTE_TEMPLATE,
|
|
34
|
+
ASSET_ROUTE_TEMPLATE,
|
|
35
|
+
ASSET_SLUG_PATTERN,
|
|
36
|
+
ASSET_SOURCE_FORMATS,
|
|
37
|
+
ASSET_UPLOAD_PART_BYTES,
|
|
38
|
+
ASSET_VALIDATION_VERDICTS,
|
|
39
|
+
ASSET_VERSION_BY_NUMBER_ROUTE_TEMPLATE,
|
|
40
|
+
ASSET_VERSION_DEPRECATE_ROUTE_TEMPLATE,
|
|
41
|
+
ASSET_VERSION_DOWNLOAD_ROUTE_TEMPLATE,
|
|
42
|
+
ASSET_VERSION_REPORT_ROUTE_TEMPLATE,
|
|
43
|
+
ASSET_VERSION_ROUTE_TEMPLATE,
|
|
44
|
+
ASSET_VERSION_STATUSES,
|
|
45
|
+
ASSET_VERSION_UPLOAD_COMPLETE_ROUTE_TEMPLATE,
|
|
46
|
+
ASSET_VERSION_UPLOAD_PARTS_ROUTE_TEMPLATE,
|
|
47
|
+
ASSET_VERSION_UPLOAD_ROUTE_TEMPLATE,
|
|
48
|
+
ASSET_VERSION_VALIDATE_ROUTE_TEMPLATE,
|
|
49
|
+
ASSET_VERSIONS_ROUTE_TEMPLATE,
|
|
50
|
+
ASSETS_FIELD,
|
|
51
|
+
ASSETS_RESOLVE_ROUTE,
|
|
52
|
+
ASSETS_ROUTE,
|
|
53
|
+
ASSETS_USAGE_ROUTE,
|
|
54
|
+
DEFAULT_ASSET_RUNTIME,
|
|
55
|
+
GLOBAL_ASSET_PUBLISHER,
|
|
56
|
+
MAX_ASSET_FILES,
|
|
57
|
+
MAX_ASSET_REF_CHARS,
|
|
58
|
+
MAX_ASSET_VERSION_BYTES,
|
|
59
|
+
MAX_ASSETS_RESOLVE_BATCH,
|
|
60
|
+
RESERVED_ASSET_PUBLISHERS,
|
|
61
|
+
WORKER_JOB_ASSET_VALIDATION_PRESIGN_ROUTE_TEMPLATE,
|
|
62
|
+
WORKER_JOB_ASSET_VALIDATION_ROUTE_TEMPLATE,
|
|
63
|
+
AssetPublishOptions,
|
|
64
|
+
AssetRecord,
|
|
65
|
+
AssetsResolveRequest,
|
|
66
|
+
AssetsResolveResponse,
|
|
67
|
+
AssetValidationFinalize,
|
|
68
|
+
AssetVersionRecord,
|
|
69
|
+
ConvertedArchive,
|
|
70
|
+
FileManifestEntry,
|
|
71
|
+
ParsedAssetRef,
|
|
72
|
+
ResolvedAssetPin,
|
|
73
|
+
ResolveMiss,
|
|
74
|
+
UploadPartSpec,
|
|
75
|
+
WorkerAssetInfo,
|
|
76
|
+
format_asset_ref,
|
|
77
|
+
parse_asset_ref,
|
|
78
|
+
)
|
|
79
|
+
from simulo.interfaces.platform.callbacks import JobCallbackProtocol
|
|
80
|
+
from simulo.interfaces.platform.debug import DebugSessionProtocol, ReplaySessionProtocol, VisualizationSessionProtocol
|
|
81
|
+
from simulo.interfaces.platform.domain import Checkpoint, Job, Package, Project, Resource, Tag, TrainedModel
|
|
82
|
+
from simulo.interfaces.platform.enums import ArtifactKind, JobStatus, ResourceKind, ResumePolicy
|
|
83
|
+
from simulo.interfaces.platform.runs import (
|
|
84
|
+
JOB_CANCEL_ROUTE_TEMPLATE,
|
|
85
|
+
JOB_LOGS_ROUTE_TEMPLATE,
|
|
86
|
+
JOB_RESULT_ROUTE_TEMPLATE,
|
|
87
|
+
JOB_ROUTE_TEMPLATE,
|
|
88
|
+
JOBS_API_DEFAULT_PORT,
|
|
89
|
+
JOBS_ROUTE,
|
|
90
|
+
LOG_CHUNK_MAX_BYTES,
|
|
91
|
+
LOG_TAIL_MAX_BYTES,
|
|
92
|
+
TERMINAL_JOB_STATUSES,
|
|
93
|
+
JobRecord,
|
|
94
|
+
)
|
|
95
|
+
from simulo.interfaces.platform.runtime import RuntimeProtocol
|
|
96
|
+
from simulo.interfaces.platform.submit import (
|
|
97
|
+
JOB_MODEL_DOWNLOAD_ROUTE_TEMPLATE,
|
|
98
|
+
JOB_MODEL_ROUTE_TEMPLATE,
|
|
99
|
+
JOB_MODELS_ROUTE_TEMPLATE,
|
|
100
|
+
JOB_RECORDING_DOWNLOAD_ROUTE_TEMPLATE,
|
|
101
|
+
JOB_RECORDINGS_ROUTE_TEMPLATE,
|
|
102
|
+
MAX_COMPLETE_MESSAGE_CHARS,
|
|
103
|
+
MAX_COMPLETE_REASON_CODE_CHARS,
|
|
104
|
+
MAX_LOG_CHUNK_BYTES,
|
|
105
|
+
MAX_LOG_TOTAL_BYTES,
|
|
106
|
+
MAX_PACKAGE_BYTES,
|
|
107
|
+
MAX_RESULT_BYTES,
|
|
108
|
+
MAX_SEED_REF_CHARS,
|
|
109
|
+
MODEL_KINDS,
|
|
110
|
+
PACKAGE_ARCHIVE_ROUTE_TEMPLATE,
|
|
111
|
+
PACKAGES_ROUTE,
|
|
112
|
+
PLATFORM_PINNED_PACKAGES,
|
|
113
|
+
RESERVED_RUNTIME_ENV_KEYS,
|
|
114
|
+
RESERVED_RUNTIME_ENV_PREFIXES,
|
|
115
|
+
SEED_JOB_REF_GRAMMAR,
|
|
116
|
+
SEED_SOURCE_CONFLICT_CODE,
|
|
117
|
+
SEED_SOURCE_FIELDS,
|
|
118
|
+
WORKER_CLAIM_ROUTE,
|
|
119
|
+
WORKER_JOB_COMPLETE_ROUTE_TEMPLATE,
|
|
120
|
+
WORKER_JOB_HEARTBEAT_ROUTE_TEMPLATE,
|
|
121
|
+
WORKER_JOB_LOGS_ROUTE_TEMPLATE,
|
|
122
|
+
WORKER_JOB_MODELS_PRESIGN_ROUTE_TEMPLATE,
|
|
123
|
+
WORKER_JOB_MODELS_ROUTE_TEMPLATE,
|
|
124
|
+
WORKER_JOB_RECORDINGS_PRESIGN_ROUTE_TEMPLATE,
|
|
125
|
+
WORKER_JOB_RECORDINGS_ROUTE_TEMPLATE,
|
|
126
|
+
WORKER_LEASE_HEADER,
|
|
127
|
+
ModelRecord,
|
|
128
|
+
RecordingRecord,
|
|
129
|
+
canonical_pypi_name,
|
|
130
|
+
is_platform_pinned,
|
|
131
|
+
)
|
|
132
|
+
from simulo.interfaces.platform.volume import VolumeProtocol
|
|
133
|
+
|
|
134
|
+
__all__ = [
|
|
135
|
+
# enums
|
|
136
|
+
"JobStatus",
|
|
137
|
+
"ResumePolicy",
|
|
138
|
+
"ResourceKind",
|
|
139
|
+
"ArtifactKind",
|
|
140
|
+
# domain dataclasses
|
|
141
|
+
"Tag",
|
|
142
|
+
"Project",
|
|
143
|
+
"Package",
|
|
144
|
+
"Resource",
|
|
145
|
+
"Job",
|
|
146
|
+
"Checkpoint",
|
|
147
|
+
"TrainedModel",
|
|
148
|
+
# job-run contract (run record schema + jobs HTTP API shape)
|
|
149
|
+
"JobRecord",
|
|
150
|
+
"TERMINAL_JOB_STATUSES",
|
|
151
|
+
"JOBS_API_DEFAULT_PORT",
|
|
152
|
+
"JOBS_ROUTE",
|
|
153
|
+
"JOB_ROUTE_TEMPLATE",
|
|
154
|
+
"JOB_CANCEL_ROUTE_TEMPLATE",
|
|
155
|
+
"JOB_LOGS_ROUTE_TEMPLATE",
|
|
156
|
+
"JOB_RESULT_ROUTE_TEMPLATE",
|
|
157
|
+
"LOG_CHUNK_MAX_BYTES",
|
|
158
|
+
"LOG_TAIL_MAX_BYTES",
|
|
159
|
+
# submit / worker / recordings wire contract (PR-0)
|
|
160
|
+
"PACKAGES_ROUTE",
|
|
161
|
+
"PACKAGE_ARCHIVE_ROUTE_TEMPLATE",
|
|
162
|
+
"JOB_RECORDINGS_ROUTE_TEMPLATE",
|
|
163
|
+
"JOB_RECORDING_DOWNLOAD_ROUTE_TEMPLATE",
|
|
164
|
+
"JOB_MODELS_ROUTE_TEMPLATE",
|
|
165
|
+
"JOB_MODEL_ROUTE_TEMPLATE",
|
|
166
|
+
"JOB_MODEL_DOWNLOAD_ROUTE_TEMPLATE",
|
|
167
|
+
"WORKER_CLAIM_ROUTE",
|
|
168
|
+
"WORKER_JOB_LOGS_ROUTE_TEMPLATE",
|
|
169
|
+
"WORKER_JOB_HEARTBEAT_ROUTE_TEMPLATE",
|
|
170
|
+
"WORKER_JOB_COMPLETE_ROUTE_TEMPLATE",
|
|
171
|
+
"WORKER_JOB_RECORDINGS_PRESIGN_ROUTE_TEMPLATE",
|
|
172
|
+
"WORKER_JOB_RECORDINGS_ROUTE_TEMPLATE",
|
|
173
|
+
"WORKER_JOB_MODELS_PRESIGN_ROUTE_TEMPLATE",
|
|
174
|
+
"WORKER_JOB_MODELS_ROUTE_TEMPLATE",
|
|
175
|
+
"WORKER_LEASE_HEADER",
|
|
176
|
+
"MAX_PACKAGE_BYTES",
|
|
177
|
+
"MAX_LOG_CHUNK_BYTES",
|
|
178
|
+
"MAX_LOG_TOTAL_BYTES",
|
|
179
|
+
"MAX_RESULT_BYTES",
|
|
180
|
+
"MAX_COMPLETE_MESSAGE_CHARS",
|
|
181
|
+
"MAX_COMPLETE_REASON_CODE_CHARS",
|
|
182
|
+
"MODEL_KINDS",
|
|
183
|
+
"ModelRecord",
|
|
184
|
+
"RecordingRecord",
|
|
185
|
+
"RESERVED_RUNTIME_ENV_KEYS",
|
|
186
|
+
"RESERVED_RUNTIME_ENV_PREFIXES",
|
|
187
|
+
"PLATFORM_PINNED_PACKAGES",
|
|
188
|
+
"is_platform_pinned",
|
|
189
|
+
"canonical_pypi_name",
|
|
190
|
+
# explicit-run-intent plan: submit-time seed source (additive)
|
|
191
|
+
"SEED_SOURCE_FIELDS",
|
|
192
|
+
"SEED_SOURCE_CONFLICT_CODE",
|
|
193
|
+
"SEED_JOB_REF_GRAMMAR",
|
|
194
|
+
"MAX_SEED_REF_CHARS",
|
|
195
|
+
# USD Asset Catalogs wire contract (PR-1) — ref grammar
|
|
196
|
+
"parse_asset_ref",
|
|
197
|
+
"format_asset_ref",
|
|
198
|
+
"ParsedAssetRef",
|
|
199
|
+
"ASSET_KINDS",
|
|
200
|
+
"ASSET_SLUG_PATTERN",
|
|
201
|
+
"RESERVED_ASSET_PUBLISHERS",
|
|
202
|
+
"GLOBAL_ASSET_PUBLISHER",
|
|
203
|
+
# asset catalog — customer routes
|
|
204
|
+
"ASSETS_ROUTE",
|
|
205
|
+
"ASSETS_RESOLVE_ROUTE",
|
|
206
|
+
"ASSETS_USAGE_ROUTE",
|
|
207
|
+
"ASSET_ROUTE_TEMPLATE",
|
|
208
|
+
"ASSET_VERSIONS_ROUTE_TEMPLATE",
|
|
209
|
+
"ASSET_RECONVERT_ROUTE_TEMPLATE",
|
|
210
|
+
"ASSET_VERSION_DEPRECATE_ROUTE_TEMPLATE",
|
|
211
|
+
"ASSET_VERSION_BY_NUMBER_ROUTE_TEMPLATE",
|
|
212
|
+
"ASSET_VERSION_ROUTE_TEMPLATE",
|
|
213
|
+
"ASSET_VERSION_UPLOAD_PARTS_ROUTE_TEMPLATE",
|
|
214
|
+
"ASSET_VERSION_UPLOAD_ROUTE_TEMPLATE",
|
|
215
|
+
"ASSET_VERSION_UPLOAD_COMPLETE_ROUTE_TEMPLATE",
|
|
216
|
+
"ASSET_VERSION_VALIDATE_ROUTE_TEMPLATE",
|
|
217
|
+
"ASSET_VERSION_REPORT_ROUTE_TEMPLATE",
|
|
218
|
+
"ASSET_VERSION_DOWNLOAD_ROUTE_TEMPLATE",
|
|
219
|
+
# asset catalog — admin routes
|
|
220
|
+
"ADMIN_ASSET_VERSIONS_ROUTE_TEMPLATE",
|
|
221
|
+
"ADMIN_ASSET_VERSION_UPLOAD_PARTS_ROUTE_TEMPLATE",
|
|
222
|
+
"ADMIN_ASSET_VERSION_UPLOAD_COMPLETE_ROUTE_TEMPLATE",
|
|
223
|
+
"ADMIN_ASSET_VERSION_VALIDATE_ROUTE_TEMPLATE",
|
|
224
|
+
"ADMIN_ASSET_VERSION_DEPRECATE_ROUTE_TEMPLATE",
|
|
225
|
+
"ADMIN_ASSET_VERSION_BY_NUMBER_ROUTE_TEMPLATE",
|
|
226
|
+
"ADMIN_ASSET_ROUTE_TEMPLATE",
|
|
227
|
+
"ADMIN_ASSET_VERSION_ROUTE_TEMPLATE",
|
|
228
|
+
# asset catalog — worker routes
|
|
229
|
+
"WORKER_JOB_ASSET_VALIDATION_PRESIGN_ROUTE_TEMPLATE",
|
|
230
|
+
"WORKER_JOB_ASSET_VALIDATION_ROUTE_TEMPLATE",
|
|
231
|
+
# asset catalog — job-submit field, roles, domains, caps, facts, codes
|
|
232
|
+
"ASSETS_FIELD",
|
|
233
|
+
"ASSET_PUBLISH_ROLES",
|
|
234
|
+
"ASSET_LIFECYCLE_ROLES",
|
|
235
|
+
"ASSET_VERSION_STATUSES",
|
|
236
|
+
"ASSET_VALIDATION_VERDICTS",
|
|
237
|
+
"ASSET_SOURCE_FORMATS",
|
|
238
|
+
"ASSET_BASE_MODES",
|
|
239
|
+
"ASSET_ORIGIN_TYPES",
|
|
240
|
+
"ASSET_LIST_SCOPES",
|
|
241
|
+
"MAX_ASSET_VERSION_BYTES",
|
|
242
|
+
"MAX_ASSET_FILES",
|
|
243
|
+
"MAX_ASSET_REF_CHARS",
|
|
244
|
+
"MAX_ASSETS_RESOLVE_BATCH",
|
|
245
|
+
"DEFAULT_ASSET_RUNTIME",
|
|
246
|
+
"ASSET_UPLOAD_PART_BYTES",
|
|
247
|
+
"ASSET_FACTS_SCHEMA_VERSION",
|
|
248
|
+
"ASSET_NOT_EXPORTABLE_CODE",
|
|
249
|
+
"ASSET_MISSING_CODE",
|
|
250
|
+
"ASSET_DIGEST_MISMATCH_CODE",
|
|
251
|
+
"ASSET_CORRUPT_CODE",
|
|
252
|
+
"ASSET_NOT_FOUND_CODE",
|
|
253
|
+
# asset catalog — wire dataclasses
|
|
254
|
+
"FileManifestEntry",
|
|
255
|
+
"AssetRecord",
|
|
256
|
+
"AssetVersionRecord",
|
|
257
|
+
"UploadPartSpec",
|
|
258
|
+
"ResolvedAssetPin",
|
|
259
|
+
"ResolveMiss",
|
|
260
|
+
"AssetsResolveRequest",
|
|
261
|
+
"AssetsResolveResponse",
|
|
262
|
+
"WorkerAssetInfo",
|
|
263
|
+
"ConvertedArchive",
|
|
264
|
+
"AssetValidationFinalize",
|
|
265
|
+
"AssetPublishOptions",
|
|
266
|
+
# protocols
|
|
267
|
+
"RuntimeProtocol",
|
|
268
|
+
"AssetProtocol",
|
|
269
|
+
"VolumeProtocol",
|
|
270
|
+
"JobCallbackProtocol",
|
|
271
|
+
"JobFunctionProtocol",
|
|
272
|
+
"AppProtocol",
|
|
273
|
+
"Mount",
|
|
274
|
+
"DebugSessionProtocol",
|
|
275
|
+
"ReplaySessionProtocol",
|
|
276
|
+
"VisualizationSessionProtocol",
|
|
277
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""User-facing job-container Protocols (Part B) — ``App`` / ``@app.job`` surface."""
|
|
2
|
+
|
|
3
|
+
from typing import Callable, Mapping, Optional, Protocol, Sequence, TypeVar, Union, overload, runtime_checkable
|
|
4
|
+
|
|
5
|
+
from simulo.interfaces.ids import JobId
|
|
6
|
+
from simulo.interfaces.platform.asset import AssetProtocol
|
|
7
|
+
from simulo.interfaces.platform.callbacks import JobCallbackProtocol
|
|
8
|
+
from simulo.interfaces.platform.enums import ResumePolicy
|
|
9
|
+
from simulo.interfaces.platform.runtime import RuntimeProtocol
|
|
10
|
+
from simulo.interfaces.platform.volume import VolumeProtocol
|
|
11
|
+
|
|
12
|
+
F = TypeVar("F", bound=Callable[..., object])
|
|
13
|
+
|
|
14
|
+
Mount = Union[AssetProtocol, VolumeProtocol]
|
|
15
|
+
"""What can be mounted into a job: a read-only asset or a writable volume."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@runtime_checkable
|
|
19
|
+
class JobFunctionProtocol(Protocol):
|
|
20
|
+
"""The contract of what ``@app.job`` returns: the user's original function, wrapped.
|
|
21
|
+
|
|
22
|
+
Decoration is source-preserving — calling the wrapper runs the original
|
|
23
|
+
body; ``submit()`` packages it for the platform instead.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __call__(self, *args: object, **kwargs: object) -> object:
|
|
27
|
+
"""Run the original job body in-process, exactly as if it were undecorated."""
|
|
28
|
+
...
|
|
29
|
+
|
|
30
|
+
def submit(self, *args: object, **kwargs: object) -> JobId:
|
|
31
|
+
"""Submit the job with the given keyword arguments; return the new job's id."""
|
|
32
|
+
...
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@runtime_checkable
|
|
36
|
+
class AppProtocol(Protocol):
|
|
37
|
+
"""The contract of the user-facing job container: ``app = simulo.App(name, mounts={...})``.
|
|
38
|
+
|
|
39
|
+
``runtime`` is optional at construction — an app defaults to the platform's
|
|
40
|
+
default Simulo runtime and may pick a different curated one via ``runtime=``.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def name(self) -> str:
|
|
45
|
+
"""The app's name, as passed at construction."""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def runtime(self) -> RuntimeProtocol:
|
|
50
|
+
"""The runtime envelope every job of this app executes in."""
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def mounts(self) -> Mapping[str, Mount]:
|
|
55
|
+
"""The assets/volumes mounted into every job of this app, by name."""
|
|
56
|
+
...
|
|
57
|
+
|
|
58
|
+
@overload
|
|
59
|
+
def job(self, fn: F) -> JobFunctionProtocol: ...
|
|
60
|
+
@overload
|
|
61
|
+
def job(
|
|
62
|
+
self, *, callbacks: Sequence[JobCallbackProtocol] = ..., resume: ResumePolicy = ...
|
|
63
|
+
) -> Callable[[F], JobFunctionProtocol]: ...
|
|
64
|
+
def job(
|
|
65
|
+
self,
|
|
66
|
+
fn: Optional[F] = None,
|
|
67
|
+
*,
|
|
68
|
+
callbacks: Sequence[JobCallbackProtocol] = (),
|
|
69
|
+
resume: ResumePolicy = ResumePolicy.AUTO,
|
|
70
|
+
) -> Union[JobFunctionProtocol, Callable[[F], JobFunctionProtocol]]:
|
|
71
|
+
"""Register a function as a job of this app (usable bare or with keyword options)."""
|
|
72
|
+
...
|
|
73
|
+
|
|
74
|
+
def local_entrypoint(self, fn: F) -> F:
|
|
75
|
+
"""Register the function ``simulo run`` invokes on the user's machine."""
|
|
76
|
+
...
|
|
@@ -8,6 +8,12 @@ class AssetProtocol(Protocol):
|
|
|
8
8
|
"""Read-only mounted cloud resource handle (Rule #6). FORWARD.
|
|
9
9
|
|
|
10
10
|
Distinct from ``simulo.core.asset.Asset`` (a USD/URDF simulation asset).
|
|
11
|
+
|
|
12
|
+
This is the user-facing *handle* protocol; the asset-catalog **wire**
|
|
13
|
+
contract (ref grammar, routes, caps, wire dataclasses) lives in
|
|
14
|
+
``simulo.interfaces.platform.asset_catalog`` — an implementation of
|
|
15
|
+
:meth:`from_registry` consumes that module's ``parse_asset_ref`` to
|
|
16
|
+
interpret ``uri``. The two modules stay decoupled (no import cycle).
|
|
11
17
|
"""
|
|
12
18
|
|
|
13
19
|
@classmethod
|