Java web start agents

Operations Center provides a mechanism to share agents across Client Masters. This works across wide variety of launcher types, including the option to Launch agents via Java Web Start launcher type (also known as inbound agent launcher.)

A critical difference between normal inbound agents and inbound agents in Operations Center concerns how the JVM used to connect to the client master gets its JVM options.

  • In a stand-alone Jenkins environment the JVM options for the agent’s JVM depend on the launch method:

    • If launched using the "Launch" button, then the JVM Options specified within the launcher’s "Advanced" section of the "Configuration" screen for the agent will be injected into the inbound file and will be used for launching the agent.

    • If launched using the command line, then the JVM Options will be those specified on the command line, and any JVM Options specified within the launcher’s "Advanced" section of the "Configuration" screen for the agent will be ignored.

  • In Operations Center a shared agent / shared cloud using the inbound agent launcher will behave the same way as a stand-alone Jenkins environment for the JVM used to connect to Operations Center, but when leasing the agent out to Client Masters _a second JVM is started using the JVM Options specified within the launcher’s "Advanced" section of the "Configuration" screen for the agent.

When you configure a shared agent with an inbound agent 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.

Installing inbound agent without GUI

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.

Bundling multiple inbound agents as shared cloud

When you have multiple identical inbound 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 inbound agent.

All the inbound 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 inbound 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 inbound agents that are currently controlled by Operations Center, including ones that are leased to Client Masters.

Inbound agent workflow

Inbound agents work a little differently in Operations Center compared to stand-alone Jenkins. This section describes those differences.

In stand-alone Jenkins, an inbound 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 inbound client connects to the 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 inbound client to launch a separate inbound 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.