A bits of history to be aware of, especially terminology evolutions.
- Jenkins is a large,
open-source
effort with a vastcommunity
supporting it, notably theecosystem
ofplugins
.Jenkins Core
is the foundation upon which plugins define the behavior of a givenJenkins
install
/instance
/environment
.- As such, changes take time (often years) to propagate. Especially true when changing terms. Several terms are de facto
aliased
and so it is helpful to be aware of the mapping between previous and current terminology. I'll provide that along with an explanation of prominent terms you should know.
mindset
- It's important to have a perspective with which you organize your understanding of any given subject. Here's mymindset
to organizeJenkins
and make it more intelligible. Yourmindset
may vary (YMMV 😉)- I find it helpful to contrast
long running processes
- such as a GUI app like VSCode, or
Jenkins
!
- such as a GUI app like VSCode, or
- versus
one-off
/task
/short lived processes
- such as a virus scan, disk defrag, or an app build with
maven
ordotnet
- such as a virus scan, disk defrag, or an app build with
tasks
must be triggered somehowmanually
by a human (akalong running process
)scheduled
to repeat with a tool likecron
react
to some event- notably with software dev we often want to trigger
tasks
in relationship to changes being published to say agit
repo- an
on push
oron share
trigger, whatever lingo floats your 🚣
- an
- event detection varies
poll
model - along running process
like Jenkins canpoll
for changespolling
is likely triggered on aschedule
becausepolling
for changes to detect an event is yet anothertask
!
push
model - an externalprocess
notifies Jenkins of changes and then atask
in Jenkins will confirm (ie thepoll
task) and fetch changes to then trigger user-definedtasks
to saycompile
an app.
- notably with software dev we often want to trigger
- I recommend a
function
mindset to grok thetasks
you configure Jenkins to automate. So, user-definedshort lived processes
can be thought of asfunctions
!- Somewhere exists a
function declaration
(akaconfiguration
orcode
) - A function has
input(s)
(akaparameter(s)
) - It
runs
/executes
on theinputs
(clone git repo, compile app, run tests, etc) - Concurrently
logs
progress, often viaSTDOUT
/STDERR
- Produces
outputs
/artifacts
in the form of file(s)- Even
logs
can be thought of asoutputs
/artifacts
...STDOUT
is just a default file descriptor for writing output!
- Even
- Select and archive
artifacts
for later retrieval - Ironically, most of what I said here about functions is just a template of a function declaration!
- TLDR:
Jenkins
is comprised oflong running processes
that triggerexecutors
to runfunctions
- Somewhere exists a
- A big reason I like to think in terms of
functions
is because the actual terminology in Jenkins is murky at times.- That's because the typical use case of Jenkins (and similar tools) has evolved (roughly from building, to CI and now to CD).
- And many other use cases are logical:
- I could backup a database.
- Or scrape data off of a website and store it for later processing.
- Or perform cleanup on disk to save space, perhaps triggering this when free space runs low and/or on a schedule.
- Calling these
builds
wouldn't make much sense! But, there are parts of Jenkins parlance that would refer to it as such, largely for historical reasons.
- I find it helpful to contrast
job
/project
are generic to capture a wider array of possibilities.- And even job is marked deprecated in the Jenkins glossary here while it is used all over the code, UI and docs!
pipelines
are a hugely popular feature in Jenkins v2 and have in many cases become another alias forproject
/job
etc...- And of course before
pipeline
this feature set was known asworkflow
and you'll see that at times
- And of course before
items
are a generic term that encompassesfolders
,projects
andjobs
folder
is anitem
to group relateditems
- just like folders on a filesystem
VCS
/git
- I assume you are familiar with version control tools and specificallygit
which is ubiquitous.- As opposed to folders of code without versioning like was popular back in the day 🙉!
- If you want a challenge you could setup a Jenkins project to build from a network share!
build
/build result
- the output that's captured for a given run of aproject
/pipeline
/job
/function
/task
Jenkins
was first known asHudson
Hudson
was initially released in 2004 at Sun Microsystems- Oracle acquired Sun in 2009/2010.
- A dispute over trademarking the name
Hudson
led to the community renaming/forking the project toJenkins
in Jan 2011. - Two forks emerged as Oracle also committed to maintaining
Hudson
- Politics aside
Jenkins
won the "popularity" contest early on as the community coalesced around theJenkins
project (fork). Hudson
's last release was in 2016 under the Eclipse Foundation.
node
- a long running process hosting either a Jenkinsagent
ormaster
/controller
executor
- aslot
that can run a singleproject
, anynode
can have 0+executors
- in larger setups it is typical to not have
executors
on themaster
node to offload all build demand ontoagents
to avoid overwhelming the coordinatingmaster
node which has plenty of tasks to perform as you scale up demand.
- in larger setups it is typical to not have
master
/slave
was the original terminology for distinguishing nodes.- Long ago
slave
was renamed toagent
.slave
was deprecated as part of Jenkins 2.0agent
is popular in Jenkins alternatives like TeamCity and so it is natural to assume it is easier to onboard new users if terminology is familiar, and hence this change in v2 which was all about making it easier to get up and running with Jenkins quickly.- Agent terminology cleanup highlights the undertaking required to rename a prevalent term that permeates a decades old open-source ecosystem.
- Recently (mid 2020)
controller
was selected to replacemaster
.- This has yet to be reflected in the glossary which is one of many reasons why I do not know if this renaming is a done deal.
- Neither change is anywhere near complete so expect to see a mix of both for a while (years). I'll update this if changes are made, let me know if you hear anything definitive.
- I personally refer to the
master/controller
asJenkins
and then if applicableagent(s)
. - The
controller
:- Stores configuration
- Hosts the web UI
- Schedules/Coordinates/Distributes execution of
functions
(pipelines
/projects
/jobs
) acrossagents
- And interacts with agents to retrieve and store
output
/results
/artifacts
- Long ago
blacklist/whitelist
are now discouraged and replacements suggested but not enforced (yet?), ieallowlist/blocklist
- For more about terminology changes
- learn more here
- and here
- and likely elsewhere including monitoring the glossary.
JENKINS_HOME
- where Jenkins stores files (running builds/steps, or storing results and artifacts).workspace
- a temporary, disposable directory to house files for the work requested (git clone, compile, test, package, etc)- typically left in place between runs of a
project
- can be helpful to speed up builds when caching / partial compilation is present in build tools
- can be painful if it makes builds hard to reproduce, or leads to flaky tests
- can be cleaned up before/after a
project
runs depending on theproject
config, usually isn't cleaned up by default
- Workspaces are default located in
$JENKINS_HOME/workspace/[JOB_NAME]
- the
[JOB_NAME]
in the jenkins wiki shows thatjob
was and still is a common term. - anyways, each
job
(project
) has its own workspace on a given node
- the
- typically left in place between runs of a
- Fingerprint
- Cloud
- Label
- Step (build steps, SUCCESSFUL/FAILED)
- Publisher (post-build actions/steps, STABLE/UNSTABLE)
stage
is a grouping ofsteps
- to visualize progress and results
- For example,
- a
"build" stage
might encompass compiling, unit testing and packaging an app - then a
"test deploy" stage
might encompass provisioning the app and running some higher level integration tests all of which ensures the deploy will work in prod and then leaves a test instance for humans to poke around. - then maybe a
"prod deploy" stage
which updates a production app. - sky is the limit
- a
step
is a fine-grained task telling what actions to perform- I think of steps as a line of code
- or shelling out to a CLI command (ie maven)
- Each time you run a
job
/project
/pipeline
/etc Jenkins captures what it refers to as a build (result)- Look in
$JENKINS_HOME/jobs/[JOBNAME]/builds/
for a history ofBUILD_IDs
and the captured results (output)
- Look in
- The irony is not lost that the result of running what is now a
Pipeline
orProject
is often referred to as aBuild
orBuild status
! Aborted
means the build was interrupted before completion (manually, timeout, otherwise).Successful
means all build steps completedFailed
means a build step failed (ie a compiler error)
Stable
means no publishers reported a failure- ?Publishers (post-build steps) run after the build steps and thus can amend a
Successful
status to be more specific- a vestige (IMO) of the history of Jenkins.
- an example might be a unit test parser that reads the result of running unit tests
Publishers
are going to be configurable/nuanced in how they determine a failure (stable/unstable
), so pay attention to the docs for a givenpublisher
- ?Publishers (post-build steps) run after the build steps and thus can amend a
- Personally I see a
job
/project
/function
as a set of steps and don't bother to distinguishbuild
vspost-build
orpublisher
steps... because why?- I wish we lived in a world where the
function
either aborted, failed or succeeded and really I just care if a problem exists, that the system helps me by telling me and makes it easy to dissect/troubleshoot.
- I wish we lived in a world where the