SlideShare a Scribd company logo
How to plan and define
your CI/CD pipelines
Francisco (aka Patxi) Gortázar
francisco.gortazar@urjc.es
@fgortazar
Funded by the
European Union
@fgortazar
Bio
Project Coordinator at @elastestio EU project
Devops @ Kurento/OpenVidu
TeachingTesting & Distributed Systems @ URJC
@fgortazar
https://es.linkedin.com/in/franciscogortazar
@fgortazar
Bio
Project Coordinator at @elastestio EU project
Devops @ Kurento/OpenVidu
TeachingTesting & Distributed Systems @ URJC
@fgortazar
https://es.linkedin.com/in/franciscogortazar
@fgortazar
How to plan and design your pipelines
● Some preliminary concepts
● Background
● Planning
● CI/CD environment
● Git workflow
● Pipelines
● Code review
● Merging
● Releasing
● Deploying
@fgortazar
Some preliminary concepts
● Software is usually built by teams
● People within the team share the code as they build it
by means of source control management tools
SCM
Tools / Services offering git repositories
@fgortazar
Some preliminary concepts
● Each time someone shares its changes through the
repository, we should check that:
● The project is still compiling
● All the tests still pass (they’re green)
● Compiling and running tests on a trusted
environment is Continuous Integration’s task
● When a problem arises, it is notified immediately
to the team
Some preliminary concepts
● Integration must happen continuously (at least once
per day)
● Fast feedback is key, so that we know our changes
are working when integrated with the rest of the
system
● Problems detected in our CI environment must be
solved immediately
● Status of the project in terms of builds, test, and
deployments is visible at any moment
Some preliminary concepts
@fgortazar
How to plan and design your pipelines
● Some preliminary concepts
● Background
● Planning
● CI/CD environment
● Git workflow
● Pipelines
● Code review
● Merging
● Releasing
● Deploying
Background
Background
Background
Background
● Some numbers
● 30 code repositories
● ~400 Jenkins jobs
● +1,000 tests
● +20 different environments to test
● +80 artifacts to be deployed at release time
@fgortazar
How to plan and design your pipelines
● Some preliminary concepts
● Background
● Planning
● CI/CD environment
● Git workflow
● Pipelines
● Code review
● Merging
● Releasing
● Deploying
Planning
● What’s your Git workflow
● Branches are to be integrated as well?
● Depend-on components are to be considered?
● Infrastructure planning
● Snapshot versions
● Release versions
● Deployments
@fgortazar
CI/CD environment
● Feasible infrastructures and their consequences
● Public cloud vs private cloud (on premises)
● Controlling public cloud costs (e.g. spot instances, stopping
instances not in use...)
● Virtual Machines vs Docker
● 20 environments = 20 differentVMs
● Cost increases with each new environment!!
● Effort increases with each new environment to configure
(ops)!!
● Time-to-market increases also!!
@fgortazar
CI/CD environment
● KurentoVMs for building
clients
● 1 node mvn & jdk 7 &
node 4
● 1 node mvn & jdk 7 &
node 6
● 1 node mvn & jdk 8 &
node 4
● 1 node mvn & jdk 8 &
node 6
● KurentoVMs for building
servers
● 2 UbuntuTrustyVMs
● 4 Ubuntu XenialVMs
● 2 Ubuntu latestVMs
@fgortazar
CI/CD environment
● Developers are pushing hard towards devops to
include changes in infrastructure
● Changes can hardly be reverted (possible, but…)
● Hard to test locally
● Works in my machine effect
● Wasted resources & insufficient resources at the same
time
● Can we do better?
@fgortazar
CI/CD environment
@fgortazar
CI/CD environment
@fgortazar
CI/CD environment
CI/CD environment
● Developers own the infrastructure on top of which
their tests will run
● Updates can be done safely
● CI environment much more stable
● Docker images can be updated quickly and easily
● Infrastructure testing much easier
@fgortazar
Git workflow
● When working together in a shared repository,
some rules apply as to how changes from the
different people involved in the team are
integrated, and which is the source of truth when
releasing software versions
● We’ll briefly see some common models of git
workflows that people is using
● When necessary, I’ll point you towards specificities
for some models regading the definition of your CI/
CD pipeline
@fgortazar
Git workflows
● Basic / Master development /Trunk development
● Everything happens in the master branch
● Each feature is developed in a local repository
● When features are not small enough some problems arise
● Members of the team might push commits to master for
uncompleted features
● Impossible to release a new version before all features has been
completed and integrated
● Most of the time master is broken, and unplanned releases are a
risk
@fgortazar
Git workflows
● Branch per feature
● Each features is developed in its own branch (branch’ed
from master)
● The feature is integrated only when complete
● Master is stable, and can be released at any moment
● The branch might be local or it can be shared thus
enabling CI for the features under development
● If so you need a multi-branch pipeline job in Jenkins jargon
@fgortazar
Git workflows
● Branch per feature with merge requests
● Similar to branch per feature, however there’s a
hierarchical permission model
● Some people can integrate directly in master
● Others must request a merge, that will be reviewed by
some members of the time prior to merge
● The CI server might help in integrating changes
@fgortazar
Git workflows
● Gitflow
● Probably the most complex one
● Useful in big projects, with many features and several
release versions to maintain
● There are two branches
● Master →  production branch. Integration into master only
happens if acceptance tests pass. Ready to be deployed.
● Develop →  integration branch. Features, developed in branches,
are integrated here first, then tests are run.
http://nvie.com/posts/a-successful-git-branching-model/
@fgortazar
Git workflows
● Fork workflow
● One of the most used in GitHub
● Developers fork the repository into their accounts
● This is called “forking” the repo
● Then they clone their own copy into their machines
● Changes are integrated into the developer’s repo first
● Changes are requested to be integrated into the main repo by
means of “pull-requests” (PRs)
● Someone with the necessary permissions accepts or rejects
the PR, probably with some aid from the CI server
https://github.com/elastest/elastest-platform-manager/pulls?q=is%3Apr+is%3Aclosed
@fgortazar
How to plan and design your pipelines
● Some preliminary concepts
● Background
● Planning
● CI/CD environment
● Git workflow
● Pipelines
● Code review
● Merging
● Releasing
● Deploying
@fgortazar
Pipelines
● What is a pipeline?
● Two meanings
● Set of jobs that are run in sequence
● In Jenkins a Pipeline job is a job that leverages the
Pipeline syntax based on the Groovy language
● There are two different syntax for Pipeline jobs
● Declarative Pipeline (DSL)
● Scripted Pipeline (Groovy)
@fgortazar
Code review jobs
● Needed only when doing code review
● Pull Requests / Merge Requests
● Run per change request before the commit is push to
master
● Fast: unit tests mainly
● Fix the commit before getting too deep into any
other task
● CI votes the change
● +1 can be accepted & integrated→ 
● -1 cannot be integrated, amendment needed→
@fgortazar
Committing
@fgortazar
Committing
node {
try {
stage("Test") {
docker.image('maven').inside('-v $HOME/.m2:/root/.m2') {
git https://github.com/codeurjc/testing.git
sh "cd tema1_4_ejem4; mvn test"
}
}
} catch(e) {
throw e
} finally {
junit "tema1_4_ejem4/**/target/surefire-reports/TEST-*.xml"
}
}
@fgortazar
Merge jobs
● Run once a something has been integrated into the
master branch
● Usually integration tests
● This might take longer
● Development versions are usually deployed to the
artifact repository if tests pass
● Living testing env updated if tests pass
@fgortazar
Merge jobs
@fgortazar
Merge jobs
pipeline {
agent any
stages {
stage("Preparation") {
steps {
git 'https://github.com/codeurjc/testing.git'
}
}
stage("Create app") {
steps {
sh "cd tema1_4_ejem4; docker-compose build"
}
}
stage("Start app") {
steps {
sh "cd tema1_4_ejem4; docker-compose up -d"
}
}
stage("Test") {
steps {
sleep 20
sh "cd tema1_4_ejem4; mvn test"
}
}
}
post {
always {
sh "cd tema1_4_ejem4; docker-compose logs"
sh "cd tema1_4_ejem4; docker-compose logs > all-logs.txt"
archive "tema1_4_ejem4/all-logs.txt"
sh "cd tema1_4_ejem4; docker-compose logs web > web-logs.txt"
archive "tema1_4_ejem4/web-logs.txt"
sh "cd tema1_4_ejem4; docker-compose logs db > db-logs.txt"
archive "tema1_4_ejem4/db-logs.txt"
sh "cd tema1_4_ejem4; docker-compose down"
junit "tema1_4_ejem4/**/target/surefire-reports/TEST-*.xml"
}
Clone repository
Create docker images
Start docker-compose
Execute Test
Archive logs
Shutdown SUT
@fgortazar
Merge jobs
●
SUT Logs are available as a text file
●
One file for all logs
●
One file per component
@fgortazar
Merge jobs
●
We need tools to manage logs
●
Put all logs in a single place
●
Test logs and SUT logs
●
Remote service to be used from SUT deployed in
any place
●
Advanced Log analysis capabilities
●
Filtering
●
Searching
●
Comparing
@fgortazar
Merge jobs
Elasticsearch Kibana Logstash Beats
https://www.elastic.co/
@fgortazar
Merge jobs
@fgortazar
Merge jobs
@fgortazar
Merge jobs
@fgortazar
Merge jobs
node{
elastest(tss: ['EUS']) {
stage("Preparation") {
git "https://github.com/elastest/full-teaching-experiment.git"
}
stage("Start SUT") {
sh "cd docker-compose/full-teaching-env; docker-compose up -d"
sh "sleep 20"
}
stage("Test") {
def sutIp = containerIp("fullteachingenv_full-teaching_1")
try {
sh "mvn -Dapp.url=https://" + sutIp +":5001/ test"
} finally {
sh "cd docker-compose/full-teaching-env; docker-compose down"
}
}
}
}
Use ElasTest Plugin with Browsers
Start SUT
Get web container IP
Teardown SUT
Execute Tests
@fgortazar
Merge jobs
@fgortazar
Log Analyzer
@fgortazar
Release jobs
● Building binaries
● Tagging the repository
● Publishing binaries in the artifact repository
● Smoke tests in staging environment
● Performance tests
● These can be integrated into the merge jobs
● Based on the version number the development/release
behavior is triggered
@fgortazar
Deployment jobs
● Shipping binaries to production environment
● Migrating the database if necessary
● Deploy based on the chosen strategy
● Blue/green
● Canary
● ...
● Run smoke tests to assess the critical paths
@fgortazar
Nightly jobs
● Run during the night or any moment where the CI
infra is not under heavy use
● Some of these tests need to be run in isolation
● End-to-end tests
● Performance tests
● Might take several hours to complete
● Verify the critical paths
● New software version needs to be deployed first
50
@fgortazar
Builds
@fgortazar
Final thoughts
● There might be dependencies…
● Consider if you’d like to run other projects that depend on this
one at every change /every release
● Increases the usage of the CI environment plan in advance→ 
● Which information is more important to you?
● Gather that information in your job
● Archive it for later inspection
● Additional tools might be needed
● ElasticSearch
● Kibana
● ElasTest
@fgortazar
Final thoughts
● Jobs can get really big…
● Separate them into different jobs
● Add a new job to orchestrate these new jobs
● Jobs can be called from other jobs
● Better visibility
stage('Update ci environments') {
steps {
build job: 'Development/run_ansible',
propagate: false
build job: 'Development/kurento_ci_build',
propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
}
}
@fgortazar
stage('Testing new environment') {
steps {
parallel (
"kurento_api_audit" : {
build job: 'Development/kurento_api_audit', propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
},
"kurento_app_audit" : {
build job: 'Development/kurento_app_audit', propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
},
"capability_functional_audit" : {
build job: 'Development/capability_functional_audit', propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
},
"capability_stability_audit" : {
build job: 'Development/capability_stability_audit', propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
},
"webrtc_audit" : {
build job: 'Development/webrtc_audit', propagate: false,
parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')]
}
)
}
}
Final thoughts
● They can be run in parallel
@fgortazar
Final thoughts
● Don’t repeat yourself
● Shared libraries is a great way of factoring out
common parts in your pipelines into a library that can
be reused across jobs
● Groovy libraries in a code repository
● Need to be added into Jenkins global configuration
● Just import them and enjoy!
How to plan and define
your CI/CD pipelines
Francisco (aka Patxi) Gortázar
francisco.gortazar@urjc.es
@fgortazar
Funded by the
European Union
Thanks!

More Related Content

What's hot

A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
HostedbyConfluent
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
Julian Mazzitelli
 
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through ScriptingWebinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
ForgeRock
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
confluent
 
Feature flag launchdarkly
Feature flag launchdarklyFeature flag launchdarkly
Feature flag launchdarkly
Sandeep Soni
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
David Hahn
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environment
confluent
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
sparkfabrik
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
Omar Fathy
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
viniciusban
 
Argocd up and running
Argocd up and runningArgocd up and running
Argocd up and running
Raphaël PINSON
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
DevOps Sonatype Nexus Demo_2023.pdf
DevOps Sonatype Nexus Demo_2023.pdfDevOps Sonatype Nexus Demo_2023.pdf
DevOps Sonatype Nexus Demo_2023.pdf
DevOps Tec
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
Volodymyr Shynkar
 
Understanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at ScaleUnderstanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at Scale
confluent
 
Pulsar Storage on BookKeeper _Seamless Evolution
Pulsar Storage on BookKeeper _Seamless EvolutionPulsar Storage on BookKeeper _Seamless Evolution
Pulsar Storage on BookKeeper _Seamless Evolution
StreamNative
 
Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)
Victor Iglesias
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
Pavlo Hodysh
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive Mode
Flink Forward
 

What's hot (20)

A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
Kafka Lag Monitoring For Human Beings (Elad Leev, AppsFlyer) Kafka Summit 2020
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through ScriptingWebinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
Feature flag launchdarkly
Feature flag launchdarklyFeature flag launchdarkly
Feature flag launchdarkly
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environment
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Argocd up and running
Argocd up and runningArgocd up and running
Argocd up and running
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
 
DevOps Sonatype Nexus Demo_2023.pdf
DevOps Sonatype Nexus Demo_2023.pdfDevOps Sonatype Nexus Demo_2023.pdf
DevOps Sonatype Nexus Demo_2023.pdf
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
 
Understanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at ScaleUnderstanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at Scale
 
Pulsar Storage on BookKeeper _Seamless Evolution
Pulsar Storage on BookKeeper _Seamless EvolutionPulsar Storage on BookKeeper _Seamless Evolution
Pulsar Storage on BookKeeper _Seamless Evolution
 
Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)Environment management in a continuous delivery world (3)
Environment management in a continuous delivery world (3)
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
 
Autoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive ModeAutoscaling Flink with Reactive Mode
Autoscaling Flink with Reactive Mode
 

Similar to How to plan and define your CI-CD pipeline

Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
Vinothini KadambavanaSundaram
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTS
Murughan Palaniachari
 
Microservices Development Process at Predix.io
Microservices Development Process at Predix.ioMicroservices Development Process at Predix.io
Microservices Development Process at Predix.io
Constantine Grigel
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
Stephen Yeargin
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
Cory Webb
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
Bruno Capuano
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
GR8Conf
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
Jody Garnett
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
[scala.by] Launching new application fast
[scala.by] Launching new application fast[scala.by] Launching new application fast
[scala.by] Launching new application fast
Denis Karpenko
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2
Kaxil Naik
 
Rejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainRejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform Gain
Łukasz Piątkowski
 
20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup
Stéphane Este-Gracias
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
GlobalLogic Ukraine
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
Chandan Kumar
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 
Git
GitGit
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
Edward Goikhman
 
Introduction to DevOps and the Practical Use Cases at Credit OK
Introduction to DevOps and the Practical Use Cases at Credit OKIntroduction to DevOps and the Practical Use Cases at Credit OK
Introduction to DevOps and the Practical Use Cases at Credit OK
Kriangkrai Chaonithi
 
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Nico Meisenzahl
 

