public abstract class OneShotProvisioner<T extends OneShotSlave> extends Object implements hudson.ExtensionPoint
OneShotSlave
s.
Plugins to manage lightweight agents can use this extension point to determine jobs which require.Modifier and Type | Field and Description |
---|---|
static hudson.model.queue.CauseOfBlockage |
WAIT_FOR_RESOURCES |
Constructor and Description |
---|
OneShotProvisioner() |
Modifier and Type | Method and Description |
---|---|
static List<OneShotProvisioner> |
all() |
abstract boolean |
canRun(hudson.model.Queue.Item item)
Determine if the underlying infrastructure has enough resources to create a slave
for this $
Queue.Item . |
protected int |
countExecutors(Class<T> type,
com.google.common.base.Predicate<T>... filters)
Utility method to count active one-shot-executors.
|
abstract T |
prepareExecutorFor(hudson.model.Queue.BuildableItem item)
Prepare a $
OneShotSlave to run this $Queue.BuildableItem . |
abstract boolean |
usesOneShotExecutor(hudson.model.Queue.Item item)
Determine if this $
Queue.Item do rely on One-Shot executors, and should be
handled by this specific provisioner. |
public static final hudson.model.queue.CauseOfBlockage WAIT_FOR_RESOURCES
public abstract boolean usesOneShotExecutor(hudson.model.Queue.Item item)
Queue.Item
do rely on One-Shot executors, and should be
handled by this specific provisioner.public abstract boolean canRun(hudson.model.Queue.Item item)
Queue.Item
.
Implementation can rely on this to reduce concurrent executors on a static infrastructure, or to schedule new resources on an elastic one.
@Nonnull public abstract T prepareExecutorFor(hudson.model.Queue.BuildableItem item) throws Exception
OneShotSlave
to run this $Queue.BuildableItem
. The actual
slave isn't launched, just prepared which means we can use it's node name as
a label to for assignment. Implementation should create adequate OneShotSlave
derived class but not run any actual provisioning, which will get postponed
until the run has started and OneShotSlave.doActualLaunch(TaskListener)
is ran.Exception
public static List<OneShotProvisioner> all()
protected int countExecutors(Class<T> type, com.google.common.base.Predicate<T>... filters)
canRun(Queue.Item)
using a simple max number of instances
approach, comparable to $AbstractCloudImpl.setInstanceCap(int)
Copyright © 2016–2017. All rights reserved.