SlideShare uma empresa Scribd logo
1 de 38
How Ansible helps Backbase
Ansible Benelux meetup
Pavel Chunyayev
Amsterdam, 27-5-2015
Who am I
• Come from Ukraine
• 11 years in IT
• Worked in Ukraine, Estonia and the Netherlands
• Continuous Delivery architect at Levi9 IT Services
• Last 6 months - Automation architect at Backbase
Backbase CXP
Backbase Customer Experience Platform
• Core services
• Content services
• Publication services
• 3 environments – Editorial, Staging, Live
Different configuration options
• Java version
• Application Server
• RDBMS
• HTTP/HTTPS
• Internal configuration options
• Optional application features
A lot of things are already automated
• There are servers for released CXP version
• With different configurations
• They can be started/stopped when needed
• Newest version of the application needs to be deployed.
• In most cases manually.
• For some configurations deployment required repackaging of the application.
• Automated through maven
• There is a sandbox environment with the nightly build
• Deployed automatically
• Far from production setup
Handcrafted servers
• Hard to maintain
• Very time/cost sensitive
• Setup is not easily reproducible
• May be buggy
• It should take less time to rebuild a server from the scratch than to
log in and fix/update it.
Solution
Solution diagram
Why Ansible
• Python powered
• No master, agentless
• Free, open source
• Plenty of modules (batteries included)
• Great EC2 support
• Windows support (kind of)
• Parallel, but controllable execution
• Quite simple for developer to understand
Why REST service
• Create infrastructure easily
• Just send JSON formatted configuration
• Service will analyze it and trigger Ansible run
• Service is the single point of contact for any infrastructure requests
• Can be integrated into any CI, script, application or other service
Why UI
• Everyone needs to create an environment from time to time
• Opening a ticket and then waiting is not an option
• In most situations environments are required for a short period of
time.
• Self-service
Demo
• Directory structure
• Flow of work
• Decision tree
Ansible features we are using
• Handlers
• Variables
• Jinja2 templates
• Facts
• Conditions
• Playbook includes
• Inventory (fake) – hostgroups!
• Roles :(
ec2
ec2:
key_name: '{{ keypair }}'
group_id: '{{ security_group }}'
instance_type: '{{ instance }}'
image: '{{ image }}'
region: '{{ region }}'
vpc_subnet_id: '{{ subnet }}'
user_data: "{{ item }}"
instance_profile_name: 'access-to-s3'
instance_tags:
origin: "{{ origin }}"
environment_name: "{{ environment_name }}"
stack_id: "{{ stack_id }}"
owner_id: "{{ owner_id }} "
role: "{{ item }}"
timestamp: "{{ timestamp }}"
with_items: server_roles
register: ec2
Facts
- name: Set the facts and hostnames
hosts: all_hosts
connection: ssh
gather_facts: True
max_fail_percentage: 0
tasks:
- name: Gather EC2 facts
ec2_facts:
- name: Set environment fact
set_fact: this_environment="{{ ansible_ec2_user_data }}"
- name: Set hostnames
hostname: name="{{ environment_name }}-{{ this_environment }}"
route53
route53:
command: create
zone: backbase.dev
private_zone: yes
overwrite: yes
record: "{{ environment_name }}-{{ item.0 }}.backbase.dev"
type: A
ttl: 10
value: "{{ item.1.instances[0].private_ip }}"
with_together:
- server_roles
- ec2.results
register: r53_result
until: r53_result|success
retries: 20
delay: "{{ 10 |random }}"
Jinja2 templates
{% block portal_db %}{% endblock %}
{% if http_or_https == 'http' %}
{% set port = http_port %}
{% else %}
{% set port = https_port %}
{% endif %}
{% if this_environment == "editorial" %}
foundation.environment.editorial=true
{% else %}
foundation.environment.editorial=false
{% endif %}
foundation.content.proxy.destination={{ http_or_https }}://{{ environment_name }}-{{
this_environment }}.backbase.dev:{{ port }}/contentservices
wait_for
- name: Start WSLC
shell: /opt/IBM/Websphere/INIT.websphere start {{ this_environment }}
- name: Wait for WSLC to start
wait_for: path=“/opt/IBM/Websphere/usr/servers/{{ this_environment }}/logs/console.log”
search_regex=“The server {{ this_environment }} is ready to run a smarter planet.”
timeout=30"
- name: Run the trigger
shell: /opt/install/app_start_trigger.sh &> /opt/install/app_start_trigger.log; sleep 2
- name: Wait for all apps to start
wait_for:
path="/opt/IBM/Websphere/usr/servers/{{ this_environment }}/logs/messages.log"
search_regex="SRVE0242I: [portalserver] [/portalserver] [/WEB-INF/index.jsp]:
Initialization successful."
timeout=600
Recovering from failure
- name: Download CXP
shell: s3cmd get s3://s3_bucket_here/Backbase_Portal_5.6.0-{{ version }}.zip
/opt/install/portal-package-5.6.0-{{ version }}.zip --force 2>&1 | tee
/opt/install/direct_loader.log
register: cxp_download_sleeper
until: cxp_download_sleeper.stdout.find("saved as") != -1
retries: 10
delay: "{{ 10 | random }}"
API
• /api/stacks - GET - List stacks available for provisioning
• /api/stacks/stack_name - GET - List the stack configuration
• /api/environments - GET - List all currently provisioned
environments
• /api/stacks/stack_name - POST - Provision specified stack
• /api/environments/environment_id - DELETE - Destroy
environment with specified id
• /api/environments/all - DELETE - Destroy all environments
Infrastructure life cycle
• Create
• Check if the user is valid
• Parse the requested configurarion
• Generate unique environment name
• Trigger Ansible run
• Return environment name
• Destroy
• Check if requested environment exists
• Check if the user can destroy this environment
• Delete environment and clean everything up (DNS, ELB, etc.)
REST Service demo
• Create a set of instances
• Destroy them
Current UI :)
Ansible testing
• No way to test playbook without applying it
• Currently there’s a quick sanity test suite
• We do testing every commit for a selected number of stacks
Demo
• Stash
• Feature branches
• Ansible testing pipeline
Results
• 14-40 minutes to provision and fully configure environments
• From 1 stack to 10 stacks automated testing (~25 soon)
• We continuously improve to make a robust process
Continuous Delivery
without Production
Goals for Continuous Delivery
• Create a repeatable and robust process
• Treat all configurations identically
• Some are more important of course
• Provide feedback as soon as possible
• For now – in the morning
• Provide feedback for feature branches
• Release tested artifacts more frequently
• For now – every iteration
Stages for Continuous Delivery
• Components are built
• Unit and integration tests
• Main application is build and packaged
• Published to Artifactory and s3
• Testing pipeline is triggered
• Environments are created
• Sanity tests, API tests, Functional tests, etc. are run
• Notification is sent in case of any test failure
• Environments are disposed
Continuous Delivery diagram
Build
components
Package
Provision
Stack1
API Tests E2E Tests … Dispose
Provision
Stack 2
API Tests E2E Tests … Dispose
Provision
Stack 3
API Tests E2E Tests … Dispose
… … … … …
Provision
Stack 10
API Tests E2E Tests … Dispose
More pipelines…
• Performance tests pipeline
• Feature branches
• Security tests
• Earlier versions of the applications
• Bugfix releases
• More applications
Achievements
• Huge quality improvements
• Numerous bugs were found in the ‘rare’ stacks
• Regressions are found during the night
• Minimum cycle time is 1h 30m, maximum – 2h 30m
• Dozens environments are created every day
• Repeatable process allows to identify instabilities in tests and
configurations
Closing thoughts
Zero downtime deployments
Future
• Asynchronous provisioning
• Ansible roles?
• Optimization (time)
• Pre-baked images
• Docker containers
• Plugins to help our specific needs
Ansible v2
• Blocks
• begin
• rescue
• always
• Execution strategy – linear vs free (or anything else)
• Execution time include evaluation (with*)
• Better variable management
Key takeaways
• Use Ansible – it’s a great tool :)
• Think about immutable infrastructure
• Create repeatable and reliable process
for releasing software
• Build quality in
• Improve continuously
pavel@levi9.com
@PavelChunyayev
Any questions?

