SlideShare a Scribd company logo
Continuous deployment with Jenkins and Salt
LinuxCon CloudOpen ContainerCon
North America 2015, Seattle
Anirban Saha
About me
Techie…
Traveller…
Thinker…
Author of ‘Salt Cookbook’
Deployment
Should be…
• Simple
• Stable
• Fast (good to have…)
• Reliable
• One click
Problems faced
• Code distribution
• Additional tasks (commands, migrations)
• Latency
• Parallel execution
• Batch deployments
• Ensuring uptime
Methods available
Deployment
Configuration management tools :
• Puppet, Chef, Ansible, Salt
Remote execution tools:
• SSH, Parallel SSH, Rundeck
Packages:
• Code packaged as RPM or DEB files
Code storage
• GIT server (Github, Gitlab, Bitbucket, etc.)
• Object storage (Amazon S3, Swift, etc.)
• Package repositories (YUM/Debian)
• Configuration management repositories
• File servers managed manually
Problems
Deployment:
• Remote execution tools :
• Time consuming (over SSH)
• Need to maintain inventory of hosts
Code storage:
• GIT repositories:
• Usually centrally located, latency when deployed from GIT
• Package repositories (RPM/DEB):
• Problems in simultaneously updating repo metadata
Rollback:
• Version manipulation is a problem with most configuration
management and remote execution tools
Salt
Provides…
• Agent based communication
• Fast execution
• Orchestration
• Batch execution
• Strong Integration with providers and
services
Salt features
Targeting deployment nodes :
• By hostname
• ‘myappweb*’
• By specific grains
• -G ‘node_type:webserver’
• By nodegroups
• -N webgroup
Salt features
Task dependencies :
• Salt requisites to make tasks dependent on each other
get_archive:
module.run:
.
.
deploy_app:
module.run:
.
.
- require:
- module: get_archive
Salt features
Orchestration :
webgrp2_deploy:
salt.state:
- tgt: ' webgrp2'
- tgt_type: nodegroup
- sls:
- webserver.deploy
- require:
- salt: webgrp1_deploy
webgrp1_deploy:
salt.state:
- tgt: 'webgrp1'
- tgt_type: nodegroup
- sls:
- webserver.deploy
Salt features
Batch Execution :
• By number of hosts
• --batch-size 5
• Executes on 5 hosts at a time
• By percentage of hosts
• --batch-size 25%
• Executes on 25% of total target
hosts at a time
Salt features
Salt API:
# curl -H "Accept: application/json"
-d secretkey= "mysupersecretkey"
-k https://10.0.0.2:8080/hook/deploy
{"success": true}
Tools
To be used…
• GIT for code repository
• Jenkins for CI
• Ant for build and tasks
• Amazon S3 for code archive storage
• Salt for deployment
• Shell scripts (good old bash) for
additional tasks
Salt deployment methods
• Salt hosted on the Jenkins server.
Jenkins calls Salt binary
• Salt hosted independently.
Jenkins calls Salt via SSH
• Jenkins calls Salt via Salt API
Objective
Steps
• salt-cloud used to launch instances
• Post install actions used to synchronize EC2 grains
• Salt reactor used to run states on new instances ,
perform deployment and register with load balancer
• Jenkins build job used to build new code, create tags
and push new deployment ready archive to Amazon
S3
• Jenkins deploy job used to fetch new code version
and deploy code on target servers
Steps explained
• Salt cloud is used to spawn instances
• Following parameter is provided in the profile to push custom EC2 grains,
• sync_after_install: grains
• The node is registered and deregistered from the load balancer with the
following module definition,
register:
module.run:
- name: boto_elb.register_instances
- m_name: mywebapp
- instances:
- {{ grains['ec2']['instance_id'] }}
• Here ['ec2']['instance_id'] is one of the custom grains pushed to the node
Steps explained
Fetching archive:
Salt s3 execution module used to get code archive from
Amazon S3
fetch_app_archive:
module.run:
- name: s3.get
- bucket: mywebapp-us
- path: mywebapp-{{ app_version }}.tar
- local_file: /tmp/mywebapp-{{ app_version }}.tar
Steps explained
Setting App version grain:
After every deploy, a grain is set to record the
app version deployed for tracking,
app_version:
grains.present:
- value: {{ app_version }}
- require:
- cmd: deploy_app
Steps explained
Deployment based on App version:
At every deploy, it is checked if the version to
be deployed is already on the node using the
app_version grain,
{% if grains['app_version'] != app_version %}
deregister:
fetch_app_archive:
deploy_app:
register:
{% endif %}
Lets do it then !!!
Demo repository
Get the demo repository at the
following location,
https://github.com/rosesnthornz/
cloudopen-na-2015
Questions ?
Contact
Email :
sahaanirban1988@gmail.com
Twitter : @rosesnthornz
Thank You !!!

