sequence-base 0.3.0__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.
- sequence_base/__init__.py +134 -0
- sequence_base/auth.py +35 -0
- sequence_base/codec/__init__.py +25 -0
- sequence_base/codec/image.py +136 -0
- sequence_base/codec/resize.py +147 -0
- sequence_base/constants/__init__.py +0 -0
- sequence_base/constants/env.py +14 -0
- sequence_base/constants/headers.py +5 -0
- sequence_base/constants/version.py +9 -0
- sequence_base/contract/__init__.py +111 -0
- sequence_base/contract/accounts.py +93 -0
- sequence_base/contract/act.py +89 -0
- sequence_base/contract/benchmarks.py +130 -0
- sequence_base/contract/connect.py +53 -0
- sequence_base/contract/deployments.py +197 -0
- sequence_base/contract/errors.py +45 -0
- sequence_base/contract/eval.py +201 -0
- sequence_base/contract/flags.py +92 -0
- sequence_base/contract/policy.py +172 -0
- sequence_base/errors/__init__.py +0 -0
- sequence_base/errors/transport.py +36 -0
- sequence_base/obs/__init__.py +0 -0
- sequence_base/obs/log.py +57 -0
- sequence_base/obs/rid.py +31 -0
- sequence_base/schema_export.py +238 -0
- sequence_base/schemas/ActionChunk.json +102 -0
- sequence_base/schemas/ActionContract.json +43 -0
- sequence_base/schemas/ActionStep.json +23 -0
- sequence_base/schemas/AdapterTransform.json +42 -0
- sequence_base/schemas/Autoscaler.json +43 -0
- sequence_base/schemas/BenchmarkRegisterRequest.json +302 -0
- sequence_base/schemas/BenchmarkSpec.json +401 -0
- sequence_base/schemas/BootstrapResponse.json +76 -0
- sequence_base/schemas/ClampInfo.json +27 -0
- sequence_base/schemas/CodeBundle.json +27 -0
- sequence_base/schemas/Concurrency.json +21 -0
- sequence_base/schemas/Conditions.json +59 -0
- sequence_base/schemas/ConnectRequest.json +16 -0
- sequence_base/schemas/ConnectResponse.json +81 -0
- sequence_base/schemas/DeploymentAccepted.json +22 -0
- sequence_base/schemas/DeploymentPolicy.json +101 -0
- sequence_base/schemas/DeploymentRequest.json +467 -0
- sequence_base/schemas/DeploymentStatusResponse.json +45 -0
- sequence_base/schemas/ErrorBody.json +32 -0
- sequence_base/schemas/Estimate.json +25 -0
- sequence_base/schemas/EvalDryRunResponse.json +41 -0
- sequence_base/schemas/EvalReport.json +179 -0
- sequence_base/schemas/EvalRequest.json +111 -0
- sequence_base/schemas/EvalResponse.json +88 -0
- sequence_base/schemas/ImageFrame.json +36 -0
- sequence_base/schemas/ImageSpec.json +123 -0
- sequence_base/schemas/ImageStepApt.json +18 -0
- sequence_base/schemas/ImageStepEnv.json +18 -0
- sequence_base/schemas/ImageStepRun.json +18 -0
- sequence_base/schemas/ImageStepUvPip.json +18 -0
- sequence_base/schemas/Lease.json +28 -0
- sequence_base/schemas/LossyTransform.json +21 -0
- sequence_base/schemas/MetricAgg.json +87 -0
- sequence_base/schemas/Observation.json +133 -0
- sequence_base/schemas/PolicyRegistration.json +438 -0
- sequence_base/schemas/PolicySpec.json +346 -0
- sequence_base/schemas/Proprioception.json +67 -0
- sequence_base/schemas/RenderSpec.json +22 -0
- sequence_base/schemas/Resources.json +29 -0
- sequence_base/schemas/RolloutResult.json +59 -0
- sequence_base/schemas/SecretCreateRequest.json +25 -0
- sequence_base/schemas/SecretInfo.json +44 -0
- sequence_base/schemas/SecretRef.json +16 -0
- sequence_base/schemas/SeqFlags.json +33 -0
- sequence_base/schemas/Step.json +68 -0
- sequence_base/schemas/SuiteAgg.json +26 -0
- sequence_base/schemas/TaskAgg.json +26 -0
- sequence_base/schemas/Timeouts.json +20 -0
- sequence_base/schemas/UsageReport.json +38 -0
- sequence_base/schemas/Variant.json +24 -0
- sequence_base/schemas/VolumeAttach.json +26 -0
- sequence_base/schemas/VolumeMount.json +21 -0
- sequence_base/schemas/VolumeRef.json +28 -0
- sequence_base/schemas/WarmingError.json +50 -0
- sequence_base/telemetry/__init__.py +13 -0
- sequence_base/telemetry/events.py +101 -0
- sequence_base-0.3.0.dist-info/METADATA +12 -0
- sequence_base-0.3.0.dist-info/RECORD +84 -0
- sequence_base-0.3.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$defs": {
|
|
3
|
+
"RenderSpec": {
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"description": "a.k.a. `seq.Record` — declares the mp4 the platform records (money-shot is a platform tool, not user\nglue). `camera` picks which camera stream to pull frames from; `fps` is the output frame rate. Used two\nways: as `BenchmarkSpec.render` (record the whole eval) and as `Step.record` (a per-frame hint).",
|
|
6
|
+
"properties": {
|
|
7
|
+
"camera": {
|
|
8
|
+
"description": "Which camera to pull frames from, e.g. 'wrist' / 'agentview'",
|
|
9
|
+
"title": "Camera",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"fps": {
|
|
13
|
+
"default": 30,
|
|
14
|
+
"title": "Fps",
|
|
15
|
+
"type": "integer"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"camera"
|
|
20
|
+
],
|
|
21
|
+
"title": "RenderSpec",
|
|
22
|
+
"type": "object"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"description": "What `@seq.check` returns each step. The platform settles each env per-step from this and NEVER\ninvents a success metric — `done` is the user's call, and `metrics` keys are user-named (the platform\nneither enumerates nor validates the names; each value must be a float). A per-frame `record` hint may\nask the platform to record this frame into the mp4.",
|
|
27
|
+
"properties": {
|
|
28
|
+
"done": {
|
|
29
|
+
"title": "Done",
|
|
30
|
+
"type": "boolean"
|
|
31
|
+
},
|
|
32
|
+
"metrics": {
|
|
33
|
+
"additionalProperties": {
|
|
34
|
+
"type": "number"
|
|
35
|
+
},
|
|
36
|
+
"description": "User-named metrics; platform does not know the field names",
|
|
37
|
+
"title": "Metrics",
|
|
38
|
+
"type": "object"
|
|
39
|
+
},
|
|
40
|
+
"record": {
|
|
41
|
+
"anyOf": [
|
|
42
|
+
{
|
|
43
|
+
"$ref": "#/$defs/RenderSpec"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "null"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"default": null
|
|
50
|
+
},
|
|
51
|
+
"terminated": {
|
|
52
|
+
"default": false,
|
|
53
|
+
"title": "Terminated",
|
|
54
|
+
"type": "boolean"
|
|
55
|
+
},
|
|
56
|
+
"truncated": {
|
|
57
|
+
"default": false,
|
|
58
|
+
"title": "Truncated",
|
|
59
|
+
"type": "boolean"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"done"
|
|
64
|
+
],
|
|
65
|
+
"title": "Step",
|
|
66
|
+
"type": "object",
|
|
67
|
+
"x-contract-version": "0.4.1"
|
|
68
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "Per-suite aggregate of ONE user-named metric — structured detail, not a bare dict. `value` is the\nmetric aggregated over that suite; the platform does not name or interpret the metric.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"n": {
|
|
6
|
+
"title": "N",
|
|
7
|
+
"type": "integer"
|
|
8
|
+
},
|
|
9
|
+
"suite": {
|
|
10
|
+
"title": "Suite",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"value": {
|
|
14
|
+
"title": "Value",
|
|
15
|
+
"type": "number"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"suite",
|
|
20
|
+
"value",
|
|
21
|
+
"n"
|
|
22
|
+
],
|
|
23
|
+
"title": "SuiteAgg",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"x-contract-version": "0.4.1"
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "Per-task aggregate of ONE user-named metric — structured detail, not a bare dict.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"n": {
|
|
6
|
+
"title": "N",
|
|
7
|
+
"type": "integer"
|
|
8
|
+
},
|
|
9
|
+
"task": {
|
|
10
|
+
"title": "Task",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"value": {
|
|
14
|
+
"title": "Value",
|
|
15
|
+
"type": "number"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"task",
|
|
20
|
+
"value",
|
|
21
|
+
"n"
|
|
22
|
+
],
|
|
23
|
+
"title": "TaskAgg",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"x-contract-version": "0.4.1"
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"properties": {
|
|
4
|
+
"request": {
|
|
5
|
+
"title": "Request",
|
|
6
|
+
"type": "integer"
|
|
7
|
+
},
|
|
8
|
+
"startup": {
|
|
9
|
+
"title": "Startup",
|
|
10
|
+
"type": "integer"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"required": [
|
|
14
|
+
"request",
|
|
15
|
+
"startup"
|
|
16
|
+
],
|
|
17
|
+
"title": "Timeouts",
|
|
18
|
+
"type": "object",
|
|
19
|
+
"x-contract-version": "0.4.1"
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "POST /v1/internal/usage — the worker's async metering report. Carries counts only, no secrets.\nThis usage shape is defined here (sequence-base) once, so gateway and worker cannot drift.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"controlled_seconds": {
|
|
6
|
+
"title": "Controlled Seconds",
|
|
7
|
+
"type": "number"
|
|
8
|
+
},
|
|
9
|
+
"deployment_id": {
|
|
10
|
+
"title": "Deployment Id",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"requests": {
|
|
14
|
+
"title": "Requests",
|
|
15
|
+
"type": "integer"
|
|
16
|
+
},
|
|
17
|
+
"window_end": {
|
|
18
|
+
"format": "date-time",
|
|
19
|
+
"title": "Window End",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"window_start": {
|
|
23
|
+
"format": "date-time",
|
|
24
|
+
"title": "Window Start",
|
|
25
|
+
"type": "string"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"deployment_id",
|
|
30
|
+
"window_start",
|
|
31
|
+
"window_end",
|
|
32
|
+
"requests",
|
|
33
|
+
"controlled_seconds"
|
|
34
|
+
],
|
|
35
|
+
"title": "UsageReport",
|
|
36
|
+
"type": "object",
|
|
37
|
+
"x-contract-version": "0.4.1"
|
|
38
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "One structured variant axis of the eval matrix (e.g. axis=\"lighting\", values=[\"day\",\"night\"]).",
|
|
4
|
+
"properties": {
|
|
5
|
+
"axis": {
|
|
6
|
+
"title": "Axis",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"values": {
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"title": "Values",
|
|
14
|
+
"type": "array"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": [
|
|
18
|
+
"axis",
|
|
19
|
+
"values"
|
|
20
|
+
],
|
|
21
|
+
"title": "Variant",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"x-contract-version": "0.4.1"
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "A non-weights volume mount in the deploy body (goal 7). Distinct from `weights` (a `VolumeMount`,\na provisioned pull at the reserved `/data`): an explicit `volumes=` attachment names a persistent\nvolume by `vol://<name>` ref, pins its container `mount`, and carries the `create_if_missing`\nprovisioning intent so the gateway either binds an existing volume or creates it — the semantic the\nwire `VolumeMount` deliberately does not carry. Not reused/extended from `VolumeMount` because\n`create_if_missing` is meaningless for the weights pull.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"create_if_missing": {
|
|
6
|
+
"title": "Create If Missing",
|
|
7
|
+
"type": "boolean"
|
|
8
|
+
},
|
|
9
|
+
"mount": {
|
|
10
|
+
"title": "Mount",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"uri": {
|
|
14
|
+
"title": "Uri",
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"uri",
|
|
20
|
+
"mount",
|
|
21
|
+
"create_if_missing"
|
|
22
|
+
],
|
|
23
|
+
"title": "VolumeAttach",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"x-contract-version": "0.4.1"
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "A concrete mount: where the data lives and where it lands in the container. Both required.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"mount": {
|
|
6
|
+
"title": "Mount",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"uri": {
|
|
10
|
+
"title": "Uri",
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": [
|
|
15
|
+
"uri",
|
|
16
|
+
"mount"
|
|
17
|
+
],
|
|
18
|
+
"title": "VolumeMount",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"x-contract-version": "0.4.1"
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"description": "PolicySpec.volumes value — at least a `uri`; a `mount` may pin the container path.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"mount": {
|
|
6
|
+
"anyOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "null"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"default": null,
|
|
15
|
+
"title": "Mount"
|
|
16
|
+
},
|
|
17
|
+
"uri": {
|
|
18
|
+
"title": "Uri",
|
|
19
|
+
"type": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"uri"
|
|
24
|
+
],
|
|
25
|
+
"title": "VolumeRef",
|
|
26
|
+
"type": "object",
|
|
27
|
+
"x-contract-version": "0.4.1"
|
|
28
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$defs": {
|
|
3
|
+
"ErrorCode": {
|
|
4
|
+
"description": "Restricted set — a client switches on this, so it is an enum, not a free string.",
|
|
5
|
+
"enum": [
|
|
6
|
+
"out_of_credit",
|
|
7
|
+
"unauthorized",
|
|
8
|
+
"warming"
|
|
9
|
+
],
|
|
10
|
+
"title": "ErrorCode",
|
|
11
|
+
"type": "string"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"description": "503 body — worker cold / warming. Adds the two retry hints so `503 + Retry-After` and the\nwarming ETA are expressible in the type, not smuggled in an HTTP header alone. `code` defaults to\nWARMING; a caller waits `retry_after_s` and, when known, learns `eta_s` until hot.",
|
|
16
|
+
"properties": {
|
|
17
|
+
"code": {
|
|
18
|
+
"$ref": "#/$defs/ErrorCode",
|
|
19
|
+
"default": "warming"
|
|
20
|
+
},
|
|
21
|
+
"eta_s": {
|
|
22
|
+
"anyOf": [
|
|
23
|
+
{
|
|
24
|
+
"type": "integer"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "null"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"default": null,
|
|
31
|
+
"description": "Seconds until warm, when estimable",
|
|
32
|
+
"title": "Eta S"
|
|
33
|
+
},
|
|
34
|
+
"message": {
|
|
35
|
+
"title": "Message",
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"retry_after_s": {
|
|
39
|
+
"title": "Retry After S",
|
|
40
|
+
"type": "integer"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"message",
|
|
45
|
+
"retry_after_s"
|
|
46
|
+
],
|
|
47
|
+
"title": "WarmingError",
|
|
48
|
+
"type": "object",
|
|
49
|
+
"x-contract-version": "0.4.1"
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Telemetry event schemas shared between the worker (which emits) and the gateway (which ingests).
|
|
3
|
+
|
|
4
|
+
from sequence_base.telemetry import WorkerLogEvent, Stage, WORKER_LOG_PATH
|
|
5
|
+
"""
|
|
6
|
+
from sequence_base.telemetry.events import (
|
|
7
|
+
STAGES,
|
|
8
|
+
WORKER_LOG_PATH,
|
|
9
|
+
Stage,
|
|
10
|
+
WorkerLogEvent,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = ["WorkerLogEvent", "Stage", "STAGES", "WORKER_LOG_PATH"]
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Cold-start telemetry event schema — the shape the worker POSTs and the gateway ingests.
|
|
3
|
+
|
|
4
|
+
A serverless worker fires one event per cold-start stage to the gateway's WORKER_LOG_PATH, which
|
|
5
|
+
writes it to Supabase (worker_coldstart), so "where did this worker stall" is a query rather than a
|
|
6
|
+
RunPod console tab that vanishes with the worker. The event shape + the stage vocabulary + the path
|
|
7
|
+
are defined ONCE here so the worker's emit() and the gateway's ingest route cannot spell them
|
|
8
|
+
differently — the whole point of the table is undone if the two disagree on a field name.
|
|
9
|
+
|
|
10
|
+
Why a byte count and not a wall-clock deadline drives the heartbeat: a heavy model can legitimately
|
|
11
|
+
take 6-13 minutes to cold start and we never know the ceiling, so a fixed "stuck after N s" either
|
|
12
|
+
kills a slow-but-fine start or lets a hung one sit. A byte count that STOPS ADVANCING needs no
|
|
13
|
+
ceiling — that is why HEARTBEAT detail carries bytes. {USER 2026-09-21 "WE NEVER KNOW HOW LONG IT
|
|
14
|
+
MIGHT TAKE, WE NEED BETTER WAYS BY FIGURING OUT THE REAL ROOT CAUSE"}
|
|
15
|
+
|
|
16
|
+
`Stage` is the CLOSED, canonical vocabulary (O4 goal 9): one spelling per phase, shared verbatim by
|
|
17
|
+
the worker's emit-side constants, the gateway's ingest/migration/admin reader, and observability.md.
|
|
18
|
+
`ready` — never `replica_ready` — is the single terminal spelling; a reader filtering on the wrong
|
|
19
|
+
string silently drops rows, which is the exact bug this closed set exists to prevent. The set enumerates
|
|
20
|
+
every phase G8/G9 need: provision_start → heartbeat* → provision_done → load_start → load_done → ready,
|
|
21
|
+
with `error` on any failure. Cross-repo dependency: the gateway WU that owns worker_coldstart must
|
|
22
|
+
carry these same spellings in its migration comment + admin reader (they are not in this repo).
|
|
23
|
+
"""
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
from datetime import datetime
|
|
27
|
+
|
|
28
|
+
from pydantic import BaseModel
|
|
29
|
+
|
|
30
|
+
# The gateway route that ingests these events. The worker POSTs here; the gateway writes to Supabase.
|
|
31
|
+
WORKER_LOG_PATH = "/v1/internal/worker-log"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Stage:
|
|
35
|
+
"""Cold-start stages, in order — ONE canonical spelling each (O4 goal 9).
|
|
36
|
+
|
|
37
|
+
provision_start -> (heartbeat every HEARTBEAT_S through the long weight fetch) -> provision_done
|
|
38
|
+
-> load_start -> load_done -> ready. `error` fires on any failure along the way.
|
|
39
|
+
|
|
40
|
+
load_done carries the child-measured @seq.load duration (`load_ms`); `ready` is the single terminal
|
|
41
|
+
stage (the pre-O4 `replica_ready` spelling is retired — it drifted from observability.md's `ready`
|
|
42
|
+
and made the admin reader silently drop rows).
|
|
43
|
+
"""
|
|
44
|
+
PROVISION_START = "provision_start"
|
|
45
|
+
HEARTBEAT = "heartbeat"
|
|
46
|
+
PROVISION_DONE = "provision_done"
|
|
47
|
+
LOAD_START = "load_start"
|
|
48
|
+
LOAD_DONE = "load_done"
|
|
49
|
+
READY = "ready"
|
|
50
|
+
ERROR = "error"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# The closed set — the reference every reader filters against. A `stage` outside this set is a spelling
|
|
54
|
+
# bug, not a new phase.
|
|
55
|
+
STAGES = frozenset({
|
|
56
|
+
Stage.PROVISION_START,
|
|
57
|
+
Stage.HEARTBEAT,
|
|
58
|
+
Stage.PROVISION_DONE,
|
|
59
|
+
Stage.LOAD_START,
|
|
60
|
+
Stage.LOAD_DONE,
|
|
61
|
+
Stage.READY,
|
|
62
|
+
Stage.ERROR,
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class WorkerLogEvent(BaseModel):
|
|
67
|
+
"""One cold-start event. The worker builds it, POSTs it to WORKER_LOG_PATH as JSON; the gateway
|
|
68
|
+
parses it with this same model and writes it to worker_coldstart.
|
|
69
|
+
|
|
70
|
+
`detail` is whatever the stage carries — bytes/total_bytes/rate_mbps/elapsed_s for a heartbeat, a
|
|
71
|
+
reason for an error, load_ms for load_done/ready, nothing for a bare transition — and lands as the
|
|
72
|
+
row's jsonb `detail`. `stage` is kept a free `str` (not an enum) so a worker on an older/newer build
|
|
73
|
+
never fails to log over a vocabulary mismatch; `STAGES` is the reference set for the reader.
|
|
74
|
+
|
|
75
|
+
Three fields carry the timeline / correlation / idempotency the pre-O4 event lacked (O4 goals 11/12/17):
|
|
76
|
+
• `emitted_at` — the worker's LOCAL wall clock at the instant it emitted this event. The ingest
|
|
77
|
+
persists it and the admin reader orders by it (per-worker timeline), so ordering no longer
|
|
78
|
+
depends on the DB `created_at` insert instant. Optional so a legacy emitter still parses; a row
|
|
79
|
+
missing it must not be treated as newest by the reader.
|
|
80
|
+
• `rid` — a correlation id tying every event of ONE cold start together and back to the connect /
|
|
81
|
+
ensure_up that triggered the boot. Derived from the worker's verified bootstrap identity
|
|
82
|
+
(instance + lease epoch), NOT self-minted-unrelated. Cross-repo dependency: to correlate further
|
|
83
|
+
to the SDK's per-act rid, the gateway must mint an id at connect/ensure_up and hand it down in
|
|
84
|
+
the bootstrap response — a field this repo does not yet carry.
|
|
85
|
+
• `dedup_key` — a stable per-event key so a fire-and-forget re-delivery or a racing daemon thread
|
|
86
|
+
does not double-write or reorder the timeline. The ingest is idempotent on it.
|
|
87
|
+
|
|
88
|
+
Attribution note (O4 goal 1/6): `endpoint_id`/`worker_id`/`model_id` are the worker's own best
|
|
89
|
+
identity (its verified instance/deployment claim), but they are NOT authoritative — the gateway
|
|
90
|
+
derives the persisted attribution from the instance-identity JWT it verifies on ingest and ignores
|
|
91
|
+
these body fields. They are kept for a human reading a raw event, not trusted for keying.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
endpoint_id: str
|
|
95
|
+
worker_id: str
|
|
96
|
+
model_id: str
|
|
97
|
+
stage: str
|
|
98
|
+
detail: dict | None = None
|
|
99
|
+
emitted_at: datetime | None = None
|
|
100
|
+
rid: str | None = None
|
|
101
|
+
dedup_key: str | None = None
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sequence-base
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Shared foundation for the Sequences platform — wire contract, correlation, error taxonomy, constants. Used by the robot SDK, gateway, and container harness.
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: pydantic>=2.0
|
|
7
|
+
Provides-Extra: codec
|
|
8
|
+
Requires-Dist: numpy>=1.26; extra == 'codec'
|
|
9
|
+
Requires-Dist: pillow>=10; extra == 'codec'
|
|
10
|
+
Provides-Extra: test
|
|
11
|
+
Requires-Dist: jsonschema>=4; extra == 'test'
|
|
12
|
+
Requires-Dist: pytest; extra == 'test'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
sequence_base/__init__.py,sha256=-CII2EyVEVyEA8dznMDpQUMqIgZeI-Xqq7kLf2e1V7I,4683
|
|
2
|
+
sequence_base/auth.py,sha256=GIws-TiCcW6Bk_RLdUr0iED7sJG2-nsMRTUvjbcW8ug,1415
|
|
3
|
+
sequence_base/schema_export.py,sha256=_GWEi_8d4cSs07MY_E5xhpmFMkieSVW_yj2p2xWd9Co,8568
|
|
4
|
+
sequence_base/codec/__init__.py,sha256=ylzPxUVc8G1k474nkv0smVxGFtIKAmSqriZ6Tt1qKos,895
|
|
5
|
+
sequence_base/codec/image.py,sha256=p_g8LyyJizd3LRp4e0Kpf6cLbkxb-Vb3lrwmvojHD3k,7392
|
|
6
|
+
sequence_base/codec/resize.py,sha256=rSCntB6H_i8n-0LnTzc2IamcTkg_BxenNJ-fWEHqA88,7820
|
|
7
|
+
sequence_base/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
sequence_base/constants/env.py,sha256=XvAWS-1HEzh_QlPFUX4HykHf8uX72K9wi0Px8Nu64zY,693
|
|
9
|
+
sequence_base/constants/headers.py,sha256=FyryksqM5gBi9uGhOn7ogATdf-vT4gIdjR5edM5LWMs,345
|
|
10
|
+
sequence_base/constants/version.py,sha256=C46aDJ3rX4Nj-ogmpMbjqbVMQh25G_FCJOqtCNVO3MY,839
|
|
11
|
+
sequence_base/contract/__init__.py,sha256=ampkKRSzaq-sq03IirfYX00WIWYcgCvEgyMyVNfZhvE,3147
|
|
12
|
+
sequence_base/contract/accounts.py,sha256=W827lAaHFeG-H3H7OKnUJA_j_KavzpzxKAKsD79E_rQ,4312
|
|
13
|
+
sequence_base/contract/act.py,sha256=sL3xyMPOXyv-oDQf_rva5pZjoZOWea_X5k4TfvNRQjk,3710
|
|
14
|
+
sequence_base/contract/benchmarks.py,sha256=lQ4FQ9b79WbACuidkWwK81FgjKzee_uta8o7GQ5qpVw,5575
|
|
15
|
+
sequence_base/contract/connect.py,sha256=cBDJOKrWAK_FODMaCJVTsA_EXdarDIoTkMmxUTvcRQo,2372
|
|
16
|
+
sequence_base/contract/deployments.py,sha256=PCYFKv20AvMNQI6rbCPSTf7TschvIBovrPJfOUT98lU,7592
|
|
17
|
+
sequence_base/contract/errors.py,sha256=0ir15CCh8SuPj6-ooMcYkujcjMokgkZbsyviyJTBh5U,1874
|
|
18
|
+
sequence_base/contract/eval.py,sha256=nQxz9i-EuJfibBt1f0vWO3h3pSU3sd0aFJ79B3WS198,6517
|
|
19
|
+
sequence_base/contract/flags.py,sha256=JORTWAMxJJWEtBTswCbNKASeeRqsrnVXWaqswMTJyD4,5789
|
|
20
|
+
sequence_base/contract/policy.py,sha256=ppn-KNAv53pVXpmv9C3QY07s-QiWqK4GE2hENwGZtlk,6820
|
|
21
|
+
sequence_base/errors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
sequence_base/errors/transport.py,sha256=oMI7AVkXSwlVccu_3aJEZkbvcrBWsaCyzjd5VgrdbE4,1576
|
|
23
|
+
sequence_base/obs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
+
sequence_base/obs/log.py,sha256=slLnSwjqTwybRehgtVRvVplY9ERDlAMSZscasIDvwiE,2023
|
|
25
|
+
sequence_base/obs/rid.py,sha256=5-YS8bgTLPsdSAbIteHoCDm2n44UDWCSdxSIJls7uwE,1143
|
|
26
|
+
sequence_base/schemas/ActionChunk.json,sha256=zpDvb8tk22Cq0nfo9Qy1DHSd6E6Df7C5MmZvApYt1ws,2259
|
|
27
|
+
sequence_base/schemas/ActionContract.json,sha256=izM_o_dYt6cC0l40tuBAnm4AjwfgIbQl3BP5Cx9TB-g,1180
|
|
28
|
+
sequence_base/schemas/ActionStep.json,sha256=Lfi2dtG0vxMb4PvG0IrLAJ_eWHvOZ6UQ6GMiVl1e-Yc,374
|
|
29
|
+
sequence_base/schemas/AdapterTransform.json,sha256=3swGoQ4pMJTjSLNrGb1XFPdQV4yP4_LG7uGEI6G9Nqs,891
|
|
30
|
+
sequence_base/schemas/Autoscaler.json,sha256=n4vtSCPdo6iPllb0CS-9JykJNWRvyAWf1_-Jz25sFYU,888
|
|
31
|
+
sequence_base/schemas/BenchmarkRegisterRequest.json,sha256=Haqrwduoc-byQJ8JL3du1nWtjXNRb_HketwxrZ7OSRw,7386
|
|
32
|
+
sequence_base/schemas/BenchmarkSpec.json,sha256=RzD-vP7j4CFfVl1yMGegBw2C7pZAi8RnKeamSDqIXp8,9860
|
|
33
|
+
sequence_base/schemas/BootstrapResponse.json,sha256=bLAgWPJXaSeM4ap0pAdAEbl7b9x2-rEqzZyXNOcqj8I,2209
|
|
34
|
+
sequence_base/schemas/ClampInfo.json,sha256=UlB1d3ZleoNV3Phy2dfTw3NJCoNXQ3TFG1KfvTedj2A,598
|
|
35
|
+
sequence_base/schemas/CodeBundle.json,sha256=Oafylk0UbLj4dldLB9C6GW0XnI_hUanwpimoaiMkMSk,837
|
|
36
|
+
sequence_base/schemas/Concurrency.json,sha256=wntnQySxs5cbYpf_tKD_JASkrg41bIqZmbij2-DiRL0,435
|
|
37
|
+
sequence_base/schemas/Conditions.json,sha256=PoKrPoGe6j5UmgtwGC73pdyZ0YJKdfUSHakncgwR5rA,1251
|
|
38
|
+
sequence_base/schemas/ConnectRequest.json,sha256=5lWNjvr9j88Kg9s8jHjdlEPjzSbdio41eDSgw75MdVI,296
|
|
39
|
+
sequence_base/schemas/ConnectResponse.json,sha256=rP8SAsswnjHOiNisrYwEdQpmcgpgwWTJzxBGWkHGZH4,2325
|
|
40
|
+
sequence_base/schemas/DeploymentAccepted.json,sha256=Ej3eCXikvwgCqgaUtd9wdto1z6ISk-F6AZYKSzTTE34,499
|
|
41
|
+
sequence_base/schemas/DeploymentPolicy.json,sha256=0L16HmIchLsbwaTFUbfAZ6QPR4TDecZGSndS7AqWHgk,3156
|
|
42
|
+
sequence_base/schemas/DeploymentRequest.json,sha256=jK5rGGkQf3SHy-4hi6G9HEOhRcDBSeL_7bvV9i5AGjw,12799
|
|
43
|
+
sequence_base/schemas/DeploymentStatusResponse.json,sha256=GbUZ_NbtjjgaTXMn_3tfqO4Vo7dK94VNL5jh6ut-yuE,1059
|
|
44
|
+
sequence_base/schemas/ErrorBody.json,sha256=HPb9_djSULYV0b6FKitiakZmGWeMessIci9MBwDRpSg,706
|
|
45
|
+
sequence_base/schemas/Estimate.json,sha256=SKeKvAc6FnE0Vt3ex8yNoMcFgmQUc9GCDNBWYkjZYHY,443
|
|
46
|
+
sequence_base/schemas/EvalDryRunResponse.json,sha256=9U54kK-2SICjMhINUAt8PAG2qWPkzrzDLVLbNJtDgK8,892
|
|
47
|
+
sequence_base/schemas/EvalReport.json,sha256=ABESgEzL0TEIPdRBw-3esSLiPpbl0WdPOAZ_gF0cksc,4831
|
|
48
|
+
sequence_base/schemas/EvalRequest.json,sha256=6TCDRJ_tLDjZRU20IKxtCjbf1HZEXNK-98P-9kK2e4Y,1996
|
|
49
|
+
sequence_base/schemas/EvalResponse.json,sha256=uF2PgWG-t7Os_KI1x9xOy7DQ6OjoxPkwm0XnYPNRlLk,1943
|
|
50
|
+
sequence_base/schemas/ImageFrame.json,sha256=nWZqGrxk2GR6wdEbd_6eobaPHMT3k_KC76XASkC7kYk,925
|
|
51
|
+
sequence_base/schemas/ImageSpec.json,sha256=vUQRiAwedIfYrIMUwE-AFZWXaScGJZ8KPn3Th934lXM,2869
|
|
52
|
+
sequence_base/schemas/ImageStepApt.json,sha256=HNeu9c6lvfD7amzyosq143WkZvcDEzRck8SHt7x8ZcE,308
|
|
53
|
+
sequence_base/schemas/ImageStepEnv.json,sha256=P_dyI5maSIWT5l7s5rdI-jJoGy5itxgQXVTfDvs_uKw,300
|
|
54
|
+
sequence_base/schemas/ImageStepRun.json,sha256=sFdL4qyA1_zJAgu4qQuMqsmLkqLS9h4CHKR78u3S0rM,311
|
|
55
|
+
sequence_base/schemas/ImageStepUvPip.json,sha256=cmdw2dEgW0hqRAX-KohmUWpO6B8fQydrcP29DqIarSU,319
|
|
56
|
+
sequence_base/schemas/Lease.json,sha256=2gysClhNg8pTDjcu2JL0Tu_2H4HUR00qvzA9k6rzKwU,747
|
|
57
|
+
sequence_base/schemas/LossyTransform.json,sha256=bOGRPo5_rsLn1fe1CCS6nZxdwlj4g4ObfyVvM_XC-Jc,494
|
|
58
|
+
sequence_base/schemas/MetricAgg.json,sha256=u5yoNTrgwfVzwE2wW8e9qOypMTSigkHht2nXw3emkEc,2171
|
|
59
|
+
sequence_base/schemas/Observation.json,sha256=vvqyEnoRsZ99TIPSp-smPHjH2PYSwdUlGt5OeZm6wRA,3294
|
|
60
|
+
sequence_base/schemas/PolicyRegistration.json,sha256=m2Cho_zU76YgEquX7RHnsB1PtbRhWyS2Z3gLOj2enIg,11085
|
|
61
|
+
sequence_base/schemas/PolicySpec.json,sha256=p2rfq5hY_D6kX60uynvcmj3TZpr4RAnTMJA2uXcabIQ,8390
|
|
62
|
+
sequence_base/schemas/Proprioception.json,sha256=u4w-bSdFIAulhGcJUu51b7PXFoUuwPcui9VuZTsAOxI,1329
|
|
63
|
+
sequence_base/schemas/RenderSpec.json,sha256=XTEgjfdrNVE6V2ebb5VKCPGIaEFQxRAvrk5aWOPY3zE,739
|
|
64
|
+
sequence_base/schemas/Resources.json,sha256=1AxVfsRNlcwsB7Kmdbs9rFBpaIn2jRNdDwO_ge8nfpc,570
|
|
65
|
+
sequence_base/schemas/RolloutResult.json,sha256=SFN6-K-nAX6iKR_NXDesC27YlEPOEh3ag1XBh5-vBJc,1587
|
|
66
|
+
sequence_base/schemas/SecretCreateRequest.json,sha256=4LXKiYjxhLzyHxPUmIGvoN_E0i72z8lov9Mza2c_FLs,666
|
|
67
|
+
sequence_base/schemas/SecretInfo.json,sha256=mAIU-c1mIeXl--Ml7Vv_qEMHjp8XFLHx6OtT5WgItEU,918
|
|
68
|
+
sequence_base/schemas/SecretRef.json,sha256=FYITdNKirO1qzZKG-GeCOa2G6MxqB4hTYYmfwCKpDqY,441
|
|
69
|
+
sequence_base/schemas/SeqFlags.json,sha256=NRiXkzj9BcRyM2GKpxZfa-W0-FjU-N5VTep3YwuhPiU,570
|
|
70
|
+
sequence_base/schemas/Step.json,sha256=rCLQS4cMDc2I4qvndaZlH_-VhxiBMj-QWa6vudybHng,2034
|
|
71
|
+
sequence_base/schemas/SuiteAgg.json,sha256=O_G0VdfokQq6Y227_kI70twVaafUEbY2sVJG-ldb52o,597
|
|
72
|
+
sequence_base/schemas/TaskAgg.json,sha256=rPvVCBZ37ej5EHPbfJ2cJrp0hq3oKJSySDrNOnGa2Fs,489
|
|
73
|
+
sequence_base/schemas/Timeouts.json,sha256=6ea8jpkeeV09S0wS67IM0PD8GlsNtTd2i3rL6QU7MNI,332
|
|
74
|
+
sequence_base/schemas/UsageReport.json,sha256=pPrz_egnFAxeuj6BEb2lVAWC_jqzD25dGkRRXx0cRms,943
|
|
75
|
+
sequence_base/schemas/Variant.json,sha256=mOUyIyj6shqGk0YUmnzqEv_wzshw9DzBXfuhJgBG30w,488
|
|
76
|
+
sequence_base/schemas/VolumeAttach.json,sha256=omDeojuvjHX_Wm8vcmJr7ArgAZImQh_SApv-RWbG_4Y,1004
|
|
77
|
+
sequence_base/schemas/VolumeMount.json,sha256=aOymdkoUNotQc0Sc4i_l_nfojIJky9RYZs4_2qxz_8s,426
|
|
78
|
+
sequence_base/schemas/VolumeRef.json,sha256=Vl3cD7C2YZAaFh47vXCZRzgouoh0MTh0gAzH-9LaXeo,523
|
|
79
|
+
sequence_base/schemas/WarmingError.json,sha256=m3zhJWFmXdJ6-6ITgH-Z8RkjJJX5UIO3uGzTykXVJ2o,1271
|
|
80
|
+
sequence_base/telemetry/__init__.py,sha256=mCU43MAEuuN0DvlIM8HV70UHHUQ7T3-tNc6X3m_YYsU,364
|
|
81
|
+
sequence_base/telemetry/events.py,sha256=wuewXEEDagnzlhCy8O1PDm5IsSOgENN3Z7HQQpFPXzg,5465
|
|
82
|
+
sequence_base-0.3.0.dist-info/METADATA,sha256=fMaWjD5P-N-i_inZI2wpmNUQ5CCbswY2S1FVNHurQLQ,495
|
|
83
|
+
sequence_base-0.3.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
84
|
+
sequence_base-0.3.0.dist-info/RECORD,,
|