Similar to How to plan and define your CI-CD pipeline (20)

Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTS
 
Microservices Development Process at Predix.io
Microservices Development Process at Predix.ioMicroservices Development Process at Predix.io
Microservices Development Process at Predix.io
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
[scala.by] Launching new application fast
[scala.by] Launching new application fast[scala.by] Launching new application fast
[scala.by] Launching new application fast
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2
 
Rejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform GainRejekts 24 EU No GitOps Pain, No Platform Gain
Rejekts 24 EU No GitOps Pain, No Platform Gain
 
20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 
Git
GitGit
Git
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
Introduction to DevOps and the Practical Use Cases at Credit OK
Introduction to DevOps and the Practical Use Cases at Credit OKIntroduction to DevOps and the Practical Use Cases at Credit OK
Introduction to DevOps and the Practical Use Cases at Credit OK
 
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
 

More from ElasTest Project

ElasTest: quality for cloud native applications
ElasTest: quality for cloud native applicationsElasTest: quality for cloud native applications
ElasTest: quality for cloud native applications
ElasTest Project
 
Bringing observability to your testing environments
Bringing observability to your testing environmentsBringing observability to your testing environments
Bringing observability to your testing environments
ElasTest Project
 
Life-cycle is too short not to use ElasTest
Life-cycle is too short not to use ElasTestLife-cycle is too short not to use ElasTest
Life-cycle is too short not to use ElasTest
ElasTest Project
 