More Related Content

What's hot

Configuration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needsConfiguration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needs
SaltStack
 
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
SaltStack
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStack
SaltStack
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeck
Will Sterling
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
Karthik .P.R
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
Matt Ray
 
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud InfrastructureSCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
Matt Ray
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101
APNIC
 
PuppetCamp Sydney 2012 - Building a Multimaster Environment
PuppetCamp Sydney 2012 - Building a Multimaster EnvironmentPuppetCamp Sydney 2012 - Building a Multimaster Environment
PuppetCamp Sydney 2012 - Building a Multimaster Environment
Greg Cockburn
 
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltStack
 
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Puppet
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltStack
 
Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
Vinícius Batista de Souza
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
Michael Lessard
 
Foreman in your datacenter
Foreman in your datacenterForeman in your datacenter
Foreman in your datacenter
lzap
 
Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014
Matt Ray
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
Danilo Bordini
 

What's hot (19)

Configuration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needsConfiguration Management - Finding the tool to fit your needs
Configuration Management - Finding the tool to fit your needs
 
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
SaltConf14 - Anita Kuno, HP & OpenStack - Using SaltStack for event-driven or...
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStack
 
Boulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeckBoulder dev ops-meetup-11-2012-rundeck
Boulder dev ops-meetup-11-2012-rundeck
 
Chef
ChefChef
Chef
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud InfrastructureSCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
PuppetCamp Sydney 2012 - Building a Multimaster Environment
PuppetCamp Sydney 2012 - Building a Multimaster EnvironmentPuppetCamp Sydney 2012 - Building a Multimaster Environment
PuppetCamp Sydney 2012 - Building a Multimaster Environment
 
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
 
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
Running at Scale: Practical Performance Tuning with Puppet - PuppetConf 2013
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Foreman in your datacenter
Foreman in your datacenterForeman in your datacenter
Foreman in your datacenter
 
Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
 

Viewers also liked

Une heureuse journée fête des mères _ by Anais_Hanahis
Une heureuse journée fête des mères _ by Anais_HanahisUne heureuse journée fête des mères _ by Anais_Hanahis
Une heureuse journée fête des mères _ by Anais_Hanahis
Anais Hanahis
 
Printemps que je fis éveillée 3 by anais_hanahis
Printemps que je fis éveillée 3    by anais_hanahisPrintemps que je fis éveillée 3    by anais_hanahis
Printemps que je fis éveillée 3 by anais_hanahis
Anais Hanahis
 
Personal Branding - di Simone Prinari
Personal Branding - di Simone PrinariPersonal Branding - di Simone Prinari
Personal Branding - di Simone Prinari
Simone Prinari
 
3ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
3ª Pesquisa Iniciativas em BPM – Evento IQPC 20103ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
3ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
EloGroup
 
Progetto - Andare a quel Paese - di Simone Prinari
Progetto - Andare a quel Paese - di Simone PrinariProgetto - Andare a quel Paese - di Simone Prinari
Progetto - Andare a quel Paese - di Simone Prinari
Simone Prinari
 
Art peinture tango 2 by anais_hanahis
Art peinture tango   2   by anais_hanahisArt peinture tango   2   by anais_hanahis
Art peinture tango 2 by anais_hanahisAnais Hanahis
 
Find your voice project
Find your voice projectFind your voice project
Find your voice project
jxckson
 
Fotos de 03 de novembro
Fotos de 03 de novembroFotos de 03 de novembro
Fotos de 03 de novembro
wwf_brasil
 
The Coming Age of Magic
The Coming Age of MagicThe Coming Age of Magic
The Coming Age of Magic
Mike Kuniavsky
 
Presentacion Administracion
Presentacion AdministracionPresentacion Administracion
Presentacion Administracion
guest7d7c47
 
Non verbal communication
Non verbal communicationNon verbal communication
Non verbal communication
RISHIRAJ EDUCATION FOUNDATION
 