Mais conteúdo relacionado

Mais procurados

CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsMike North
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSCGian Maria Ricci
 
Spring Boot
Spring BootSpring Boot
Spring Bootgedoplan
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applicationsSunil Dalal
 
NC Wisconsin SuperVMUG 2019 Tools and Tips
NC Wisconsin SuperVMUG 2019 Tools and TipsNC Wisconsin SuperVMUG 2019 Tools and Tips
NC Wisconsin SuperVMUG 2019 Tools and TipsAnthony Hook
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web FrameworksJoe Kutner
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performanceMike North
 
Five Years of EC2 Distilled
Five Years of EC2 DistilledFive Years of EC2 Distilled
Five Years of EC2 DistilledGrig Gheorghiu
 
Validating latest changes with XCI
Validating latest changes with XCIValidating latest changes with XCI
Validating latest changes with XCIVictor Morales
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure FunctionsAndreas Willich
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksGoDataDriven
 
Developing Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDeveloping Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDustin Ruehle
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Thomas Lee
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideMohanraj Thirumoorthy
 

Mais procurados (20)

CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page Apps
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Heroku
HerokuHeroku
Heroku
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSC
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
PP_Eric_Gandt
PP_Eric_GandtPP_Eric_Gandt
PP_Eric_Gandt
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
NC Wisconsin SuperVMUG 2019 Tools and Tips
NC Wisconsin SuperVMUG 2019 Tools and TipsNC Wisconsin SuperVMUG 2019 Tools and Tips
NC Wisconsin SuperVMUG 2019 Tools and Tips
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performance
 