ElasTest Webinar
ElasTest WebinarElasTest Webinar
ElasTest Webinar
ElasTest Project
 
ElasTest presentation in MadridJUG (Madrid December 2017)
ElasTest presentation in MadridJUG (Madrid December 2017)ElasTest presentation in MadridJUG (Madrid December 2017)
ElasTest presentation in MadridJUG (Madrid December 2017)
ElasTest Project
 
ElasTest presentation in Panel Sistemas company (Madrid December 2017)
ElasTest presentation in Panel Sistemas company (Madrid December 2017)ElasTest presentation in Panel Sistemas company (Madrid December 2017)
ElasTest presentation in Panel Sistemas company (Madrid December 2017)
ElasTest Project
 
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
ElasTest Project
 
ElasTest - Testing in the large
ElasTest - Testing in the largeElasTest - Testing in the large
ElasTest - Testing in the large
ElasTest Project
 
ElasTest ICSOFT 2017 - Panel H2020
ElasTest ICSOFT 2017 - Panel H2020ElasTest ICSOFT 2017 - Panel H2020
ElasTest ICSOFT 2017 - Panel H2020
ElasTest Project
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ElasTest Project
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
ElasTest Project
 
Tarot 2017
Tarot 2017Tarot 2017
Tarot 2017
ElasTest Project
 