Elo Group OrganizaçãO Orientada A Processos (Abpmp)
Elo Group   OrganizaçãO Orientada A Processos (Abpmp)Elo Group   OrganizaçãO Orientada A Processos (Abpmp)
Elo Group OrganizaçãO Orientada A Processos (Abpmp)EloGroup
 

Viewers also liked (16)

Une heureuse journée fête des mères _ by Anais_Hanahis
Une heureuse journée fête des mères _ by Anais_HanahisUne heureuse journée fête des mères _ by Anais_Hanahis
Une heureuse journée fête des mères _ by Anais_Hanahis
 
Printemps que je fis éveillée 3 by anais_hanahis
Printemps que je fis éveillée 3    by anais_hanahisPrintemps que je fis éveillée 3    by anais_hanahis
Printemps que je fis éveillée 3 by anais_hanahis
 
Milieu1
Milieu1Milieu1
Milieu1
 
CamdenGroup
CamdenGroupCamdenGroup
CamdenGroup
 
Mi Archivo
Mi ArchivoMi Archivo
Mi Archivo
 
Personal Branding - di Simone Prinari
Personal Branding - di Simone PrinariPersonal Branding - di Simone Prinari
Personal Branding - di Simone Prinari
 
3ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
3ª Pesquisa Iniciativas em BPM – Evento IQPC 20103ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
3ª Pesquisa Iniciativas em BPM – Evento IQPC 2010
 
Progetto - Andare a quel Paese - di Simone Prinari
Progetto - Andare a quel Paese - di Simone PrinariProgetto - Andare a quel Paese - di Simone Prinari
Progetto - Andare a quel Paese - di Simone Prinari
 
Art peinture tango 2 by anais_hanahis
Art peinture tango   2   by anais_hanahisArt peinture tango   2   by anais_hanahis
Art peinture tango 2 by anais_hanahis
 
Find your voice project
Find your voice projectFind your voice project
Find your voice project
 
Fotos de 03 de novembro
Fotos de 03 de novembroFotos de 03 de novembro
Fotos de 03 de novembro
 
Presentation1
Presentation1Presentation1
Presentation1
 
The Coming Age of Magic
The Coming Age of MagicThe Coming Age of Magic
The Coming Age of Magic
 
Presentacion Administracion
Presentacion AdministracionPresentacion Administracion
Presentacion Administracion
 
Non verbal communication
Non verbal communicationNon verbal communication
Non verbal communication
 
Elo Group OrganizaçãO Orientada A Processos (Abpmp)
Elo Group   OrganizaçãO Orientada A Processos (Abpmp)Elo Group   OrganizaçãO Orientada A Processos (Abpmp)
Elo Group OrganizaçãO Orientada A Processos (Abpmp)
 

Similar to Continuous Deployment with Jenkins and Salt

CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
A Million ways of Deploying a Kubernetes Cluster
A Million ways of Deploying a Kubernetes ClusterA Million ways of Deploying a Kubernetes Cluster
A Million ways of Deploying a Kubernetes Cluster
Jimmy Lu
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
Gianluca Varisco
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013dotCloud
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
Tuenti
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
AWS Vietnam Community
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
Amazon Web Services
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Codemotion
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
NETWAYS
 
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and ServerspecVerifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Edmund Dipple
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
Amazon Web Services
 
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
Chef
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
Kimberly Macias
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
NETWAYS
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
Liang Bo
 
QA speed up story
QA speed up storyQA speed up story
QA speed up story
Slava Kuznetsov
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
Alessandro Pilotti
 

Similar to Continuous Deployment with Jenkins and Salt (20)

CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
A Million ways of Deploying a Kubernetes Cluster
A Million ways of Deploying a Kubernetes ClusterA Million ways of Deploying a Kubernetes Cluster
A Million ways of Deploying a Kubernetes Cluster
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
 
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and ServerspecVerifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
 
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
OSDC 2014: Tobias Schwab - Continuous Delivery with Docker
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
 
QA speed up story
QA speed up storyQA speed up story
QA speed up story
 
OpenStack and Windows
OpenStack and WindowsOpenStack and Windows
OpenStack and Windows
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 