Five Years of EC2 Distilled
Five Years of EC2 DistilledFive Years of EC2 Distilled
Five Years of EC2 Distilled
 
Validating latest changes with XCI
Validating latest changes with XCIValidating latest changes with XCI
Validating latest changes with XCI
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
 
JustLetMeCode-Final
JustLetMeCode-FinalJustLetMeCode-Final
JustLetMeCode-Final
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure Databricks
 
Developing Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDeveloping Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring Cloud
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012
 
Legacy Sins
Legacy SinsLegacy Sins
Legacy Sins
 
Developing Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's GuideDeveloping Microservices using Spring - Beginner's Guide
Developing Microservices using Spring - Beginner's Guide
 

Semelhante a How Ansible helps Backbase achieve Continuous Delivery without downtime

Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsAnthony D Hendricks
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeSarah Z
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java3Pillar Global
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileAmazon Web Services Japan
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as CodeAllan Shone
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukLohika_Odessa_TechTalks
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)DECK36
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolutionWise Engineering
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…Sergey Dzyuban
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...NGINX, Inc.
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfNCCOMMS
 

Semelhante a How Ansible helps Backbase achieve Continuous Delivery without downtime (20)

Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shells
 
Ansible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less CoffeeAnsible: How to Get More Sleep and Require Less Coffee
Ansible: How to Get More Sleep and Require Less Coffee
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Managing Infrastructure as Code
Managing Infrastructure as CodeManaging Infrastructure as Code
Managing Infrastructure as Code
 
Hosting Ruby Web Apps
Hosting Ruby Web AppsHosting Ruby Web Apps
Hosting Ruby Web Apps
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys Serdiuk
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
ITB2017 - Keynote
ITB2017 - KeynoteITB2017 - Keynote
ITB2017 - Keynote
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 

Mais de Pavel Chunyayev

Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...
Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...
Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...Pavel Chunyayev
 
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017Pavel Chunyayev
 
#nostaging - Software Circus - Amsterdam, 2-9-2016
#nostaging - Software Circus - Amsterdam, 2-9-2016#nostaging - Software Circus - Amsterdam, 2-9-2016
#nostaging - Software Circus - Amsterdam, 2-9-2016Pavel Chunyayev
 
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...Pavel Chunyayev
 
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016Pavel Chunyayev
 
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, Utrecht
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, UtrechtWant Continuous Delivery? Give testing a priority! 16-6-2016, Friss, Utrecht
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, UtrechtPavel Chunyayev
 
Versioning schemes and branching models for Continuous Delivery - Continuous ...
Versioning schemes and branching models for Continuous Delivery - Continuous ...Versioning schemes and branching models for Continuous Delivery - Continuous ...
Versioning schemes and branching models for Continuous Delivery - Continuous ...Pavel Chunyayev
 
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015Pavel Chunyayev
 
Arch9 - A cloud based continuous delivery implementation
Arch9 - A cloud based continuous delivery implementationArch9 - A cloud based continuous delivery implementation
Arch9 - A cloud based continuous delivery implementationPavel Chunyayev
 
State of continuous delivery in 2015 - Minsk 15-5-2015
State of continuous delivery in 2015 - Minsk 15-5-2015State of continuous delivery in 2015 - Minsk 15-5-2015
State of continuous delivery in 2015 - Minsk 15-5-2015Pavel Chunyayev
 

Mais de Pavel Chunyayev (10)

Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...
Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...
Experiment and validate business ideas - Talk outline at DevOps Showcase Amst...
 
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017
Lifecycle of a microservices application - Iasi, Levi9 meetup - 28-6-2017
 
#nostaging - Software Circus - Amsterdam, 2-9-2016
#nostaging - Software Circus - Amsterdam, 2-9-2016#nostaging - Software Circus - Amsterdam, 2-9-2016
#nostaging - Software Circus - Amsterdam, 2-9-2016
 
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...
Continuous Feedback from Testing - Continuous Delivery meetup - Amsterdam, 14...
 
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016
Lean part of DevOps - DevOps Amsterdam meetup - 17-8-2016
 
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, Utrecht
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, UtrechtWant Continuous Delivery? Give testing a priority! 16-6-2016, Friss, Utrecht
Want Continuous Delivery? Give testing a priority! 16-6-2016, Friss, Utrecht
 
