plexus-python-pulse-demeter 1.2.146__py3-none-any.whl → 1.2.147__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.
- plexus/pulse/demeter/cli.py +25 -0
- plexus/pulse/demeter/domains/robotic/capsule.py +4 -7
- plexus/pulse/demeter/domains/robotic/cli/flow_ops.py +4 -4
- plexus/pulse/demeter/domains/robotic/cli/pipeline.py +10 -11
- plexus/pulse/demeter/domains/robotic/models/flow.py +3 -1
- {plexus_python_pulse_demeter-1.2.146.dist-info → plexus_python_pulse_demeter-1.2.147.dist-info}/METADATA +1 -1
- {plexus_python_pulse_demeter-1.2.146.dist-info → plexus_python_pulse_demeter-1.2.147.dist-info}/RECORD +10 -10
- {plexus_python_pulse_demeter-1.2.146.dist-info → plexus_python_pulse_demeter-1.2.147.dist-info}/WHEEL +0 -0
- {plexus_python_pulse_demeter-1.2.146.dist-info → plexus_python_pulse_demeter-1.2.147.dist-info}/entry_points.txt +0 -0
- {plexus_python_pulse_demeter-1.2.146.dist-info → plexus_python_pulse_demeter-1.2.147.dist-info}/top_level.txt +0 -0
plexus/pulse/demeter/cli.py
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from types import SimpleNamespace
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
1
5
|
from plexus.pulse.demeter.domains.autodrive.cli.dataset import DatasetValidateCommandTool
|
|
2
6
|
from plexus.pulse.demeter.domains.autodrive.cli.tag_cache import (
|
|
3
7
|
TagCacheUploadCommandTool,
|
|
@@ -8,8 +12,29 @@ from plexus.pulse.demeter.domains.robotic.cli.pipeline import PipelineUploadComm
|
|
|
8
12
|
from plexus.pulse.demeter.platform.cli import CommandTool, run_cli
|
|
9
13
|
|
|
10
14
|
|
|
15
|
+
class VersionCommandTool(CommandTool):
|
|
16
|
+
@classmethod
|
|
17
|
+
def path(cls) -> list[str]:
|
|
18
|
+
return ["version"]
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def params(cls) -> list[click.Parameter]:
|
|
22
|
+
return []
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def desc(cls) -> str:
|
|
26
|
+
return "Show the installed Demeter package version."
|
|
27
|
+
|
|
28
|
+
def run(self, args: SimpleNamespace) -> int:
|
|
29
|
+
from plexus.pulse.demeter import __version__
|
|
30
|
+
|
|
31
|
+
click.echo(__version__)
|
|
32
|
+
return 0
|
|
33
|
+
|
|
34
|
+
|
|
11
35
|
def main() -> None:
|
|
12
36
|
tools: list[type[CommandTool]] = [
|
|
37
|
+
VersionCommandTool,
|
|
13
38
|
TagCacheUploadCommandTool,
|
|
14
39
|
TagCacheValidateCommandTool,
|
|
15
40
|
DatasetValidateCommandTool,
|
|
@@ -32,7 +32,7 @@ from plexus.pulse.demeter.domains.robotic.models.capsule import (
|
|
|
32
32
|
from plexus.pulse.demeter.domains.robotic.models.catalog import Acceptance
|
|
33
33
|
|
|
34
34
|
__all__ = [
|
|
35
|
-
"
|
|
35
|
+
"CapsuleMetadataTable",
|
|
36
36
|
"CapsuleStageRunTable",
|
|
37
37
|
"CapsuleStageInputTable",
|
|
38
38
|
"CapsuleStageInputResultTable",
|
|
@@ -57,7 +57,7 @@ class _Unset:
|
|
|
57
57
|
_unset = _Unset()
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
class
|
|
60
|
+
class CapsuleMetadataTable(BaseModel, table=True):
|
|
61
61
|
__tablename__ = "metadata"
|
|
62
62
|
|
|
63
63
|
key: str = Field(sa_column=sa.Column(sa_sqlite.VARCHAR(64), primary_key=True))
|
|
@@ -232,10 +232,7 @@ class Capsule(object):
|
|
|
232
232
|
try:
|
|
233
233
|
BaseModel.metadata.create_all(conn_maker.engine)
|
|
234
234
|
with conn_maker.make_session() as session:
|
|
235
|
-
session.add(
|
|
236
|
-
key="schema_version",
|
|
237
|
-
value=str(capsule_schema_version()),
|
|
238
|
-
))
|
|
235
|
+
session.add(CapsuleMetadataTable(key="schema_version", value=str(capsule_schema_version())))
|
|
239
236
|
if stage_run is not None:
|
|
240
237
|
session.add(CapsuleStageRunTable.model_validate(stage_run, update={"singleton": 1}))
|
|
241
238
|
session.commit()
|
|
@@ -328,7 +325,7 @@ class Capsule(object):
|
|
|
328
325
|
violation = session.execute(sa.text("PRAGMA foreign_key_check")).first()
|
|
329
326
|
if violation is not None:
|
|
330
327
|
raise ValueError(f"capsule foreign-key check failed: {tuple(violation)}")
|
|
331
|
-
db_metadata = session.get(
|
|
328
|
+
db_metadata = session.get(CapsuleMetadataTable, "schema_version")
|
|
332
329
|
if db_metadata is None or int(db_metadata.value) != capsule_schema_version():
|
|
333
330
|
actual = None if db_metadata is None else db_metadata.value
|
|
334
331
|
raise ValueError(f"unsupported capsule schema version '{actual}'")
|
|
@@ -35,13 +35,13 @@ class FlowOpsCommandTool(CommandTool):
|
|
|
35
35
|
from plexus.pulse.demeter.domains.robotic.client import PipelineApiClient
|
|
36
36
|
|
|
37
37
|
work_path = Path(os.environ.get("WORKSPACE_DIR", "/workspace")) / os.environ["ARGO_WORKFLOW_UID"]
|
|
38
|
-
|
|
38
|
+
api_client = PipelineApiClient(args.api_url)
|
|
39
39
|
|
|
40
40
|
if args.operation == "initialize":
|
|
41
41
|
options = {}
|
|
42
42
|
if "CLAIM_LIMIT" in os.environ:
|
|
43
43
|
options["claim_limit"] = int(os.environ["CLAIM_LIMIT"])
|
|
44
|
-
|
|
44
|
+
api_client.initialize(
|
|
45
45
|
work_path=work_path,
|
|
46
46
|
pipeline_name=os.environ["PULSE_DEMETER_PIPELINE_NAME"],
|
|
47
47
|
stage=os.environ["PULSE_DEMETER_STAGE"],
|
|
@@ -51,9 +51,9 @@ class FlowOpsCommandTool(CommandTool):
|
|
|
51
51
|
**options,
|
|
52
52
|
)
|
|
53
53
|
elif args.operation == "heartbeat":
|
|
54
|
-
|
|
54
|
+
api_client.heartbeat(work_path)
|
|
55
55
|
elif args.operation == "finalize":
|
|
56
|
-
|
|
56
|
+
api_client.finalize(work_path, os.environ["ARGO_WORKFLOW_STATUS"])
|
|
57
57
|
else:
|
|
58
58
|
raise ValueError("unrecognized operation")
|
|
59
59
|
return 0
|
|
@@ -97,11 +97,11 @@ def list_upload_stages(args: SimpleNamespace, console) -> int:
|
|
|
97
97
|
for label in ("Pipeline", "Stage", "Destination", "Region"):
|
|
98
98
|
table.add_column(label)
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
api_client = PipelineApiClient(args.api_url)
|
|
101
101
|
skip = 0
|
|
102
102
|
found_pipeline = False
|
|
103
103
|
while True:
|
|
104
|
-
page =
|
|
104
|
+
page = api_client.list_pipelines(skip=skip, limit=1000)
|
|
105
105
|
pipelines = page["pipelines"]
|
|
106
106
|
for pipeline in pipelines:
|
|
107
107
|
if args.pipeline and pipeline["name"] != args.pipeline:
|
|
@@ -151,8 +151,8 @@ def run(args: SimpleNamespace) -> int:
|
|
|
151
151
|
raise click.UsageError("'--list-stages' cannot be combined with a source or '--stage'")
|
|
152
152
|
if not args.list_stages:
|
|
153
153
|
if args.source is None or not args.pipeline or not args.stage:
|
|
154
|
-
raise click.UsageError(
|
|
155
|
-
|
|
154
|
+
raise click.UsageError(
|
|
155
|
+
"upload requires 'source', '--pipeline' and '--stage'; use '--list-stages' to discover targets")
|
|
156
156
|
source = args.source.expanduser().resolve()
|
|
157
157
|
if not source.is_dir():
|
|
158
158
|
raise click.UsageError(f"source '{source}' must be a directory")
|
|
@@ -222,7 +222,7 @@ def run(args: SimpleNamespace) -> int:
|
|
|
222
222
|
s3={"addressing_style": "path"},
|
|
223
223
|
request_checksum_calculation="when_required",
|
|
224
224
|
response_checksum_validation="when_required"),
|
|
225
|
-
) as
|
|
225
|
+
) as s3_client:
|
|
226
226
|
with Progress(TextColumn("{task.description}"),
|
|
227
227
|
BarColumn(),
|
|
228
228
|
DownloadColumn(),
|
|
@@ -232,14 +232,13 @@ def run(args: SimpleNamespace) -> int:
|
|
|
232
232
|
for index, (path, item) in enumerate(zip(files, manifest, strict=True), 1):
|
|
233
233
|
console.print(f"Uploading [{index}/{len(files)}] {item['path']} ({decimal(item['size_bytes'])})",
|
|
234
234
|
style="cyan")
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
s3_client.upload_file(str(path),
|
|
236
|
+
config["bucket"],
|
|
237
|
+
prefix + item["path"],
|
|
238
|
+
Callback=lambda size: progress.advance(task, size))
|
|
239
239
|
with path.open("rb") as stream:
|
|
240
240
|
if hashlib.file_digest(stream, "sha256").hexdigest() != item["sha256"]:
|
|
241
|
-
raise ValueError(f"input file '{item['path']}' changed during upload; "
|
|
242
|
-
"no stage inputs registered")
|
|
241
|
+
raise ValueError(f"input file '{item['path']}' changed during upload; no stage inputs registered")
|
|
243
242
|
|
|
244
243
|
console.print("Registering upload...", style="cyan")
|
|
245
244
|
result = api_client.complete_upload(
|
|
@@ -6,10 +6,12 @@ from plexus.common.utils.jsonutils import JsonObject
|
|
|
6
6
|
from plexus.pulse.common.utils.datautils import validate_snake_case, validate_strict_relpath
|
|
7
7
|
|
|
8
8
|
__all__ = [
|
|
9
|
-
"
|
|
9
|
+
"FlowStageInput",
|
|
10
|
+
"FlowStageOutput",
|
|
10
11
|
"FlowStage",
|
|
11
12
|
"FlowUploadStage",
|
|
12
13
|
"FlowUploadStageConfig",
|
|
14
|
+
"Flow",
|
|
13
15
|
"validate_flow",
|
|
14
16
|
]
|
|
15
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
plexus/pulse/demeter/__init__.py,sha256=vxHFsMrvJXWVyXVYFsDiQ_IUElGstGTasjWpGAwWHzA,184
|
|
2
2
|
plexus/pulse/demeter/app.py,sha256=YzqfVhfBeWi7LKjFLoyTYgEF5faHYcYcrWugHU_mhk0,2891
|
|
3
|
-
plexus/pulse/demeter/cli.py,sha256
|
|
3
|
+
plexus/pulse/demeter/cli.py,sha256=-DjFjI9vL5EnRseZSHx4V-OANDCmhMrHrLBkPA8opWw,1291
|
|
4
4
|
plexus/pulse/demeter/sdk.py,sha256=5aNhgjxzkjBCaC38MN3Kf1EJO01upvcxxQhkQVIhYNE,101
|
|
5
5
|
plexus/pulse/demeter/domains/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
plexus/pulse/demeter/domains/autodrive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -28,7 +28,7 @@ plexus/pulse/demeter/domains/autodrive/tables/inventory.py,sha256=xFJwiQUScunGIz
|
|
|
28
28
|
plexus/pulse/demeter/domains/autodrive/tables/tagging.py,sha256=3WUK9qfuRxfldFb8wseUnu-H-VAkvmRGkDhqoAvnERU,4035
|
|
29
29
|
plexus/pulse/demeter/domains/autodrive/tables/workflow.py,sha256=pOmsuRPbjDudG5_zB1Jpoo0hihTQCLqAG7WwHTF_xhQ,7541
|
|
30
30
|
plexus/pulse/demeter/domains/robotic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
plexus/pulse/demeter/domains/robotic/capsule.py,sha256=
|
|
31
|
+
plexus/pulse/demeter/domains/robotic/capsule.py,sha256=Ydz_bAfUr9Kd_UDC0Upn_vP-ehULEoSGMXdsZQFQyT8,41481
|
|
32
32
|
plexus/pulse/demeter/domains/robotic/client.py,sha256=_LeRrVw8f9NWWpy2yWjFTbSf6o0CdTmdavE-TTDCjfQ,7181
|
|
33
33
|
plexus/pulse/demeter/domains/robotic/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
plexus/pulse/demeter/domains/robotic/api/catalog_endpoints.py,sha256=-5mJdiFbaFMjzTNUK_6OH6TErnrB29d4Vb5Vj1S8k4A,40576
|
|
@@ -37,12 +37,12 @@ plexus/pulse/demeter/domains/robotic/api/pipeline_endpoints.py,sha256=S-fipOjrgX
|
|
|
37
37
|
plexus/pulse/demeter/domains/robotic/api/pipeline_internal_endpoints.py,sha256=AU8IUrbEiGOQv8o3E5r14Q6f9kEgHA3q8XVwrqgqq2Y,17723
|
|
38
38
|
plexus/pulse/demeter/domains/robotic/api/pipeline_metrics_endpoints.py,sha256=DGsABhXGJ_qg-rECu4paBOS1JpdkVV6prWsYstPzhV4,8560
|
|
39
39
|
plexus/pulse/demeter/domains/robotic/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
plexus/pulse/demeter/domains/robotic/cli/flow_ops.py,sha256=
|
|
41
|
-
plexus/pulse/demeter/domains/robotic/cli/pipeline.py,sha256=
|
|
40
|
+
plexus/pulse/demeter/domains/robotic/cli/flow_ops.py,sha256=Oy4wSmXqXkjxClQkkMxBtQm2epIcrsta1F6Kq1DiH8g,2133
|
|
41
|
+
plexus/pulse/demeter/domains/robotic/cli/pipeline.py,sha256=n6EM9jFSTXoXzDzfFlMbOkaAiZE4XovWyFjqH6zNp4c,12444
|
|
42
42
|
plexus/pulse/demeter/domains/robotic/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
plexus/pulse/demeter/domains/robotic/models/capsule.py,sha256=7_eLgL_1W8Q1ujd3uBvMnygHxRT3FSgJiN6XbN0i74w,13179
|
|
44
44
|
plexus/pulse/demeter/domains/robotic/models/catalog.py,sha256=xJjugLs8NrfKK9dpe-VJRcanbZiQShyigXVta0dFWuA,52991
|
|
45
|
-
plexus/pulse/demeter/domains/robotic/models/flow.py,sha256=
|
|
45
|
+
plexus/pulse/demeter/domains/robotic/models/flow.py,sha256=li8RKuvmtViEWnlmkLbQ46EB0mqleHZz4NJq4nIGrIg,6388
|
|
46
46
|
plexus/pulse/demeter/domains/robotic/models/pipeline.py,sha256=deRI3hG7Z4kfTRyQEb8X3BZ4RFjW4SW6JIT6aw_ET3M,19442
|
|
47
47
|
plexus/pulse/demeter/domains/robotic/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
plexus/pulse/demeter/domains/robotic/sdk/flow.py,sha256=qJkQ-RpTytTBpUtPNcwesFK-hfQDozPyknpVYlfc6hQ,719
|
|
@@ -62,8 +62,8 @@ plexus/pulse/demeter/platform/models/__init__.py,sha256=eDzE5DfmvnE1258XLGQir_K3
|
|
|
62
62
|
plexus/pulse/demeter/platform/models/iam.py,sha256=v7M6UCHoHekFbVK_shYXGln9R5DkO3Q070EtmIdRwf0,9713
|
|
63
63
|
plexus/pulse/demeter/platform/tables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
plexus/pulse/demeter/platform/tables/iam.py,sha256=K0Jaf0KIr9vKsmQ92n4_nh1ZJhN2Tr9l0JpiixBtFfg,10568
|
|
65
|
-
plexus_python_pulse_demeter-1.2.
|
|
66
|
-
plexus_python_pulse_demeter-1.2.
|
|
67
|
-
plexus_python_pulse_demeter-1.2.
|
|
68
|
-
plexus_python_pulse_demeter-1.2.
|
|
69
|
-
plexus_python_pulse_demeter-1.2.
|
|
65
|
+
plexus_python_pulse_demeter-1.2.147.dist-info/METADATA,sha256=sGNo7zJVakI843EY2Ng1S6aAquV_bDQ1IEWHKIY1Qmw,1805
|
|
66
|
+
plexus_python_pulse_demeter-1.2.147.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
67
|
+
plexus_python_pulse_demeter-1.2.147.dist-info/entry_points.txt,sha256=hJz_bf2aQIWXZTWbZIvtGQQNZFTQk-sro9leV_zHTdw,110
|
|
68
|
+
plexus_python_pulse_demeter-1.2.147.dist-info/top_level.txt,sha256=ug_g7CVwaMQuas5UzAXbHUrQvKGCn8ezc6ZNvvRlJOE,7
|
|
69
|
+
plexus_python_pulse_demeter-1.2.147.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|