Skip to content

Commit 67a50a6

Browse files
committed
docs: Add executor readiness gating to /v1/ready endpoint
Update OpenAPI spec and API docs for the new /v1/ready query parameters that gate readiness on executor availability in distributed (scheduler) mode: min_ready_executors, min_ready_executors_percent, and verbose.
1 parent f8f531f commit 67a50a6

5 files changed

Lines changed: 73 additions & 8 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"parameters":[{"name":"min_ready_executors","in":"query","description":"Minimum number of currently-ready executors required for the probe to succeed. A ready executor has a live FlightSQL client that the scheduler can route queries to. A value of 0 is treated as disabled. Requires scheduler role; a non-zero value outside scheduler role returns 400.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"min_ready_executors_percent","in":"query","description":"Minimum percentage (0-100) of currently-ready executors relative to the number of registered executors. A value of 0 is treated as disabled. Values above 100 return 400. Requires scheduler role; a non-zero value outside scheduler role returns 400.","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"maximum":100}},{"name":"verbose","in":"query","description":"When true, the response body becomes a multi-line diagnostic listing the result of each gate. The HTTP status code is unchanged.","required":false,"schema":{"type":"boolean","default":false}}]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"title":"Body"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"responses":{"200":{"description":"Service is ready","content":{"text/plain":{"schema":{"type":"string"},"example":"ready"}}},"400":{"description":"Invalid query parameter or executor gate requested outside scheduler role","content":{"text/plain":{"schema":{"type":"string"},"example":"min_ready_executors_percent must be between 0 and 100"}}},"503":{"description":"Service is not ready","content":{"text/plain":{"schema":{"type":"string"},"example":"not ready"}}}}}

website/docs/api/HTTP/ready.api.mdx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Check the runtime status of all the components of the runtime. If
55
sidebar_label: "Check Readiness"
66
hide_title: true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ESlChilWSN8m6Q3szNZAshCVCozwhqXOZdkQWxczDT2U+JbPyDGcB6H6bWudE7ed+CPUa6OH/5A1azGN56R6Z+Mmpz+J4xFwWt82msxk6WgQ8fZKRpNl5Bc1g43wopws9gKQSvp26vEjTFQtrNEkXq0G+7yzdv+neanbzLXlMB4ex/HRf3msBHPmtI7Y3suWcmTnUFg22z8R6L94C7yaGAiGDR1wAbdv1Qv4ljftNyze9kmXsffj/zfnes7pg65uddUqZPCEUDcZkHvSfAmgObt0J7GH8e2TveCmIPQhXR+Rcn0E+o1OC6lzYP5JQCQG+EkdjJ9JqOm2rlaXfLw12fEB9Dv87/Ydz+50SpCDTsMzN1kH3fhxqFQ8+kg3F3qdR6tBRG2C3WSqFcCOnuxSeKJBBJXdrb8CWWM7MVPIO+RCD7CTM19t6Z64bAt+wl2bvyawIA4dBUjU3gzt314oNw3gVxvZS1oFzQCrMFwR0GKEeuALDDYVCFPc+67rQ2NLrHLJQuNXmlSWBdg54TrzEdvf8DJ6gTmVpg7NQCtpJF50rWdXP6fDIUucjiKmmAN0Fg1Z0CdrdfWe+PuS15SemXA/5VtutE3DR6o5FEJbmol+S4kxqMvnu6B9XiN6aPhoxMaDENg5U8gBt1aAEV+/FXw8Oj4excNGI8aQxnixBgCV1Fti2yfHpum6a92y9+DD6+ThdfLwOnl4nTy8TrqKtVXQkFpDtVl2NeldND8ODUz3Mw8XHp5dLhP44E9brlY83XZeXDvWream1bk3Cz+8Xu7rm3e6JRTke96IQThWI+6NP98D/7+XyechvPXO+0Kkv4E3yJ4r98+o/nqXPLAq9FvcByL0AQq3aQjy9thzRF69Dcq27MutJvfVy3P0vf8CAmPoJA==
99
sidebar_class_name: "get api-method"
1010
info_path: docs/api/HTTP/runtime
1111
custom_edit_url: null
@@ -19,6 +19,7 @@ import StatusCodes from "@theme/StatusCodes";
1919
import OperationTabs from "@theme/OperationTabs";
2020
import TabItem from "@theme/TabItem";
2121
import Heading from "@theme/Heading";
22+
import Translate from "@docusaurus/Translate";
2223

2324
<Heading
2425
as={"h1"}
@@ -41,6 +42,8 @@ Check the runtime status of all the components of the runtime. If the service is
4142

