update the modal deployment logic
All checks were successful
Triton Modal Trigger / deploy-to-modal (push) Successful in 11s
All checks were successful
Triton Modal Trigger / deploy-to-modal (push) Successful in 11s
This commit is contained in:
@@ -7,7 +7,7 @@ jobs:
|
|||||||
deploy-to-modal:
|
deploy-to-modal:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: gitea-modal-runner:latest
|
image: gitea-modal-runner:latest # where build the code
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|||||||
@@ -25,6 +25,26 @@ triton_image = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
app = modal.App("triton-s3-service", image=triton_image)
|
app = modal.App("triton-s3-service", image=triton_image)
|
||||||
|
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
# THE UNIFIED SERVICE FUNCTION (1 Container, 1 GPU, 1 Triton Process)
|
||||||
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
|
@app.function(
|
||||||
|
gpu="T4", # for the expense
|
||||||
|
timeout=3600,
|
||||||
|
max_containers=3, # Strict production capping
|
||||||
|
min_containers=1, # for keeping warm and prevention,
|
||||||
|
buffer_containers=2, # Number of additional idle containers to maintain under active load.
|
||||||
|
scaledown_window=30, # Max time (in seconds) a container can remain idle while scaling down.
|
||||||
|
volumes= {
|
||||||
|
'/mnt/vkist-ml-model' : modal.CloudBucketMount(bucket_name="vkist-ml-model", secret=modal.Secret.from_name("aws-secrets"))
|
||||||
|
},
|
||||||
|
secrets=[modal.Secret.from_name("aws-secrets")]
|
||||||
|
)
|
||||||
|
@modal.asgi_app()
|
||||||
|
def unified_triton_server():
|
||||||
|
|
||||||
from fastapi import FastAPI, Response, Request,HTTPException
|
from fastapi import FastAPI, Response, Request,HTTPException
|
||||||
from fastapi.responses import StreamingResponse # 👈 ADD THIS IMPORT
|
from fastapi.responses import StreamingResponse # 👈 ADD THIS IMPORT
|
||||||
import httpx
|
import httpx
|
||||||
@@ -194,24 +214,6 @@ async def forward_list_models():
|
|||||||
r = await client.get("http://127.0.0.1:8000/v2/models")
|
r = await client.get("http://127.0.0.1:8000/v2/models")
|
||||||
return Response(content=r.content, status_code=r.status_code, media_type=r.headers.get("content-type"))
|
return Response(content=r.content, status_code=r.status_code, media_type=r.headers.get("content-type"))
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
# THE UNIFIED SERVICE FUNCTION (1 Container, 1 GPU, 1 Triton Process)
|
|
||||||
# -------------------------------------------------------------
|
|
||||||
|
|
||||||
@app.function(
|
|
||||||
gpu="T4", # for the expense
|
|
||||||
timeout=3600,
|
|
||||||
max_containers=3, # Strict production capping
|
|
||||||
min_containers=1, # for keeping warm and prevention,
|
|
||||||
buffer_containers=2, # Number of additional idle containers to maintain under active load.
|
|
||||||
scaledown_window=30, # Max time (in seconds) a container can remain idle while scaling down.
|
|
||||||
volumes= {
|
|
||||||
'/mnt/vkist-ml-model' : modal.CloudBucketMount(bucket_name="vkist-ml-model", secret=modal.Secret.from_name("aws-secrets"))
|
|
||||||
},
|
|
||||||
secrets=[modal.Secret.from_name("aws-secrets")]
|
|
||||||
)
|
|
||||||
@modal.asgi_app()
|
|
||||||
def unified_triton_server():
|
|
||||||
print("🚀 Booting ONE Triton Instance inside ONE A100 Container...")
|
print("🚀 Booting ONE Triton Instance inside ONE A100 Container...")
|
||||||
|
|
||||||
# Spawns Triton in the background. It will automatically read
|
# Spawns Triton in the background. It will automatically read
|
||||||
|
|||||||
Reference in New Issue
Block a user