public class EC2FleetCloud
extends hudson.slaves.Cloud
CloudNanny| Modifier and Type | Class and Description |
|---|---|
static class |
EC2FleetCloud.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CLOUD_STATUS_INTERVAL_SEC |
static String |
EC2_INSTANCE_CLOUD_NAME_TAG |
static String |
EC2_INSTANCE_TAG_NAMESPACE |
static String |
FLEET_CLOUD_ID |
| Constructor and Description |
|---|
EC2FleetCloud(String name,
String oldId,
String awsCredentialsId,
String credentialsId,
String region,
String endpoint,
String fleet,
String labelString,
String fsRoot,
hudson.slaves.ComputerConnector computerConnector,
boolean privateIpUsed,
boolean alwaysReconnect,
Integer idleMinutes,
Integer minSize,
Integer maxSize,
Integer numExecutors,
boolean addNodeOnlyIfRunning,
boolean restrictUsage,
boolean disableTaskResubmit,
Integer initOnlineTimeoutSec,
Integer initOnlineCheckIntervalSec,
boolean scaleExecutorsByWeight,
Integer cloudStatusIntervalSec,
boolean noDelayProvision) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProvision(hudson.model.Label label) |
String |
getAwsCredentialsId()
See
awsCredentialsId documentation. |
int |
getCloudStatusIntervalSec() |
hudson.slaves.ComputerConnector |
getComputerConnector() |
String |
getEndpoint() |
String |
getFleet() |
String |
getFsRoot() |
int |
getIdleMinutes() |
int |
getInitOnlineCheckIntervalSec() |
int |
getInitOnlineTimeoutSec() |
String |
getJvmSettings() |
String |
getLabelString() |
Integer |
getMaxSize() |
Integer |
getMinSize() |
Integer |
getNumExecutors() |
String |
getOldId()
Called old as will be used by new instance of cloud, for
which this id is old (not current)
|
String |
getRegion() |
boolean |
isAddNodeOnlyIfRunning() |
boolean |
isAlwaysReconnect() |
boolean |
isDisableTaskResubmit() |
boolean |
isNoDelayProvision() |
boolean |
isPrivateIpUsed() |
boolean |
isRestrictUsage() |
boolean |
isScaleExecutorsByWeight() |
Collection<hudson.slaves.NodeProvisioner.PlannedNode> |
provision(hudson.model.Label label,
int excessWorkload) |
boolean |
scheduleToTerminate(String instanceId)
Schedule Jenkins Node and EC2 instance to termination.
|
FleetStateStats |
update()
Perform sync of plugin data with EC2 Spot Fleet state.
|
all, checkPermission, getACL, getDescriptor, getDisplayName, getSearchUrl, hasPermissionpublic static final String EC2_INSTANCE_TAG_NAMESPACE
public static final String EC2_INSTANCE_CLOUD_NAME_TAG
public static final String FLEET_CLOUD_ID
public static final int DEFAULT_CLOUD_STATUS_INTERVAL_SEC
@DataBoundConstructor public EC2FleetCloud(String name, String oldId, String awsCredentialsId, @Deprecated String credentialsId, String region, String endpoint, String fleet, String labelString, String fsRoot, hudson.slaves.ComputerConnector computerConnector, boolean privateIpUsed, boolean alwaysReconnect, Integer idleMinutes, Integer minSize, Integer maxSize, Integer numExecutors, boolean addNodeOnlyIfRunning, boolean restrictUsage, boolean disableTaskResubmit, Integer initOnlineTimeoutSec, Integer initOnlineCheckIntervalSec, boolean scaleExecutorsByWeight, Integer cloudStatusIntervalSec, boolean noDelayProvision)
public boolean isNoDelayProvision()
public String getAwsCredentialsId()
awsCredentialsId documentation. Don't use fields directly to be able
get old version of plugin and for new.public String getOldId()
public boolean isDisableTaskResubmit()
public int getInitOnlineTimeoutSec()
public int getCloudStatusIntervalSec()
public int getInitOnlineCheckIntervalSec()
public String getRegion()
public String getEndpoint()
public String getFleet()
public String getFsRoot()
public boolean isAddNodeOnlyIfRunning()
public hudson.slaves.ComputerConnector getComputerConnector()
public boolean isPrivateIpUsed()
public boolean isAlwaysReconnect()
public String getLabelString()
public int getIdleMinutes()
public Integer getMaxSize()
public Integer getMinSize()
public Integer getNumExecutors()
public boolean isScaleExecutorsByWeight()
public String getJvmSettings()
public boolean isRestrictUsage()
public Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label, int excessWorkload)
provision in class hudson.slaves.Cloudpublic FleetStateStats update()
public boolean scheduleToTerminate(String instanceId)
minSize otherwise reject termination.
Real termination will happens in update() which periodically called by
CloudNanny. So it could be some lag between decision that node should be terminated
and actual termination, you can find max lag size in CloudNanny.getRecurrencePeriod()
This method doesn't do real termination to reduce load for Jenkins in case when multiple nodes should be terminated in short time, without schedule process and batch termination, multiple calls should be raised to AWS EC2 API which takes some time and block cloud class.
instanceId - node name or instance IDtrue if node scheduled to delete, otherwise falsepublic boolean canProvision(hudson.model.Label label)
canProvision in class hudson.slaves.CloudCopyright © 2016–2019. All rights reserved.