Perfect, that's exactly what I was looking for 🙂 Thanks!
My guess is to manually read and parse the string that clearml-agent list
returns, but I'm pretty sure there's a cleaner way to do it, isn't there?
Response contains both the raw JSON response as well as an object with properties
But what is the name of that API library in order to have access to those commands from Python SDK?
You can either use REST API or the APIClient (which can send the same request)
You can call the API directly and get a list of existing agents
Should be something like:
` from clearml.backend_api.session.client import APIClient
client = APIClient()
response = client.workers.get_all() `
Just try it out manually and see what you get :)
But how could I know whether an agent is up or not? Is it from the CLI or SDK?
I mean what should I write in a script to import the APIClient? (sorry if I'm not explaining myself properly 😅 )
Hi GiganticTurtle0 ,
You can't set an agent to pull tasks only if other agents are off-line, but you can certainly have some monitoring script checking if the other agents are up and if not, starting this CPU agent - will that work?