Enhance static directory handling and job deployment configuration

This commit is contained in:
2025-02-26 17:22:35 +07:00
parent 5c619e1f19
commit acae88076c
8 changed files with 984 additions and 151 deletions

33
check_allocations.py Normal file
View 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()