public abstract class OneShotSlave
extends hudson.model.Slave
implements hudson.slaves.EphemeralNode
Run
, and as such has a life cycle
to fully match the Run's one.
Provisioning such a slave should be a lightweight process, so one can provision them at any time and concurrently
to match $Queue
load. Typical usage is Docker container based Jenkins agents.
Actual launch of the Slave is postponed until a $Run
is created, so we can have a 1:1 match between Run and
Executor lifecycle:
Result.NOT_BUILT
on launch failure.hudson.model.Slave.JnlpJar, hudson.model.Slave.SlaveDescriptor
Modifier and Type | Field and Description |
---|---|
static hudson.model.listeners.RunListener |
RUN_LISTENER
We listen to loggers creation by $
Run s so we can write the executor's launch log into build log. |
Constructor and Description |
---|
OneShotSlave(String name,
String nodeDescription,
String remoteFS,
String labelString,
hudson.slaves.ComputerLauncher launcher) |
Modifier and Type | Method and Description |
---|---|
hudson.Launcher |
createLauncher(hudson.model.TaskListener listener)
Pipeline does not use the same mecanism to use nodes, so we also need to consider $
createLauncher(TaskListener)
as an event to determine first use of the slave. |
OneShotComputer |
getComputer() |
int |
getNumExecutors() |
createComputer, equals, getClockDifferenceCallable, getDescriptor, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, readResolve, setLabelString, setLauncher, setMode, setNodeName, setRetentionStrategy, setUserId, toString
canTake, canTake, checkPermission, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodePropertyDescriptors, getSearchUrl, getSelfLabel, hasPermission, isAcceptingTasks, isHoldOffLaunchUntilSave, reconfigure, save, toComputer
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
@Extension(ordinal=1.7976931348623157E308) public static final hudson.model.listeners.RunListener RUN_LISTENER
Run
s so we can write the executor's launch log into build log.
Relying on this implementation detail is fragile, but we don't really have a better
option yet.public OneShotSlave(String name, String nodeDescription, String remoteFS, String labelString, hudson.slaves.ComputerLauncher launcher) throws hudson.model.Descriptor.FormException, IOException
hudson.model.Descriptor.FormException
IOException
public int getNumExecutors()
getNumExecutors
in class hudson.model.Slave
public OneShotComputer getComputer()
getComputer
in class hudson.model.Slave
public hudson.Launcher createLauncher(hudson.model.TaskListener listener)
createLauncher(TaskListener)
as an event to determine first use of the slave.createLauncher
in class hudson.model.Slave
Copyright © 2016–2017. All rights reserved.