ElasTest technical presentation
ElasTest technical presentationElasTest technical presentation
ElasTest technical presentation
ElasTest Project
 

More from ElasTest Project (13)

ElasTest: quality for cloud native applications
ElasTest: quality for cloud native applicationsElasTest: quality for cloud native applications
ElasTest: quality for cloud native applications
 
Bringing observability to your testing environments
Bringing observability to your testing environmentsBringing observability to your testing environments
Bringing observability to your testing environments
 
Life-cycle is too short not to use ElasTest
Life-cycle is too short not to use ElasTestLife-cycle is too short not to use ElasTest
Life-cycle is too short not to use ElasTest
 
ElasTest Webinar
ElasTest WebinarElasTest Webinar
ElasTest Webinar
 
ElasTest presentation in MadridJUG (Madrid December 2017)
ElasTest presentation in MadridJUG (Madrid December 2017)ElasTest presentation in MadridJUG (Madrid December 2017)
ElasTest presentation in MadridJUG (Madrid December 2017)
 
ElasTest presentation in Panel Sistemas company (Madrid December 2017)
ElasTest presentation in Panel Sistemas company (Madrid December 2017)ElasTest presentation in Panel Sistemas company (Madrid December 2017)
ElasTest presentation in Panel Sistemas company (Madrid December 2017)
 
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
ElasTest presentation in VLCTesting Conference (Valencia Novemeber 2017)
 
ElasTest - Testing in the large
ElasTest - Testing in the largeElasTest - Testing in the large
ElasTest - Testing in the large
 
ElasTest ICSOFT 2017 - Panel H2020
ElasTest ICSOFT 2017 - Panel H2020ElasTest ICSOFT 2017 - Panel H2020
ElasTest ICSOFT 2017 - Panel H2020
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
 
