-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serve] Support customizable readiness probe timeout (#3472)
* init * format * fix doc and comment * add comment * add smoke test. TODO: test it. * add initial delay * wait for it to fail --------- Co-authored-by: Zhanghao Wu <[email protected]>
- Loading branch information
1 parent
1f418d9
commit 65bbcf5
Showing
9 changed files
with
136 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import argparse | ||
import asyncio | ||
|
||
import fastapi | ||
import uvicorn | ||
|
||
app = fastapi.FastAPI() | ||
|
||
|
||
@app.get('/') | ||
async def root(): | ||
return 'Hi, SkyPilot here!' | ||
|
||
|
||
@app.get('/health') | ||
async def health(): | ||
# Simulate a readiness probe with long processing time. | ||
await asyncio.sleep(20) | ||
return {'status': 'ok'} | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser( | ||
description='SkyServe Readiness Timeout Test Server') | ||
parser.add_argument('--port', type=int, required=True) | ||
args = parser.parse_args() | ||
uvicorn.run(app, host='0.0.0.0', port=args.port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# test.yaml | ||
service: | ||
readiness_probe: | ||
path: /health | ||
initial_delay_seconds: 120 | ||
replicas: 1 | ||
|
||
workdir: tests/skyserve/readiness_timeout | ||
|
||
resources: | ||
cpus: 2+ | ||
ports: 8081 | ||
|
||
run: python3 server.py --port 8081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# test.yaml | ||
service: | ||
readiness_probe: | ||
path: /health | ||
initial_delay_seconds: 120 | ||
timeout_seconds: 30 | ||
replicas: 1 | ||
|
||
workdir: tests/skyserve/readiness_timeout | ||
|
||
resources: | ||
cpus: 2+ | ||
ports: 8081 | ||
|
||
run: python3 server.py --port 8081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters