execution-plane-client 0.1.16__tar.gz → 0.1.17__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 (27) hide show
  1. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/PKG-INFO +1 -1
  2. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/_version.py +2 -2
  3. execution_plane_client-0.1.17/commands/work.py +109 -0
  4. execution_plane_client-0.1.16/commands/work.py +0 -43
  5. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/.gitignore +0 -0
  6. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/LICENSE +0 -0
  7. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/README.md +0 -0
  8. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/__init__.py +0 -0
  9. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/catalog.py +0 -0
  10. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/__init__.py +0 -0
  11. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/base.py +0 -0
  12. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/clusters.py +0 -0
  13. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/control.py +0 -0
  14. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/credentials.py +0 -0
  15. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/results.py +0 -0
  16. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/commands/targets.py +0 -0
  17. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/errors.py +0 -0
  18. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/handlers.py +0 -0
  19. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/models/__init__.py +0 -0
  20. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/models/cluster.py +0 -0
  21. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/models/execution_target.py +0 -0
  22. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/models/shared.py +0 -0
  23. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/models/work_item.py +0 -0
  24. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/protocol.py +0 -0
  25. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/py.typed +0 -0
  26. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/pyproject.toml +0 -0
  27. {execution_plane_client-0.1.16 → execution_plane_client-0.1.17}/registry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: execution-plane-client