Tarot 2017
Tarot 2017Tarot 2017
Tarot 2017
 
ElasTest technical presentation
ElasTest technical presentationElasTest technical presentation
ElasTest technical presentation
 

Recently uploaded

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

How to plan and define your CI-CD pipeline

  • 1. How to plan and define your CI/CD pipelines Francisco (aka Patxi) Gortázar francisco.gortazar@urjc.es @fgortazar Funded by the European Union
  • 2. @fgortazar Bio Project Coordinator at @elastestio EU project Devops @ Kurento/OpenVidu TeachingTesting & Distributed Systems @ URJC @fgortazar https://es.linkedin.com/in/franciscogortazar
  • 3. @fgortazar Bio Project Coordinator at @elastestio EU project Devops @ Kurento/OpenVidu TeachingTesting & Distributed Systems @ URJC @fgortazar https://es.linkedin.com/in/franciscogortazar
  • 4. @fgortazar How to plan and design your pipelines ● Some preliminary concepts ● Background ● Planning ● CI/CD environment ● Git workflow ● Pipelines ● Code review ● Merging ● Releasing ● Deploying
  • 5. @fgortazar Some preliminary concepts ● Software is usually built by teams ● People within the team share the code as they build it by means of source control management tools SCM Tools / Services offering git repositories
  • 6. @fgortazar Some preliminary concepts ● Each time someone shares its changes through the repository, we should check that: ● The project is still compiling ● All the tests still pass (they’re green) ● Compiling and running tests on a trusted environment is Continuous Integration’s task ● When a problem arises, it is notified immediately to the team
  • 7. Some preliminary concepts ● Integration must happen continuously (at least once per day) ● Fast feedback is key, so that we know our changes are working when integrated with the rest of the system ● Problems detected in our CI environment must be solved immediately ● Status of the project in terms of builds, test, and deployments is visible at any moment
  • 9. @fgortazar How to plan and design your pipelines ● Some preliminary concepts ● Background ● Planning ● CI/CD environment ● Git workflow ● Pipelines ● Code review ● Merging ● Releasing ● Deploying
  • 13. Background ● Some numbers ● 30 code repositories ● ~400 Jenkins jobs ● +1,000 tests ● +20 different environments to test ● +80 artifacts to be deployed at release time
  • 14. @fgortazar How to plan and design your pipelines ● Some preliminary concepts ● Background ● Planning ● CI/CD environment ● Git workflow ● Pipelines ● Code review ● Merging ● Releasing ● Deploying
  • 15. Planning ● What’s your Git workflow ● Branches are to be integrated as well? ● Depend-on components are to be considered? ● Infrastructure planning ● Snapshot versions ● Release versions ● Deployments
  • 16. @fgortazar CI/CD environment ● Feasible infrastructures and their consequences ● Public cloud vs private cloud (on premises) ● Controlling public cloud costs (e.g. spot instances, stopping instances not in use...) ● Virtual Machines vs Docker ● 20 environments = 20 differentVMs ● Cost increases with each new environment!! ● Effort increases with each new environment to configure (ops)!! ● Time-to-market increases also!!
  • 17. @fgortazar CI/CD environment ● KurentoVMs for building clients ● 1 node mvn & jdk 7 & node 4 ● 1 node mvn & jdk 7 & node 6 ● 1 node mvn & jdk 8 & node 4 ● 1 node mvn & jdk 8 & node 6 ● KurentoVMs for building servers ● 2 UbuntuTrustyVMs ● 4 Ubuntu XenialVMs ● 2 Ubuntu latestVMs
  • 18. @fgortazar CI/CD environment ● Developers are pushing hard towards devops to include changes in infrastructure ● Changes can hardly be reverted (possible, but…) ● Hard to test locally ● Works in my machine effect ● Wasted resources & insufficient resources at the same time ● Can we do better?
  • 22. CI/CD environment ● Developers own the infrastructure on top of which their tests will run ● Updates can be done safely ● CI environment much more stable ● Docker images can be updated quickly and easily ● Infrastructure testing much easier
  • 23. @fgortazar Git workflow ● When working together in a shared repository, some rules apply as to how changes from the different people involved in the team are integrated, and which is the source of truth when releasing software versions ● We’ll briefly see some common models of git workflows that people is using ● When necessary, I’ll point you towards specificities for some models regading the definition of your CI/ CD pipeline
  • 24. @fgortazar Git workflows ● Basic / Master development /Trunk development ● Everything happens in the master branch ● Each feature is developed in a local repository ● When features are not small enough some problems arise ● Members of the team might push commits to master for uncompleted features ● Impossible to release a new version before all features has been completed and integrated ● Most of the time master is broken, and unplanned releases are a risk
  • 25. @fgortazar Git workflows ● Branch per feature ● Each features is developed in its own branch (branch’ed from master) ● The feature is integrated only when complete ● Master is stable, and can be released at any moment ● The branch might be local or it can be shared thus enabling CI for the features under development ● If so you need a multi-branch pipeline job in Jenkins jargon
  • 26. @fgortazar Git workflows ● Branch per feature with merge requests ● Similar to branch per feature, however there’s a hierarchical permission model ● Some people can integrate directly in master ● Others must request a merge, that will be reviewed by some members of the time prior to merge ● The CI server might help in integrating changes
  • 27. @fgortazar Git workflows ● Gitflow ● Probably the most complex one ● Useful in big projects, with many features and several release versions to maintain ● There are two branches ● Master → production branch. Integration into master only happens if acceptance tests pass. Ready to be deployed. ● Develop → integration branch. Features, developed in branches, are integrated here first, then tests are run. http://nvie.com/posts/a-successful-git-branching-model/
  • 28. @fgortazar Git workflows ● Fork workflow ● One of the most used in GitHub ● Developers fork the repository into their accounts ● This is called “forking” the repo ● Then they clone their own copy into their machines ● Changes are integrated into the developer’s repo first ● Changes are requested to be integrated into the main repo by means of “pull-requests” (PRs) ● Someone with the necessary permissions accepts or rejects the PR, probably with some aid from the CI server https://github.com/elastest/elastest-platform-manager/pulls?q=is%3Apr+is%3Aclosed
  • 29. @fgortazar How to plan and design your pipelines ● Some preliminary concepts ● Background ● Planning ● CI/CD environment ● Git workflow ● Pipelines ● Code review ● Merging ● Releasing ● Deploying
  • 30. @fgortazar Pipelines ● What is a pipeline? ● Two meanings ● Set of jobs that are run in sequence ● In Jenkins a Pipeline job is a job that leverages the Pipeline syntax based on the Groovy language ● There are two different syntax for Pipeline jobs ● Declarative Pipeline (DSL) ● Scripted Pipeline (Groovy)
  • 31. @fgortazar Code review jobs ● Needed only when doing code review ● Pull Requests / Merge Requests ● Run per change request before the commit is push to master ● Fast: unit tests mainly ● Fix the commit before getting too deep into any other task ● CI votes the change ● +1 can be accepted & integrated→ ● -1 cannot be integrated, amendment needed→
  • 33. @fgortazar Committing node { try { stage("Test") { docker.image('maven').inside('-v $HOME/.m2:/root/.m2') { git https://github.com/codeurjc/testing.git sh "cd tema1_4_ejem4; mvn test" } } } catch(e) { throw e } finally { junit "tema1_4_ejem4/**/target/surefire-reports/TEST-*.xml" } }
  • 34. @fgortazar Merge jobs ● Run once a something has been integrated into the master branch ● Usually integration tests ● This might take longer ● Development versions are usually deployed to the artifact repository if tests pass ● Living testing env updated if tests pass
  • 36. @fgortazar Merge jobs pipeline { agent any stages { stage("Preparation") { steps { git 'https://github.com/codeurjc/testing.git' } } stage("Create app") { steps { sh "cd tema1_4_ejem4; docker-compose build" } } stage("Start app") { steps { sh "cd tema1_4_ejem4; docker-compose up -d" } } stage("Test") { steps { sleep 20 sh "cd tema1_4_ejem4; mvn test" } } } post { always { sh "cd tema1_4_ejem4; docker-compose logs" sh "cd tema1_4_ejem4; docker-compose logs > all-logs.txt" archive "tema1_4_ejem4/all-logs.txt" sh "cd tema1_4_ejem4; docker-compose logs web > web-logs.txt" archive "tema1_4_ejem4/web-logs.txt" sh "cd tema1_4_ejem4; docker-compose logs db > db-logs.txt" archive "tema1_4_ejem4/db-logs.txt" sh "cd tema1_4_ejem4; docker-compose down" junit "tema1_4_ejem4/**/target/surefire-reports/TEST-*.xml" } Clone repository Create docker images Start docker-compose Execute Test Archive logs Shutdown SUT
  • 37. @fgortazar Merge jobs ● SUT Logs are available as a text file ● One file for all logs ● One file per component
  • 38. @fgortazar Merge jobs ● We need tools to manage logs ● Put all logs in a single place ● Test logs and SUT logs ● Remote service to be used from SUT deployed in any place ● Advanced Log analysis capabilities ● Filtering ● Searching ● Comparing
  • 39. @fgortazar Merge jobs Elasticsearch Kibana Logstash Beats https://www.elastic.co/
  • 43. @fgortazar Merge jobs node{ elastest(tss: ['EUS']) { stage("Preparation") { git "https://github.com/elastest/full-teaching-experiment.git" } stage("Start SUT") { sh "cd docker-compose/full-teaching-env; docker-compose up -d" sh "sleep 20" } stage("Test") { def sutIp = containerIp("fullteachingenv_full-teaching_1") try { sh "mvn -Dapp.url=https://" + sutIp +":5001/ test" } finally { sh "cd docker-compose/full-teaching-env; docker-compose down" } } } } Use ElasTest Plugin with Browsers Start SUT Get web container IP Teardown SUT Execute Tests
  • 46. @fgortazar Release jobs ● Building binaries ● Tagging the repository ● Publishing binaries in the artifact repository ● Smoke tests in staging environment ● Performance tests ● These can be integrated into the merge jobs ● Based on the version number the development/release behavior is triggered
  • 47. @fgortazar Deployment jobs ● Shipping binaries to production environment ● Migrating the database if necessary ● Deploy based on the chosen strategy ● Blue/green ● Canary ● ... ● Run smoke tests to assess the critical paths
  • 48. @fgortazar Nightly jobs ● Run during the night or any moment where the CI infra is not under heavy use ● Some of these tests need to be run in isolation ● End-to-end tests ● Performance tests ● Might take several hours to complete ● Verify the critical paths ● New software version needs to be deployed first
  • 50. @fgortazar Final thoughts ● There might be dependencies… ● Consider if you’d like to run other projects that depend on this one at every change /every release ● Increases the usage of the CI environment plan in advance→ ● Which information is more important to you? ● Gather that information in your job ● Archive it for later inspection ● Additional tools might be needed ● ElasticSearch ● Kibana ● ElasTest
  • 51. @fgortazar Final thoughts ● Jobs can get really big… ● Separate them into different jobs ● Add a new job to orchestrate these new jobs ● Jobs can be called from other jobs ● Better visibility stage('Update ci environments') { steps { build job: 'Development/run_ansible', propagate: false build job: 'Development/kurento_ci_build', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] } }
  • 52. @fgortazar stage('Testing new environment') { steps { parallel ( "kurento_api_audit" : { build job: 'Development/kurento_api_audit', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] }, "kurento_app_audit" : { build job: 'Development/kurento_app_audit', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] }, "capability_functional_audit" : { build job: 'Development/capability_functional_audit', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] }, "capability_stability_audit" : { build job: 'Development/capability_stability_audit', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] }, "webrtc_audit" : { build job: 'Development/webrtc_audit', propagate: false, parameters: [string(name: 'GERRIT_REFSPEC', value: 'master')] } ) } } Final thoughts ● They can be run in parallel
  • 53. @fgortazar Final thoughts ● Don’t repeat yourself ● Shared libraries is a great way of factoring out common parts in your pipelines into a library that can be reused across jobs ● Groovy libraries in a code repository ● Need to be added into Jenkins global configuration ● Just import them and enjoy!
  • 54. How to plan and define your CI/CD pipelines Francisco (aka Patxi) Gortázar francisco.gortazar@urjc.es @fgortazar Funded by the European Union Thanks!