Class ExecutorRunnerMode
- java.lang.Object
-
- jetbrains.buildServer.agent.impl.operationModes.BaseExecutorMode
-
- jetbrains.buildServer.agent.impl.operationModes.ExecutorRunnerMode
-
- All Implemented Interfaces:
AgentOperationMode,AgentOperationModeEx
public class ExecutorRunnerMode extends BaseExecutorMode
An operation mode which helps isolate the execution of theRunAllBuildStepsStageinto a separate runner container during an Executor Mode build. An executor runner can execute an entire build or a single build step whose ordinal number corresponds to the runner's index.The agent exits after completing its designated build step. When the agent is started in Executor Mode, it never registers on the server. Instead, it receives build parameters via command line arguments and is started via an external orchestrator (e.g. Kubernetes). Upon exiting after completing its designated build step, the agent stores the current build state which is consequently used by the next ExecutorRunnerMode runner or by the
ExecutorFinishModerunner in case the last build step has just been executed.- Since:
- 2023.09
- See Also:
BaseExecutorMode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.agent.AgentOperationModeEx
AgentOperationModeEx.StagesProcessor
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.agent.impl.operationModes.BaseExecutorMode
LOG, myAgentBuild, myAgentBuildSerializer, myBuildAgent, myBuildStateCacheManager
-
-
Constructor Summary
Constructors Constructor Description ExecutorRunnerMode(BuildAgentImpl buildAgent, BuildCumulativeTimeCalculator buildCumulativeTimeCalculator, EventDispatcher<AgentLifeCycleListener> dispatcher, BuildCacheHolder buildCacheHolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildFinishedStatusexecuteRunnerStages(AgentRunningBuildEx build, List<BuildStage> buildStages, AgentOperationModeEx.StagesProcessor stagesProcessor)Executes any miscellaneous steps that need to be conducted by the calling operation mode before its BuildStages are executed (if such exist), iterates through passed buildStages to select those to be executed by the operation mode, and executes them.voidonAgentStart()voidonBuildFinish(AgentRunningBuild build, BuildFinishedStatus buildStatus)booleanonRunnersFinished(AgentRunningBuild build, BuildFinishedStatus buildStatus)voidsetRunnerToExecuteIndex(int runnerToExecuteIndex)-
Methods inherited from class jetbrains.buildServer.agent.impl.operationModes.BaseExecutorMode
applyBuildStateToAgent, flushAgentLog, isRegistrationOnServerSupported, restorePasswords, setAgentBuild, shouldCleanTempDirectories, shutdownAgent, shutdownAgentWithError, storeStepData, storeStepData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.agent.AgentOperationModeEx
beforeAgentStart
-
-
-
-
Constructor Detail
-
ExecutorRunnerMode
public ExecutorRunnerMode(@NotNull BuildAgentImpl buildAgent, BuildCumulativeTimeCalculator buildCumulativeTimeCalculator, EventDispatcher<AgentLifeCycleListener> dispatcher, @NotNull BuildCacheHolder buildCacheHolder)
-
-
Method Detail
-
onAgentStart
public void onAgentStart() throws IllegalStateException- Specified by:
onAgentStartin interfaceAgentOperationModeEx- Overrides:
onAgentStartin classBaseExecutorMode- Throws:
IllegalStateException
-
onRunnersFinished
public boolean onRunnersFinished(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus buildStatus)- Returns:
- true if build can be finished
-
onBuildFinish
public void onBuildFinish(@NotNull AgentRunningBuild build, @NotNull BuildFinishedStatus buildStatus)
-
setRunnerToExecuteIndex
public void setRunnerToExecuteIndex(int runnerToExecuteIndex)
-
executeRunnerStages
public BuildFinishedStatus executeRunnerStages(@NotNull AgentRunningBuildEx build, @NotNull List<BuildStage> buildStages, @NotNull AgentOperationModeEx.StagesProcessor stagesProcessor)
Description copied from interface:AgentOperationModeExExecutes any miscellaneous steps that need to be conducted by the calling operation mode before its BuildStages are executed (if such exist), iterates through passed buildStages to select those to be executed by the operation mode, and executes them. For traditional (i.e., non-agentless) builds, the function executes all stages.- Parameters:
build- current buildbuildStages- all stages to be executed in a buildstagesProcessor- functional interface which executes the stages passed to it as argument- Returns:
- cached BuildFinishedStatus for ExecutorFinishMode; status after executing stages for other modes
-
-