3
- Version: 0.1.16
3
+ Version: 0.1.17
4
4
  Summary: Shared execution-plane command, response, and handler contracts
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.1.16'
22
- __version_tuple__ = version_tuple = (0, 1, 16)
21
+ __version__ = version = '0.1.17'
22
+ __version_tuple__ = version_tuple = (0, 1, 17)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -0,0 +1,109 @@
1
+ """Scheduling commands for the SDK-owned container gRPC contract."""
2
+
3
+ from typing import Annotated, ClassVar, Literal
4
+ from uuid import UUID
5
+
6
+ from pydantic import Field, StrictStr, field_validator
7
+
8
+ from execution_plane_client.commands.base import CommandPayload
9
+ from execution_plane_client.protocol import PositiveInt, WireModel, validate_json
10
+
11
+ StepIdentity = Annotated[StrictStr, Field(min_length=1, max_length=256, pattern=r"^[A-Za-z0-9._:-]+$")]
12
+ CREDENTIAL_RECIPE_ID_PATTERN = r"^[a-z][a-z0-9-]{0,62}(?:\.[a-z][a-z0-9-]{0,62})+$"
13
+ CredentialRecipeId = Annotated[
14
+ StrictStr,
15
+ Field(min_length=1, max_length=256, pattern=CREDENTIAL_RECIPE_ID_PATTERN),
16
+ ]
17
+
18
+
19
+ class WorkCredentialBinding(WireModel):
20
+ """One Plugin SDK recipe-to-AO credential mapping for a work item."""
21
+
22
+ credential_recipe_id: CredentialRecipeId = Field(
23
+ description="Qualified Plugin SDK CredentialRecipe identifier that the workload may request at runtime."
24
+ )
25
+ credential_ref: UUID = Field(
26
+ repr=False,
27
+ description="Opaque AO credential reference; EP resolves it only after the workload requests this recipe.",
28
+ )
29
+
30
+
31
+ class WorkloadInvocation(WireModel):
32
+ """Public invocation data; EP supplies the attempt ID and credential resolver.
33
+
34
+ Script environment variables remain ordinary step inputs. Credential-file
35
+ delivery is not implemented yet, so callers cannot supply secret values or
36
+ claim that arbitrary file paths have been mounted by EP.
37
+ """
38
+
39
+ workflow_run_id: StepIdentity = Field(description="Caller-owned identity of the workflow run containing this step.")
40
+ step_revision_id: StepIdentity = Field(
41
+ description="Workload-advertised revision of the step implementation to execute."
42
+ )
43
+ inputs: dict[str, object] = Field(
44
+ description="Step inputs defined by the selected workload; never use this field for credential bindings."
45
+ )
46
+ runtime_context: dict[str, object] = Field(
47
+ default_factory=dict,
48
+ description="Non-secret execution context supplied to the workload; not for credential bindings.",
49
+ )
50
+ credential_bindings: list[WorkCredentialBinding] = Field(
51
+ default_factory=list,
52
+ max_length=16,
53
+ repr=False,
54
+ description="Host-side recipe-to-reference bindings; never plugin inputs or runtime context.",
55
+ )
56
+ timeout_seconds: Annotated[
57
+ PositiveInt,
58
+ Field(
59
+ le=86_400,
60
+ description="Maximum workload execution time in seconds, including SDK streaming but excluding cleanup.",
61
+ ),
62
+ ]
63
+
64
+ @field_validator("inputs", "runtime_context", mode="before")
65
+ @classmethod
66
+ def check_json(cls, value: object) -> object:
67
+ """Keep nested invocation data finite, portable, and bounded."""
68
+ return validate_json(value)
69
+
70
+ @field_validator("credential_bindings")
71
+ @classmethod
72
+ def check_unique_recipe_ids(cls, value: list[WorkCredentialBinding]) -> list[WorkCredentialBinding]:
73
+ """Reject duplicate recipe IDs before host-side credential resolution."""
74
+ recipe_ids = [binding.credential_recipe_id for binding in value]
75
+ if len(set(recipe_ids)) != len(recipe_ids):
76
+ message = "Credential bindings must have unique credential recipe IDs"
77
+ raise ValueError(message)
78
+ return value
79
+
80
+
81
+ class WorkExecute(CommandPayload):
82
+ """Schedule one workload implementing the SDK container service."""
83
+
84
+ command_type: ClassVar[str] = "work.execute"
85
+
86
+ image: Annotated[
87
+ StrictStr,
88
+ Field(
89
+ min_length=1,
90
+ max_length=2048,
91
+ description="OCI image reference for the isolated cold-start workload container.",
92
+ ),
93
+ ]
94
+ selectors: dict[StrictStr, StrictStr] = Field(
95
+ default_factory=dict,
96
+ description="Exact label requirements used to select an execution target; all keys and values must match.",
97
+ )
98
+ invocation: WorkloadInvocation = Field(
99
+ repr=False,
100
+ description="Validated workload invocation, including host-side credential bindings.",
101
+ )
102
+ output_config: dict[str, str] | None = Field(
103
+ default=None,
104
+ description="Optional result-field allowlist mapping output names to workload result keys.",
105
+ )
106
+ workload_type: Literal["container"] = Field(
107
+ default="container",
108
+ description="Workload execution family; container is the only supported value.",
109
+ )
@@ -1,43 +0,0 @@
1
- """Scheduling commands for the SDK-owned container gRPC contract."""
2
-
3
- from typing import Annotated, ClassVar, Literal
4
-
5
- from pydantic import Field, StrictStr, field_validator
6
-
7
- from execution_plane_client.commands.base import CommandPayload
8
- from execution_plane_client.protocol import PositiveInt, WireModel, validate_json
9
-
10
- StepIdentity = Annotated[StrictStr, Field(min_length=1, max_length=256, pattern=r"^[A-Za-z0-9._:-]+$")]
11
-
12
-
13
- class WorkloadInvocation(WireModel):
14
- """Public invocation data; EP supplies the attempt ID and credential mounts.
15
-
16
- Script environment variables remain ordinary step inputs. Credential-file
17
- delivery is not implemented yet, so callers cannot supply secret values or
18
- claim that arbitrary file paths have been mounted by EP.
19
- """
20
-
21
- workflow_run_id: StepIdentity
22
- step_revision_id: StepIdentity
23
- inputs: dict[str, object]
24
- runtime_context: dict[str, object] = Field(default_factory=dict)
25
- timeout_seconds: Annotated[PositiveInt, Field(le=86_400)]
26
-
27
- @field_validator("inputs", "runtime_context", mode="before")
28
- @classmethod
29
- def check_json(cls, value: object) -> object:
30
- """Keep nested invocation data finite, portable, and bounded."""
31
- return validate_json(value)
32
-
33
-
34
- class WorkExecute(CommandPayload):
35
- """Schedule one workload implementing the SDK container service."""
36
-
37
- command_type: ClassVar[str] = "work.execute"
38
-
39
- image: Annotated[StrictStr, Field(min_length=1, max_length=2048)]
40
- selectors: dict[StrictStr, StrictStr] = Field(default_factory=dict)
41
- invocation: WorkloadInvocation = Field(repr=False)
42
- output_config: dict[str, str] | None = None
43
- workload_type: Literal["container"] = "container"