Class CreateOSCloud
- All Implemented Interfaces:
ExtensionPoint,Describable<Cloud>,ModelObject,SearchableModelObject,SearchItem,AccessControlled,ModelObjectWithContextMenu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRunsrecoverStaleAgents()once Jenkins has finished starting.static classExposes CreateOS cloud metadata, options, and validation to Jenkins.Nested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudStateNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreateOSCloud(String name) Creates a cloud with the default CreateOS API endpoint and capacity. -
Method Summary
Modifier and TypeMethodDescriptionBuilds an authenticated API client from this cloud's configured Jenkins credential.booleancanProvision(Cloud.CloudState state) intintprovision(Cloud.CloudState state, int excessWorkload) static voidDecides what to do with each CreateOS agent restored from an earlier controller process.voidvoidsetContainerCap(int containerCap) voidsetCredentialsId(String credentialsId) voidsetDisplayName(String displayName) voidsetExecSandboxCap(int execSandboxCap) voidsetTemplates(List<SandboxTemplate> templates) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, reconfigure, registerPermissionsMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.search.SearchItem
getSearchGroup, getSearchIcon
-
Constructor Details
-
CreateOSCloud
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 needsComputerobjects, 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
- Overrides:
canProvisionin classCloud
-
provision
public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload) -
buildApiClient
Builds an authenticated API client from this cloud's configured Jenkins credential. -
getApiUrl
-
getDisplayName
- Specified by:
getDisplayNamein interfaceModelObject- Overrides:
getDisplayNamein classCloud
-
setDisplayName
-
setApiUrl
-
getCredentialsId
-
setCredentialsId
-
getContainerCap
public int getContainerCap() -
setContainerCap
@DataBoundSetter public void setContainerCap(int containerCap) -
getExecSandboxCap
public int getExecSandboxCap() -
setExecSandboxCap
@DataBoundSetter public void setExecSandboxCap(int execSandboxCap) -
getTemplates
-
setTemplates
-