4243
The behavior for when an accelerated dataset is considered ready is configurable via the `ready_state` parameter. See [Data refresh](https://spiceai.org/docs/components/data-accelerators/data-refresh#ready-state) for more details.
4344

45+
In distributed (scheduler) mode the readiness response can additionally be gated on executor availability via the `min_ready_executors` and `min_ready_executors_percent` query parameters (both optional). Both gates must pass when supplied. Pass `verbose=true` to get a multi-line diagnostic body explaining each gate.
46+
4447
### Readiness Probe
4548
In production deployments, the /v1/ready endpoint can be used as a readiness probe for a Spice deployment to ensure traffic is routed to the Spice runtime only after all datasets have finished loading.
4649

@@ -52,23 +55,36 @@ readinessProbe:
5255
port: 8090
5356
```
5457
58+
Example with executor gating (scheduler role):
59+
```yaml
60+
readinessProbe:
61+
httpGet:
62+
path: /v1/ready?min_ready_executors=3&min_ready_executors_percent=80
63+
port: 8090
64+
```
65+
66+
<Heading
67+
id={"request"}
68+
as={"h2"}
69+
className={"openapi-tabs__heading"}
70+
>
71+
<Translate id="theme.openapi.request.title">Request</Translate>
72+
</Heading>
73+
5574
<ParamsDetails
56-
parameters={undefined}
75+
{...require("./ready.ParamsDetails.json")}
5776
>
5877
5978
</ParamsDetails>
6079
6180
<RequestSchema
62-
title={"Body"}
63-
body={undefined}
81+
{...require("./ready.RequestSchema.json")}
6482
>
6583
6684
</RequestSchema>
6785
6886
<StatusCodes
69-
id={undefined}
70-
label={undefined}
71-
responses={{"200":{"description":"Service is ready","content":{"text/plain":{"schema":{"type":"string"},"example":"ready"}}},"503":{"description":"Service is not ready","content":{"text/plain":{"schema":{"type":"string"},"example":"not ready"}}}}}
87+
{...require("./ready.StatusCodes.json")}
7288
>
7389
7490
</StatusCodes>

website/public/openapi.json

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,8 +1243,43 @@
12431243
"Ready"
12441244
],
12451245
"summary": "Check Readiness",
1246-
"description": "Check the runtime status of all the components of the runtime. If the service is ready, it returns an HTTP 200 status with the message \"ready\". If not, it returns a 503 status with the message \"not ready\".\n\nThe behavior for when an accelerated dataset is considered ready is configurable via the `ready_state` parameter. See [Data refresh](https://spiceai.org/docs/components/data-accelerators/data-refresh#ready-state) for more details.\n\n### Readiness Probe\nIn production deployments, the /v1/ready endpoint can be used as a readiness probe for a Spice deployment to ensure traffic is routed to the Spice runtime only after all datasets have finished loading.\n\nExample Kubernetes readiness probe:\n```yaml\nreadinessProbe:\n httpGet:\n path: /v1/ready\n port: 8090\n```",
1246+
"description": "Check the runtime status of all the components of the runtime. If the service is ready, it returns an HTTP 200 status with the message \"ready\". If not, it returns a 503 status with the message \"not ready\".\n\nThe behavior for when an accelerated dataset is considered ready is configurable via the `ready_state` parameter. See [Data refresh](https://spiceai.org/docs/components/data-accelerators/data-refresh#ready-state) for more details.\n\nIn distributed (scheduler) mode the readiness response can additionally be gated on executor availability via the `min_ready_executors` and `min_ready_executors_percent` query parameters (both optional). Both gates must pass when supplied. Pass `verbose=true` to get a multi-line diagnostic body explaining each gate.\n\n### Readiness Probe\nIn production deployments, the /v1/ready endpoint can be used as a readiness probe for a Spice deployment to ensure traffic is routed to the Spice runtime only after all datasets have finished loading.\n\nExample Kubernetes readiness probe:\n```yaml\nreadinessProbe:\n httpGet:\n path: /v1/ready\n port: 8090\n```\n\nExample with executor gating (scheduler role):\n```yaml\nreadinessProbe:\n httpGet:\n path: /v1/ready?min_ready_executors=3&min_ready_executors_percent=80\n port: 8090\n```",
12471247
"operationId": "ready",
1248+
"parameters": [
1249+
{
1250+
"name": "min_ready_executors",
1251+
"in": "query",
1252+
"description": "Minimum number of currently-ready executors required for the probe to succeed. A ready executor has a live FlightSQL client that the scheduler can route queries to. A value of 0 is treated as disabled. Requires scheduler role; a non-zero value outside scheduler role returns 400.",
1253+
"required": false,
1254+
"schema": {
1255+
"type": "integer",
1256+
"format": "int32",
1257+
"minimum": 0
1258+
}
1259+
},
1260+
{
1261+
"name": "min_ready_executors_percent",
1262+
"in": "query",
1263+
"description": "Minimum percentage (0-100) of currently-ready executors relative to the number of registered executors. A value of 0 is treated as disabled. Values above 100 return 400. Requires scheduler role; a non-zero value outside scheduler role returns 400.",
1264+
"required": false,
1265+
"schema": {
1266+
"type": "integer",
1267+
"format": "int32",
1268+
"minimum": 0,
1269+
"maximum": 100
1270+
}
1271+
},
1272+
{
1273+
"name": "verbose",
1274+
"in": "query",
1275+
"description": "When true, the response body becomes a multi-line diagnostic listing the result of each gate. The HTTP status code is unchanged.",
1276+
"required": false,
1277+
"schema": {
1278+
"type": "boolean",
1279+
"default": false
1280+
}
1281+
}
1282+
],
12481283
"responses": {
12491284
"200": {
12501285
"description": "Service is ready",
@@ -1257,6 +1292,17 @@
12571292
}
12581293
}
12591294
},
1295+
"400": {
1296+
"description": "Invalid query parameter or executor gate requested outside scheduler role",
1297+
"content": {
1298+
"text/plain": {
1299+
"schema": {
1300+
"type": "string"
1301+
},
1302+
"example": "min_ready_executors_percent must be between 0 and 100"
1303+
}
1304+
}
1305+
},
12601306
"503": {
12611307
"description": "Service is not ready",
12621308
"content": {

0 commit comments

Comments
 (0)