Continuous Deployment with Jenkins and Salt

  • 1. Continuous deployment with Jenkins and Salt LinuxCon CloudOpen ContainerCon North America 2015, Seattle Anirban Saha
  • 3. Deployment Should be… • Simple • Stable • Fast (good to have…) • Reliable • One click
  • 4. Problems faced • Code distribution • Additional tasks (commands, migrations) • Latency • Parallel execution • Batch deployments • Ensuring uptime
  • 5. Methods available Deployment Configuration management tools : • Puppet, Chef, Ansible, Salt Remote execution tools: • SSH, Parallel SSH, Rundeck Packages: • Code packaged as RPM or DEB files
  • 6. Code storage • GIT server (Github, Gitlab, Bitbucket, etc.) • Object storage (Amazon S3, Swift, etc.) • Package repositories (YUM/Debian) • Configuration management repositories • File servers managed manually
  • 7. Problems Deployment: • Remote execution tools : • Time consuming (over SSH) • Need to maintain inventory of hosts Code storage: • GIT repositories: • Usually centrally located, latency when deployed from GIT • Package repositories (RPM/DEB): • Problems in simultaneously updating repo metadata Rollback: • Version manipulation is a problem with most configuration management and remote execution tools
  • 8. Salt Provides… • Agent based communication • Fast execution • Orchestration • Batch execution • Strong Integration with providers and services
  • 9. Salt features Targeting deployment nodes : • By hostname • ‘myappweb*’ • By specific grains • -G ‘node_type:webserver’ • By nodegroups • -N webgroup
  • 10. Salt features Task dependencies : • Salt requisites to make tasks dependent on each other get_archive: module.run: . . deploy_app: module.run: . . - require: - module: get_archive
  • 11. Salt features Orchestration : webgrp2_deploy: salt.state: - tgt: ' webgrp2' - tgt_type: nodegroup - sls: - webserver.deploy - require: - salt: webgrp1_deploy webgrp1_deploy: salt.state: - tgt: 'webgrp1' - tgt_type: nodegroup - sls: - webserver.deploy
  • 12. Salt features Batch Execution : • By number of hosts • --batch-size 5 • Executes on 5 hosts at a time • By percentage of hosts • --batch-size 25% • Executes on 25% of total target hosts at a time
  • 13. Salt features Salt API: # curl -H "Accept: application/json" -d secretkey= "mysupersecretkey" -k https://10.0.0.2:8080/hook/deploy {"success": true}
  • 14. Tools To be used… • GIT for code repository • Jenkins for CI • Ant for build and tasks • Amazon S3 for code archive storage • Salt for deployment • Shell scripts (good old bash) for additional tasks
  • 15. Salt deployment methods • Salt hosted on the Jenkins server. Jenkins calls Salt binary • Salt hosted independently. Jenkins calls Salt via SSH • Jenkins calls Salt via Salt API
  • 17. Steps • salt-cloud used to launch instances • Post install actions used to synchronize EC2 grains • Salt reactor used to run states on new instances , perform deployment and register with load balancer • Jenkins build job used to build new code, create tags and push new deployment ready archive to Amazon S3 • Jenkins deploy job used to fetch new code version and deploy code on target servers
  • 18. Steps explained • Salt cloud is used to spawn instances • Following parameter is provided in the profile to push custom EC2 grains, • sync_after_install: grains • The node is registered and deregistered from the load balancer with the following module definition, register: module.run: - name: boto_elb.register_instances - m_name: mywebapp - instances: - {{ grains['ec2']['instance_id'] }} • Here ['ec2']['instance_id'] is one of the custom grains pushed to the node
  • 19. Steps explained Fetching archive: Salt s3 execution module used to get code archive from Amazon S3 fetch_app_archive: module.run: - name: s3.get - bucket: mywebapp-us - path: mywebapp-{{ app_version }}.tar - local_file: /tmp/mywebapp-{{ app_version }}.tar
  • 20. Steps explained Setting App version grain: After every deploy, a grain is set to record the app version deployed for tracking, app_version: grains.present: - value: {{ app_version }} - require: - cmd: deploy_app
  • 21. Steps explained Deployment based on App version: At every deploy, it is checked if the version to be deployed is already on the node using the app_version grain, {% if grains['app_version'] != app_version %} deregister: fetch_app_archive: deploy_app: register: {% endif %}
  • 22. Lets do it then !!!
  • 23. Demo repository Get the demo repository at the following location, https://github.com/rosesnthornz/ cloudopen-na-2015