Skip to content

Commit

Permalink
feat: be conservative with tryme resource cap
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Sep 23, 2024
1 parent 6e3fa32 commit 4026f7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ai4papi/routers/v1/try_me/nomad.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def create_deployment(
for k in keys:
status[k] += node[k]
for r in resources:
if status[f"{r}_total"] == 0 or status[f"{r}_used"] / status[f"{r}_total"] > 0.95:
if status[f"{r}_total"] == 0 or status[f"{r}_used"] / status[f"{r}_total"] > 0.85:
# We cut of somehow earlier than 100% because we are only accounting for
# cores consumed in "main" task. But UI task is also consuming resources.
raise HTTPException(
status_code=503,
detail="Sorry, but there seem to be no resources available right " \
Expand Down

0 comments on commit 4026f7a

Please sign in to comment.