Class CreateOSCloud

All Implemented Interfaces:
ExtensionPoint, Describable<Cloud>, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu

public class CreateOSCloud extends Cloud
Jenkins cloud implementation that provisions ephemeral CreateOS sandbox agents.
  • Constructor Details

    • CreateOSCloud

      @DataBoundConstructor public CreateOSCloud(String name)
      Creates a cloud with the default CreateOS API endpoint and capacity.
  • Method Details

    • recoverStaleAgents

      public static void recoverStaleAgents()
      Decides what to do with each CreateOS agent restored from an earlier controller process.

      An agent whose sandbox is still running is kept rather than destroyed: the sandbox kept its workspace, so a Pipeline that was mid-build can resume through Durable Task. An inbound agent's process is still running in that sandbox and reconnects its WebSocket by itself; an SSH agent only lost its tunnel with the previous JVM, and Jenkins relaunches it through a new one.

      A template can opt out with "Delete agents on controller restart", for agents meant to be strictly one-process-lifetime; those are terminated, as is a node whose sandbox has gone and so has nothing left to reconnect to.

      Driven from ItemListener.onLoaded() rather than an @Initializer: the work needs Computer objects, which exist only once startup is finished, and @Initializer(after = COMPLETED) can never run because that milestone is terminal — scheduling against it wedges the initialization graph instead (JENKINS-37759).

    • canProvision

      public boolean canProvision(Cloud.CloudState state)
      Overrides:
      canProvision in class Cloud
    • provision

      public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload)
      Overrides:
      provision in class Cloud
    • buildApiClient

      public CreateOSApiClient buildApiClient()
      Builds an authenticated API client from this cloud's configured Jenkins credential.
    • getApiUrl

      public String getApiUrl()
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class Cloud
    • setDisplayName

      @DataBoundSetter public void setDisplayName(String displayName)
    • setApiUrl

      @DataBoundSetter public void setApiUrl(String apiUrl)
    • getCredentialsId

      public String getCredentialsId()
    • setCredentialsId

      @DataBoundSetter public void setCredentialsId(String credentialsId)
    • getContainerCap

      public int getContainerCap()
    • setContainerCap

      @DataBoundSetter public void setContainerCap(int containerCap)
    • getExecSandboxCap

      public int getExecSandboxCap()
    • setExecSandboxCap

      @DataBoundSetter public void setExecSandboxCap(int execSandboxCap)
    • getTemplates

      public List<SandboxTemplate> getTemplates()
    • setTemplates

      @DataBoundSetter public void setTemplates(List<SandboxTemplate> templates)