Brydie McCoy, Java Developer
As more and more peoples' building demands grow, they expand from building everything locally to a distributed building system or the elastic cloud. And for OnDemand the elastic cloud is the only option. Unfortunately developing plugins for remote/elastic agents has its own set of gotchas. Most plugins written for Bamboo do not work properly on remote agents. This talk will cover the core principles of developing for remote agents, what you can and can't do, as well as more advanced topics such as data transfer and communication between the agent and the server.
5. Agents
Machine B
Remote Agent
Remote Agent
Machine A
Bamboo Server
Remote Agent
Local Agent
Amazon Elastic
Local Agent Cloud
Local Agent Elastic Agent
Elastic Agent
Elastic Agent
7. Terminolgy
User Developer
Plan Chain, TopLevelPlan, Build (legacy)
Stage ChainStage
Job Job, Buildable, Build (legacy)
Plan Branch ChainBranch
Build/Plan Result/Build Result ChainResultSummary
Stage Result ChainStageResult
Job Result BuildResultsSummary
+ “Plan” is the common interface for all Jobs, Chains and Branches
+ Immutable versions of most of these classes.
8. Bamboo Is not for
everyone.
CI is complex
Lack of resources and and expertise
You don’t want us writing support for your
systems
Bamboo would become bloated.
9. Yet.
Bamboo is a plugin platform
Fill holes in the market
Fill holes in your team
10. Available Plugin
points in Bamboo
Build Agent Requirement Filter Module Report Module
Build Complete Action Module Web Repository Viewer Module
Build Processor Module XWork Plugin Module
Build Processor Server Module Capability Type Module
Build Trigger Condition Module Index Reader Module
Command Decorator Module Plan Deletion Interceptor Action Module
Custom Build Definition Transformer Module Post Build Index Writer Module
Post-Build Completed Action Module Post Chain Index Writer Module
Post-Chain Action Module Event Listeners (33 events to lock into?)
Post-Job Action Module Component Import Plugin Module
Post-Stage Action Module Component Plugin Module
Pre-Build Action Module Module Type Plugin Module
Pre-Build Queued Action Servlet Context Listener Plugin Module
Pre-Chain Action Module Servlet Context Parameter Plugin Module
Pre-Job Action Module Servlet Filter Plugin Module
Pre-Stage Action Module Servlet Plugin Module
Restart Failed Stage Action Module Template Context Item Plugin Module
Resume Manual Stage Action Module Web Item Plugin Module
Stop On Manual Stage Action Module Web Panel Plugin Module
Source Repository Module Web Panel Renderer Plugin Module
Task Plugin Module Web Resource Plugin Module
Trigger Reason Module Web Resource Transformer Plugin Module
Notification Condition Module Web Section Plugin Module
Notification Recipient Module REST plugin module type
Notification Type Module Gadget plugin module type
Additional Build Configuration Module
11. Build Process
Build is Triggered Trigger Reason
Trigger Condition
Changes retrieved for all
repositories
Source Repository
Allocate Build Number
Creation and persistence of
Database Objects
Creation of Build Contexts
Pre Chain
Begin Chain Execution
Action
Branch Merging
Stage Execution
Logic
Branch Push
Post Chain
Finalise Chain Execution
Action
Chain Execution
Complete
12. Requirements + Capabalties
Failed Stage Restarted Calculated Pre Build Queued Action
Manual Stage Resumed Action Jobs Places on JMS queue
Execute Next Stage Build Agent Requirement Fileter
Pre Stage Action Capability Type
Pre Job Job
Queue
Trigger all jobs for stage Action
Wait For Job
Job Execution
Completeion
Logic
Finalise Stage Post Stage
Action Process Job
State Build Processor Server
Result
No
Did the last stage
Yes Save Job
Post Build Index Writer
fail? to DB and Index
No
Tell chain the Job Post Job
Yes Stop on Manual Stage
is finished Action
Have we hit a
manual stage
No
Post Job Events Post Build Complete Action
No
Yes Is there another
stage to run?
Are All Jobs In
Stage Finished?
13. Job
Queue Agent
Prepare build
directories
Retrieve artifacts
Source Repository
Process
from server
Prepare Job Pre Build Action
Run Regular Task Task
Command Decorator
Source Repository
Yes
Did task Succeed?
Is there Another Task?
No
Run Finalising Task
Task Command Decorator
Source Repository
Yes
Is there Another Task?
No
Calculate Build State
Build Processor
Send Artifacts to Server
Send Results Back
To Server
14. Remote Agents
Taking Storm
Customers have too many builds
Customers need multiple OS, platforms or
devices
On Demand - Remote is the only option
15. Whats available?
Not Available Available
•Database
•Bandana
•ActiveMQ •Build Working Directory
•File System •Passed Artifacts
•Lucene Index •Checkout out code
•Other Plans •Products of previous tasks
•Previous Jobs •Job Configuration
•Historical data
•Managers