We're considering using QB for a case where the work of the agents entails them rebooting and going offline for a period of time. The overall build needs to be able to span the offline period.
I envision the following:
- Master step would run on target agent doing various prep tasks
- To handle agent reboot, a sequential composition step would be used and set to run on the server:
2a. An inner-step targeting the agent would initiate the agent reboot/offline action
2b. An inner-step set to run on the server would wait for the agent's return - Continue with steps on the agent
Using the QB API, I've been able to determine on which agent the current job is targeting ... e.g.,
masterStep = build.getMasterStep();
masterNode = masterStep.getNode(); // get node on which this job is running
logger.info("Master node agent = " + masterNode.getHostName());
Once I have the GridNode, I'd like to periodically see if the agent is active. Merely checking PING status won't work because the system may be booted but doing work before the agent is restarted. Is there a REST API on the agent that I can use for this? Or perhaps some API calls that I'm not seeing? Or is there a better overall approach you might suggest?
Thanks,
Dave Regis
- solved #4
- replies 5
- views 1040
- stars 0