Versioning schemes and branching models for Continuous Delivery - Continuous ...
Versioning schemes and branching models for Continuous Delivery - Continuous ...Versioning schemes and branching models for Continuous Delivery - Continuous ...
Versioning schemes and branching models for Continuous Delivery - Continuous ...
 
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015
DevOpsDays Ignite - Immutable infrastructure - Amsterdam 24-5-2015
 
Arch9 - A cloud based continuous delivery implementation
Arch9 - A cloud based continuous delivery implementationArch9 - A cloud based continuous delivery implementation
Arch9 - A cloud based continuous delivery implementation
 
State of continuous delivery in 2015 - Minsk 15-5-2015
State of continuous delivery in 2015 - Minsk 15-5-2015State of continuous delivery in 2015 - Minsk 15-5-2015
State of continuous delivery in 2015 - Minsk 15-5-2015
 

Último

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Último (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

How Ansible helps Backbase achieve Continuous Delivery without downtime

  • 1. How Ansible helps Backbase Ansible Benelux meetup Pavel Chunyayev Amsterdam, 27-5-2015
  • 2. Who am I • Come from Ukraine • 11 years in IT • Worked in Ukraine, Estonia and the Netherlands • Continuous Delivery architect at Levi9 IT Services • Last 6 months - Automation architect at Backbase
  • 4. Backbase Customer Experience Platform • Core services • Content services • Publication services • 3 environments – Editorial, Staging, Live
  • 5. Different configuration options • Java version • Application Server • RDBMS • HTTP/HTTPS • Internal configuration options • Optional application features
  • 6. A lot of things are already automated • There are servers for released CXP version • With different configurations • They can be started/stopped when needed • Newest version of the application needs to be deployed. • In most cases manually. • For some configurations deployment required repackaging of the application. • Automated through maven • There is a sandbox environment with the nightly build • Deployed automatically • Far from production setup
  • 7. Handcrafted servers • Hard to maintain • Very time/cost sensitive • Setup is not easily reproducible • May be buggy • It should take less time to rebuild a server from the scratch than to log in and fix/update it.
  • 10. Why Ansible • Python powered • No master, agentless • Free, open source • Plenty of modules (batteries included) • Great EC2 support • Windows support (kind of) • Parallel, but controllable execution • Quite simple for developer to understand
  • 11. Why REST service • Create infrastructure easily • Just send JSON formatted configuration • Service will analyze it and trigger Ansible run • Service is the single point of contact for any infrastructure requests • Can be integrated into any CI, script, application or other service
  • 12. Why UI • Everyone needs to create an environment from time to time • Opening a ticket and then waiting is not an option • In most situations environments are required for a short period of time. • Self-service
  • 13. Demo • Directory structure • Flow of work • Decision tree
  • 14. Ansible features we are using • Handlers • Variables • Jinja2 templates • Facts • Conditions • Playbook includes • Inventory (fake) – hostgroups! • Roles :(
  • 15. ec2 ec2: key_name: '{{ keypair }}' group_id: '{{ security_group }}' instance_type: '{{ instance }}' image: '{{ image }}' region: '{{ region }}' vpc_subnet_id: '{{ subnet }}' user_data: "{{ item }}" instance_profile_name: 'access-to-s3' instance_tags: origin: "{{ origin }}" environment_name: "{{ environment_name }}" stack_id: "{{ stack_id }}" owner_id: "{{ owner_id }} " role: "{{ item }}" timestamp: "{{ timestamp }}" with_items: server_roles register: ec2
  • 16. Facts - name: Set the facts and hostnames hosts: all_hosts connection: ssh gather_facts: True max_fail_percentage: 0 tasks: - name: Gather EC2 facts ec2_facts: - name: Set environment fact set_fact: this_environment="{{ ansible_ec2_user_data }}" - name: Set hostnames hostname: name="{{ environment_name }}-{{ this_environment }}"
  • 17. route53 route53: command: create zone: backbase.dev private_zone: yes overwrite: yes record: "{{ environment_name }}-{{ item.0 }}.backbase.dev" type: A ttl: 10 value: "{{ item.1.instances[0].private_ip }}" with_together: - server_roles - ec2.results register: r53_result until: r53_result|success retries: 20 delay: "{{ 10 |random }}"
  • 18. Jinja2 templates {% block portal_db %}{% endblock %} {% if http_or_https == 'http' %} {% set port = http_port %} {% else %} {% set port = https_port %} {% endif %} {% if this_environment == "editorial" %} foundation.environment.editorial=true {% else %} foundation.environment.editorial=false {% endif %} foundation.content.proxy.destination={{ http_or_https }}://{{ environment_name }}-{{ this_environment }}.backbase.dev:{{ port }}/contentservices
  • 19. wait_for - name: Start WSLC shell: /opt/IBM/Websphere/INIT.websphere start {{ this_environment }} - name: Wait for WSLC to start wait_for: path=“/opt/IBM/Websphere/usr/servers/{{ this_environment }}/logs/console.log” search_regex=“The server {{ this_environment }} is ready to run a smarter planet.” timeout=30" - name: Run the trigger shell: /opt/install/app_start_trigger.sh &> /opt/install/app_start_trigger.log; sleep 2 - name: Wait for all apps to start wait_for: path="/opt/IBM/Websphere/usr/servers/{{ this_environment }}/logs/messages.log" search_regex="SRVE0242I: [portalserver] [/portalserver] [/WEB-INF/index.jsp]: Initialization successful." timeout=600
  • 20. Recovering from failure - name: Download CXP shell: s3cmd get s3://s3_bucket_here/Backbase_Portal_5.6.0-{{ version }}.zip /opt/install/portal-package-5.6.0-{{ version }}.zip --force 2>&1 | tee /opt/install/direct_loader.log register: cxp_download_sleeper until: cxp_download_sleeper.stdout.find("saved as") != -1 retries: 10 delay: "{{ 10 | random }}"
  • 21. API • /api/stacks - GET - List stacks available for provisioning • /api/stacks/stack_name - GET - List the stack configuration • /api/environments - GET - List all currently provisioned environments • /api/stacks/stack_name - POST - Provision specified stack • /api/environments/environment_id - DELETE - Destroy environment with specified id • /api/environments/all - DELETE - Destroy all environments
  • 22. Infrastructure life cycle • Create • Check if the user is valid • Parse the requested configurarion • Generate unique environment name • Trigger Ansible run • Return environment name • Destroy • Check if requested environment exists • Check if the user can destroy this environment • Delete environment and clean everything up (DNS, ELB, etc.)
  • 23. REST Service demo • Create a set of instances • Destroy them
  • 25. Ansible testing • No way to test playbook without applying it • Currently there’s a quick sanity test suite • We do testing every commit for a selected number of stacks
  • 26. Demo • Stash • Feature branches • Ansible testing pipeline
  • 27. Results • 14-40 minutes to provision and fully configure environments • From 1 stack to 10 stacks automated testing (~25 soon) • We continuously improve to make a robust process
  • 29. Goals for Continuous Delivery • Create a repeatable and robust process • Treat all configurations identically • Some are more important of course • Provide feedback as soon as possible • For now – in the morning • Provide feedback for feature branches • Release tested artifacts more frequently • For now – every iteration
  • 30. Stages for Continuous Delivery • Components are built • Unit and integration tests • Main application is build and packaged • Published to Artifactory and s3 • Testing pipeline is triggered • Environments are created • Sanity tests, API tests, Functional tests, etc. are run • Notification is sent in case of any test failure • Environments are disposed
  • 31. Continuous Delivery diagram Build components Package Provision Stack1 API Tests E2E Tests … Dispose Provision Stack 2 API Tests E2E Tests … Dispose Provision Stack 3 API Tests E2E Tests … Dispose … … … … … Provision Stack 10 API Tests E2E Tests … Dispose
  • 32. More pipelines… • Performance tests pipeline • Feature branches • Security tests • Earlier versions of the applications • Bugfix releases • More applications
  • 33. Achievements • Huge quality improvements • Numerous bugs were found in the ‘rare’ stacks • Regressions are found during the night • Minimum cycle time is 1h 30m, maximum – 2h 30m • Dozens environments are created every day • Repeatable process allows to identify instabilities in tests and configurations
  • 36. Future • Asynchronous provisioning • Ansible roles? • Optimization (time) • Pre-baked images • Docker containers • Plugins to help our specific needs
  • 37. Ansible v2 • Blocks • begin • rescue • always • Execution strategy – linear vs free (or anything else) • Execution time include evaluation (with*) • Better variable management
  • 38. Key takeaways • Use Ansible – it’s a great tool :) • Think about immutable infrastructure • Create repeatable and reliable process for releasing software • Build quality in • Improve continuously pavel@levi9.com @PavelChunyayev Any questions?