Skip to content

Commit

Permalink
feat: add datacenter to deployment info
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Jan 25, 2024
1 parent 3d11fdb commit 7773a02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ai4papi/nomad/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def get_deployment(
'active_endpoints': None,
'main_endpoint': None,
'alloc_ID': None,
'datacenter': None,
}

# Retrieve tasks
Expand Down Expand Up @@ -212,9 +213,12 @@ def get_deployment(

a = Nomad.allocation.get_allocation(allocs[idx]['ID'])

# Add ID and status
# Add ID
info['alloc_ID'] = a['ID']

# Add datacenter
info['datacenter'] = Nomad.node.get_node(a['NodeID'])['Datacenter']

# Replace Nomad status with a more user-friendly status
if a['ClientStatus'] == 'pending':
info['status'] = 'starting'
Expand Down

0 comments on commit 7773a02

Please sign in to comment.