Skip to content

Commit

Permalink
fix(deployments): allow purging jobs with main task dead
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Dec 13, 2024
1 parent 1e03571 commit 765af52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai4papi/nomad/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_deployment(
info["datacenter"] = Nomad.node.get_node(a["NodeID"])["Datacenter"]

# Replace Nomad status with a more user-friendly status
# Final list includes: starting, down, running, complete, failed, ...
# Final list includes: starting, down, running, complete, failed, dead, ...
# We use the status of the "main" task because it isn more relevant the the
# status of the overall job (a['ClientStatus'])
status = a["TaskStates"]["main"]["State"] if a.get("TaskStates") else "queued"
Expand Down Expand Up @@ -369,7 +369,7 @@ def delete_deployment(
# If job is in stuck status, allow deleting with purge.
# Most of the time, when a job is in this status, it is due to a platform error.
# It gets stuck and cannot be deleted without purge
if info["status"] in ["queued", "complete", "failed", "error", "down"]:
if info["status"] in ["queued", "complete", "failed", "error", "down", "dead"]:
purge = True
else:
purge = False
Expand Down

0 comments on commit 765af52

Please sign in to comment.