-
Creates BuildChain from payload (
BuildChainService
methodcreateFromPayload()
)- Create build chain for logged in user
- Add the build options to the build chain
- Extract payload into a pre determined folder (based on build chain id)
- Parse build info (.apb.yml)
- Create one request for every
Platform
andFlavor
combination found in the yml Note: if theflavor
parameter is passed, only one request for the created flavor is created - Populates all created Build Request with it's flavor, platform, engine and BuildChain
Note: If any of the previous steps fails, a
CANCELLED
Build Request is created, and the process stops.
-
For each BuildRequest created, asynchronously schedule it ((
BuildRequestService
methodschedule()
))- Find the actual platform in the database that this Build Request should be built against
- Find the actual flavor this request represents in the configuration file (
apb.yml
) - Find the actual engine in the database that this Build Request should be built against
- Validates that all the required variables are passed
- Find a BuildAgent capable of building this request.
- Note: This respects the build agent current load, if there are more than 1 build agent that can build the request, the less loaded will be chosen.
- Queue the request for execution on the BuildAgent.
Note: If any of the previous steps fails, the Build Request is cancelled.
-
Scheduling of the BuildRequest (starts on
BuildAgentQueueService
methodqueue()
called from the previous step)BuildAgentQueueService
Finds or create aBuildAgentQueueController
which is the component that manages the build agents queues.- Submit the new task to the
BuildAgentQueueController
- The BuildRequest is added to the queue BuildAgent queue.
When a new BuildAgentQueueController
is created (on demand based on the Scheduling Process step 3.1) to manage a Build Agent, the following steps are executed:
- A FIFO queue of
BuildRequest
is created with the capacity defined in the BuildAgentqueue.size
variable or system default if not defined. BuildExecutorWorker
s are created respecting themax.concurrent.builds
variable defined in the BuildAgent or system default.- NOTE: Currently only
SSHBuildExecutorWorker
are supported, but the architecture is enabled to support any kind of worker.
- NOTE: Currently only
- The
BuildExecutorWorker
s start watching the FIFO queue and execute when a newBuildRequest
arrives.` - When a Request Arrives ( Scheduling Process step 3.3) the execution begins
- The BuildRequest is marked as
RUNNING
and thestartTime
is populated. - A new
Logger
is created to handle the build process logging. - Steps when
SSHBuildExecutorWorker
is used- Connects to remote agent via
ssh
- Create the necessary folders in the remote agent
- Uploads the compressed input file
- Extracts the compressed input file
- Builds the
BuildCommand
using theBuildCommandBuilderService
(currently only docker commands are supported) - Executes the
BuildCommand
on the agent, forwarding the output (stdout and stderr) to the build log. - Tries to Downloads artifacts if the artifacts properties are populated.
- Finishes the request and disconnect from the agent.
- Cleanup the input files in the agent.
- Close any connected log consumers.
NOTE: If any error occurs that blocks the build, the build is marked as
FAILED
;
- Connects to remote agent via
- The BuildRequest is marked as