Currently, Jam manages the VMs under its control depending on jobs in the queue.
Some jobs can run on some machines or labels. We need to take that into account in order to be able to select the right machines that will process these jobs.
There are some stuff missing in Jenkins' json API (I believe) and this detection cannot become reliable nor clean.
I've sent a message on #jenkins (on Freenode) to kohsuke (Jenkins' creator) to see if I'm actually correct about this or that maybe there's another way to solve this issue.
The message is:
kohsuke: Hi, I have a quick question. It seems that it is not currently possible in the API (json) to have the CauseOfBlockage. There's the "why" string value that I can parse, but it language dependant and BECAUSE_LABEL_IS_BUSY and BECAUSE_NODE_IS_BUSY result in the same string. It would be good (I think) to have a list of labels and a list of nodes where the job can be run. It would make it easier (or just reliable) to provision resource for jenkins.
kohsuke: What's your opinion on that?
As I had no reply for several weeks, I've open a ticket on Jenkins' side:
https://issues.jenkins-ci.org/browse/JENKINS-51198
Currently, Jam manages the VMs under its control depending on jobs in the queue.
Some jobs can run on some machines or labels. We need to take that into account in order to be able to select the right machines that will process these jobs.
There are some stuff missing in Jenkins' json API (I believe) and this detection cannot become reliable nor clean.
I've sent a message on #jenkins (on Freenode) to kohsuke (Jenkins' creator) to see if I'm actually correct about this or that maybe there's another way to solve this issue.
The message is:
As I had no reply for several weeks, I've open a ticket on Jenkins' side:
https://issues.jenkins-ci.org/browse/JENKINS-51198