Java web start agents
Operations Center provides a mechanism to share agents (formerly called "slaves") across client masters. This works across wide variety of launcher types, including the "Launch slave agents via Java Web Start" launcher type (also known as JNLP launcher.)
A critical difference between normal JNLP agents and JNLP agents in Operations Center concerns how the JVM used to connect to the client master gets its JVM options.
When you configure a shared agent with a JNLP launcher, the resulting shared agent will show you a Java Web Start launch button.
You’ll now go to a machine you plan to use as an agent, start a browser, access this same page, then click the launch button to start Java Web Start. You should see a small GUI window. When the GUI window says "Connected", it indicates that the computer is now under the control of Operations Center.
The UI in Operations Center changes to indicate that the shared agent is available to be leased to client masters:
On supported platforms, this GUI gives you a menu option to install it as a service, enabling it to start automatically upon machine boot-up. You’ll want to do install as a service if you plan to use the computer as an agent permanently.
If the computer you plan to use as an agent does not have a GUI, you can run the command indicated in the above UI. See the Jenkins Wiki page for a discussion of the same topic.
When you have multiple identical JNLP agents, it becomes tedious to configure shared agents individually. To simplify this, Operations Center provides a "Java Web Start agents" cloud type in the shared cloud setting.
To configure a shared cloud in this manner, select "Java Web Start agents" as the cloud type and fill in the details of the JNLP agent:
All the JNLP agents connected to this share the exact same settings.
When you finish the settings, you’ll see the same Java Web Start launch button as with the JNLP shared agent:
The difference here is that you can launch an agent from this button multiple times on different computers, and they are all grouped into one big pool. The "current pool size" section indicates the number of JNLP agents that are currently controlled by Operations Center, including ones that are leased to client masters.
JNLP agents work a little differently in Operations Center compared to stand-alone Jenkins. This section describes those differences.
In stand-alone Jenkins, a JNLP client connects to a master, establishes a channel, becomes an agent, and starts taking orders from the master to perform builds and other tasks.
In Operations Center, the same JNLP client connects to a Operations Center and establishes a channel in the exact same manner, but it does not become an agent. Instead, Operations Center keeps this client idle, until it decides to lease it to a client master. At that point, Operations Center orders the JNLP client to launch a separate JNLP client as a child process, then have it connect to the master to which the agent was leased.
This new child process connects to a client master, establishes a channel, becomes an agent, and starts taking orders from this master, until the lease ends.
One of the implications of this design is that an agent computer must be reachable by all the client masters to which it might be leased.