Class AgentTemplate
- All Implemented Interfaces:
Describable<AgentTemplate>
A machine profile: the shape of instance to create, and how to connect to it,
for jobs whose label expression matches
getLabels().
The shape is declared here rather than referenced by name in Namespace.
Namespace's named profiles (github.v1beta.ProfileService) exist only
for GitHub Actions runners and are served from a private endpoint, so
ComputeService.CreateInstance takes an explicit
Compute.InstanceShape and that is what this supplies.
A job selects a profile the ordinary Jenkins way — agent { label 'ns-linux-8x16' }
in a Pipeline, or "Restrict where this project can be run" in a freestyle job.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA Namespace cache volume, reattached across instances that share the tag.static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArch()ParsesmountPoint:tag:sizeGblines from the cache-volume textarea.Parses theKEY=VALUElines from the environment textarea.intintintHow long to wait for the agent to connect before giving up and destroying the instance.intintgetMode()getName()Also the agent-name prefix, so nodes are traceable back to their profile.intintgetVcpu()booleanvoidvoidsetCacheVolumes(String cacheVolumes) voidsetEnvironment(String environment) voidsetIdleMinutes(int idleMinutes) voidsetInstanceCap(int instanceCap) voidvoidsetLaunchStrategy(AgentLaunchStrategy launchStrategy) voidsetLaunchTimeoutSeconds(int launchTimeoutSeconds) voidsetMaxLifetimeMinutes(int maxLifetimeMinutes) voidsetMemoryGb(int memoryGb) voidsetNumExecutors(int numExecutors) voidsetRemoteFs(String remoteFs) voidsetVcpu(int vcpu) The shape sent toCreateInstance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Describable
getDescriptor
-
Constructor Details
-
AgentTemplate
-
-
Method Details
-
getName
Also the agent-name prefix, so nodes are traceable back to their profile. -
getLabels
-
setLabels
-
getVcpu
public int getVcpu() -
setVcpu
@DataBoundSetter public void setVcpu(int vcpu) -
getMemoryGb
public int getMemoryGb() -
setMemoryGb
@DataBoundSetter public void setMemoryGb(int memoryGb) -
getArch
-
setArch
-
toInstanceShape
The shape sent toCreateInstance.Memory is configured in GB but the API takes megabytes, so the conversion happens here rather than at each call site.
-
getNumExecutors
public int getNumExecutors() -
setNumExecutors
@DataBoundSetter public void setNumExecutors(int numExecutors) -
getRemoteFs
-
setRemoteFs
-
getIdleMinutes
public int getIdleMinutes() -
setIdleMinutes
@DataBoundSetter public void setIdleMinutes(int idleMinutes) -
getLaunchTimeoutSeconds
public int getLaunchTimeoutSeconds()How long to wait for the agent to connect before giving up and destroying the instance. Bounds the damage when an agent can never reach the controller. -
setLaunchTimeoutSeconds
@DataBoundSetter public void setLaunchTimeoutSeconds(int launchTimeoutSeconds) -
getMaxLifetimeMinutes
public int getMaxLifetimeMinutes() -
setMaxLifetimeMinutes
@DataBoundSetter public void setMaxLifetimeMinutes(int maxLifetimeMinutes) -
getInstanceCap
public int getInstanceCap() -
setInstanceCap
@DataBoundSetter public void setInstanceCap(int instanceCap) -
getEnvironment
-
setEnvironment
-
getCacheVolumes
-
setCacheVolumes
-
getLaunchStrategy
-
setLaunchStrategy
-
getEnvironmentMap
Parses theKEY=VALUElines from the environment textarea. -
getCacheVolumeList
ParsesmountPoint:tag:sizeGblines from the cache-volume textarea. -
getMode
-
matches
-