Enhance static directory handling and job deployment configuration
This commit is contained in:
33
check_allocations.py
Normal file
33
check_allocations.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Script to check allocations for the nomad-mcp job.
|
||||
"""
|
||||
|
||||
from app.services.nomad_client import NomadService
|
||||
|
||||
def main():
|
||||
service = NomadService()
|
||||
|
||||
# Get allocations for the job
|
||||
allocations = service.get_allocations('nomad-mcp')
|
||||
print(f'Found {len(allocations)} allocations')
|
||||
|
||||
if allocations:
|
||||
latest_alloc = allocations[0]
|
||||
print(f'Latest allocation ID: {latest_alloc["ID"]}')
|
||||
print(f'Status: {latest_alloc.get("ClientStatus", "Unknown")}')
|
||||
|
||||
# Get logs for the allocation
|
||||
try:
|
||||
logs = service.get_allocation_logs(latest_alloc["ID"])
|
||||
print("\nAllocation Logs:")
|
||||
print(logs.get("stdout", "No stdout logs available"))
|
||||
print("\nError Logs:")
|
||||
print(logs.get("stderr", "No stderr logs available"))
|
||||
except Exception as e:
|
||||
print(f"Error getting logs: {str(e)}")
|
||||
else:
|
||||
print("No allocations found for nomad-mcp job")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user