Package sh.createos.jenkins.sandbox
Class CreateOSSlave
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Node
hudson.model.Slave
hudson.slaves.AbstractCloudSlave
sh.createos.jenkins.sandbox.CreateOSSlave
- All Implemented Interfaces:
ExtensionPoint,Describable<Node>,ModelObject,PersistenceRoot,ReconfigurableDescribable<Node>,Saveable,SearchableModelObject,SearchItem,AccessControlled,Serializable,OnMaster
A one-executor Jenkins agent backed by an ephemeral CreateOS sandbox.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescribes CreateOS agent nodes to Jenkins.Nested classes/interfaces inherited from class hudson.model.Slave
Slave.JnlpJar, Slave.SlaveDescriptorNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Node
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS -
Constructor Summary
ConstructorsConstructorDescriptionCreateOSSlave(String name, SandboxTemplate template, CreateOSCloud cloud) Creates an agent node from a sandbox template owned by the given cloud. -
Method Summary
Modifier and TypeMethodDescriptionprotected void_terminate(TaskListener listener) voidsetSandboxId(String sandboxId) Records which sandbox backs this agent, and writes it to disk immediately.Methods inherited from class hudson.slaves.AbstractCloudSlave
terminateMethods inherited from class hudson.model.Slave
createLauncher, drainLabelsToTrim, equals, getClockDifferenceCallable, getComputer, getDescriptor, getLabelAtomSet, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, readResolve, save, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId, toStringMethods inherited from class hudson.model.Node
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getConfigFile, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getRootDir, getSearchUrl, getSelfLabel, getTemporaryOfflineCause, isAcceptingTasks, isHoldOffLaunchUntilSave, onLoad, reconfigure, reconfigure, toComputerMethods 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, finalize, getClass, notify, notifyAll, 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
-
CreateOSSlave
public CreateOSSlave(String name, SandboxTemplate template, CreateOSCloud cloud) throws Descriptor.FormException, IOException Creates an agent node from a sandbox template owned by the given cloud.- Throws:
Descriptor.FormExceptionIOException
-
-
Method Details
-
createComputer
- Specified by:
createComputerin classAbstractCloudSlave
-
_terminate
- Specified by:
_terminatein classAbstractCloudSlave- Throws:
IOExceptionInterruptedException
-
getCreateOSCloud
-
getSandboxId
-
setSandboxId
Records which sandbox backs this agent, and writes it to disk immediately.The save is what makes a restart survivable. The node is persisted when it is added, which happens before the launcher has created the sandbox, so without saving again the id is only ever in memory: after a restart the restored node knows of no sandbox, recovery finds nothing to reconnect to, and the agent is terminated while its sandbox keeps running.
-
getTemplate
-