Presented at DFW Jenkins Area Meetup, July 25, 2017: https://www.meetup.com/DFW-Jenkins-Area-Meetup/events/240063123/
Demo setup and steps in README.md at: https://github.com/ericsmalling/jenkins-docker-agent-demo
3. Eric Smalling
● ~25 years in software development, architecture, version control admin, etc…
○ Java / J2EE, C, Python, etc
○ Puppet, Ansible
○ Git, SVN, CVS, ClearCase, VSS, PVCS
● Over 7 years in build & test automation
○ Primarily Jenkins for CI, including some very large scale implementations but ex
○ Testing with Selenium, Fitnesse, RESTAssured, SOAPUI, Puppet-RSpec, etc
○ Docker user since pre-1.0 days
4. Assumptions
Basic understanding in the following topics:
Understanding of Continuous Integration (CI) and the build tools used by your development teams
(Maven, NPM, GoLang, etc)
Software delivery lifecycle (SDLC) and/or continuous delivery pipelines
Jenkins (high level)
Docker concepts (high level)
6. The challenges with legacy Jenkins build agents
Jenkins best practices dictate the use of distributed build agents
Scalability
Stability
Elasticity
Technical needs
Supporting the configurations of build agents can be complex
Manual maintenance leads to snowflakes
Pets vs. Cattle
7. Legacy Jenkins
Cluster Design
Static build agents running on
VMs and/or physical machines
Master
Agent Type 1
Agent Type 1
Agent Type 1
Agent Type 2
Agent Type 2
Agent Type 3
9. Legacy Jenkins
Cluster Design
Static build agents running on
VMs and/or physical machines
Master
Generic Agent
Generic Agent
Generic Agent
Option 2: Homogeneous agents with all needed
tools installed.
10. Legacy Jenkins
Cluster Design
Static build agents running on
VMs and/or physical machines
Master
RHEL 7 Agent
RHEL 7 Agent
RHEL 7 Agent
RHEL 6 Agent
RHEL 6 Agent
Suse Agent
Option 3: Some requirements preclude
homogeneous agents such as multiple OS
types/versions, or different versions of build tools
that do not easily co-exist on a single OS.
11. Jenkins Cluster
Using Docker
Ephemeral build agents running
in containers that only exist for
the life of the build.
Master
Docker Enabled Agent
Docker Enabled Agent
Docker Enabled Agent
● Near instantaneous provisioning
● 100% known-good starting point for every run
● Developers free to experiment with new tools,
OS versions, etc without CMS or VM
management overhead
● Diverse build support with homogenous
infrastructure
13. Docker Enabled
Jenkins Agent
Docker Enabled
Jenkins Agent
Demo Design
Logical layout from the demo.
(For those curious)
● Everything in containers for simplicity and
portability (not necessary, but a viable option)
○ HAProxy for optional SSL (disabled)
○ Jenkins Master with file system volume
mount for JENKINS_HOME
○ Jenkins Agent with file system volume
mount for workspaces
○ JFrog Artifactory OSS with volume
container mount for config and repositories
● Actual builds done in containers with images
specified in build configs (JenkinsFile)
● All Jenkins Agents identical and just need Docker
?
Jenkins
Master
Docker Enabled
Jenkins Agent
??