Great external coverage of this presentation can be found at https://www.cedric-meury.ch/2016/10/test-driven-infrastructure-with-puppet-docker-test-kitchen-and-serverspec-yury-tsarev-gooddata/
Deploying On-Prem as SaaS: Why we go with AnsibleMartin Etmajer
How do you deploy a traditional on-premise solution as Software as a Service? Here, I am presenting architectural decisions and challenges faced in building and maturing an orchestration service for automating and managing deployments of Dynatrace, an application monitoring solution at enterprise scale, into Amazon's AWS cloud.
The focus of this presentation is on our experiences with Ansible, a radically simple, yet powerful, IT automation tool, whose agentless architecture and extensive modules library greatly simplified cloud service orchestration and integration of our solution with customer applications. Besides, automated testing of our deployment scripts with Test Kitchen and serverspec is discussed.
Hadoop Summit 2013 : Continuous Integration on top of hadoopWisely chen
Wisely Chen and Neal Lee presented on continuous integration on Hadoop. They discussed automating the software development process, including automatically running unit tests on code commits, performing tests on staging environments that mimic production, and deploying to production. They demonstrated tools for unit testing Hadoop jobs, including PigUnit and Vaidya for performance diagnosis, and how these tools can integrate with a continuous integration system to automatically run tests with each code change.
Shows an excerpt of the PERFORM 2014 Conference's Hands-On Training on Automated Deployments. Tells the why and the how and differentiates between agent-based and agentless solutions, such as Chef, Puppet or Ansible. Goes into greater detail on the Ansible host automation tool.
In this advanced session, we will investigate all the ways that you can automate your testing processes with TestBox and many CI and automation tools. From Jenkins integration, Travis CI, Node runners, Grunt watchers and much more. This session will show you the value of continuous integration and how to apply it with modern tools and technologies.
Main Points
Why we want to automate
Continuous Integration
ANT/CommandBox Test Runner
Setup of a Jenkins CI server
Travis CI integration
Pipelines CI integration
Node TestBox Runners
Grunt Watchers and Browser Live Reloads
Introduction to Automated Deployments with AnsibleMartin Etmajer
An introduction to Automated Deployments and their relevance in Continuous Delivery. Explains the most important concepts of the Ansible Deployment Automation tool using simple examples.
The document summarizes the changes that have occurred in system administration over time. It discusses how software delivery has shifted from CDs/DVDs to online and continuous delivery. Infrastructure deployment has evolved from manual installations to tools enabling reproducible deployments. Virtualization became common in the 2000s. Infrastructure as code principles including treating infrastructure configuration as code, versioning, and testing best practices are discussed. Monitoring has shifted from tools like BigBrother to Nagios and newer solutions. Emerging technologies like Docker, Packer, orchestration tools, and metrics/monitoring are also summarized.
The document summarizes 7 tools for a devops stack:
1) Automation tools like Puppet, Chef, and Jenkins are used to automate deployments and configurations.
2) The Marionette Collective allows orchestrating tasks across servers like checking statuses and restarting services.
3) FPM helps create software packages to address issues with packaging dependencies and versions.
4) Logstash is used for centralized logging and shipping logs anywhere while filtering and indexing them.
5) Graphite and Kibana provide visualization and graphing of metrics at scale for monitoring.
My last talk at DevTernity conference. It was about anti patterns captured consulting several projects on their DevOps adoption. There are few common pitfalls we can see repeating again and again over DevOps culture discovery. This talk is my experience summary there
The document discusses challenges with deploying a SaaS platform on-premises for customers. It notes that automation and tools developed for internal use may not work well for external customers due to different constraints around access, networking, security policies and variability between customer environments. Deploying on-premises requires implementing customizations for each unique customer setup, reduces ability to easily fix issues, and significantly increases costs compared to hosting in one's own infrastructure. The document recommends choosing a SaaS model over on-premises if possible to avoid these challenges.
This document discusses deploying software at scale through automation. It advocates treating infrastructure as code and using version control, continuous integration, and packaging tools. The key steps are to automate deployments, make them reproducible, and deploy changes frequently and consistently through a pipeline that checks code, runs tests, builds packages, and deploys to testing and production environments. This allows deploying changes safely and quickly while improving collaboration between developers and operations teams.
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014Puppet
The document outlines seven habits of highly effective Puppet users: 1) think like a software developer by applying software engineering principles to Puppet code; 2) treat Puppet like code by using version control, documentation, code reviews, and linting; 3) stop and design infrastructure by separating concerns, using roles and profiles, and data separation; 4) test all infrastructure code using unit, integration, and acceptance tests; 5) implement continuous integration and deployment with automated testing across versions; 6) learn Ruby as Puppet is built with Ruby; and 7) get involved in the open source Puppet community.
This document discusses continuous integration (CI) and why it should be used. It defines CI as applying quality control through small, frequent changes. The benefits discussed are direct feedback on deployability, control when releasing to production, and the ability to continue developing while automated tests run. It provides an example workflow of how CI is used with Git, a test/acceptance/production environment, and Jenkins to run automated jobs on commits. Future improvements mentioned are improving feature testing, automated rollbacks, and monitoring downtime.
11 Tools for your Open Source devops stack Kris Buytaert
11 Tools for your devops stack
- Devops is a growing movement to break down barriers between development and operations teams. It promotes automation, measurement, and sharing.
- Popular tools include Jenkins for continuous integration, FPM for packaging, Logstash for log collection, Graphite for metrics collection and visualization, Puppet/Chef for configuration management, and Vagrant for portable development environments.
- Other tools like MCollective and friends help with distributed automation tasks like checking server statuses or package versions across many servers.
Pipeline as code for your infrastructure as CodeKris Buytaert
This document discusses infrastructure as code (IAC) and continuous delivery pipelines. It introduces Puppet as an open-source configuration management tool for defining infrastructure as code. It emphasizes treating infrastructure configuration like code by versioning it, testing it, and promoting changes through environments like development, test, and production. The document also discusses using Jenkins for continuous integration to test application and infrastructure code changes and building automated pipelines for packaging and deploying changes.
Kris Buytaert gave a talk on open source monitoring tools. He discussed how monitoring used to be an afterthought but new tools now focus on automation and integration. Popular modern tools like Prometheus focus on metrics collection and short-term storage while shipping long-term data to systems like Graphite. Prometheus excels at containerized environments through scraping but can also monitor other systems. Visualization and alerting have many options like Grafana, Icinga, and AlertManager. The landscape continues evolving towards full observability of applications and services.
Automating MySQL operations with PuppetKris Buytaert
This document summarizes a presentation about automating MySQL operations with Puppet. It discusses:
- Why automation is important for consistency, security, and disaster recovery. Manual changes can introduce bugs and inconsistencies.
- Puppet is an open source configuration management tool that can be used to automate MySQL configuration, users, backups, replication, and high availability clustering with tools like Corosync/Pacemaker.
- Puppet modules define the desired state and Puppet ensures the actual state matches by making necessary changes. This provides auditability and change tracking through version control of Puppet code.
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Puppet
This document provides an overview of testing Puppet modules using Beaker and related tools. It demonstrates generating a test Puppet module, installing necessary tools like Bundler and the Puppet module skeleton, and running the initial tests. The document recommends further resources for learning more about Beaker and testing Puppet code.
Continuous Integration (CI) is a software development practice where developers regularly merge their work into a central repository. This allows for automated builds and tests which catch errors early. CI helps reduce integration problems, improves code quality, and allows for more frequent deployments. The document discusses implementing CI with tools like Jenkins, build scripts, unit testing, code analysis, and notifications to improve the development process.
Principles and Practices in Continuous Deployment at EtsyMike Brittain
This document discusses principles and practices of continuous deployment at Etsy. It describes how Etsy moved from deploying code changes every 2-3 weeks with stressful release processes, to deploying over 30 times per day. The key principles that enabled this are innovating continuously, resolving scaling issues quickly, minimizing recovery time from failures, and prioritizing employee well-being over stressful releases. Automated testing, deployment to staging environments, dark launches, and extensive monitoring allow for frequent, low-risk deployments to production.
Kris Buytaert discusses how they used Vagrant, Puppet, and other tools to improve their Puppet development and testing workflow. Some key points:
- Vagrant allows creating reproducible development environments for Puppet code.
- Puppet style guides help write more readable manifests. Tools like Puppet Lint can validate style.
- Testing Puppet code with rspec-puppet, cucumber-puppet, and other tools helps prevent errors.
- Using Git, GitHub, and Git flow practices helps manage Puppet modules in version control.
- Jenkins can automate building, testing, and deploying Puppet code and modules.
- Demonstr
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016Gavin Pickin
Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
That's great, but how do we test it? In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet).
So how do I write unit tests, what units are there, and how do I make my code look like that? JavaScript is a flexible language, and with great flexibility comes great complexity and responsibility. Take your JavaScript spaghetti and make it unit testable.
Attendees should have some exposure to JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.
This document discusses building automated acceptance tests that are stable and maintainable for continuous delivery. It emphasizes that developers should own acceptance testing by writing tests in the same way they write production code. This includes writing many unit and regression tests, optimizing for test execution, using immutable environments like Docker for isolation, and leveraging techniques like parallelization and separation of concerns with domain-specific languages. The document also provides examples of testing strategies, tools, and processes that can help achieve this goal.
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
One of the challenges facing Telepresence is growing the contributor community. It’s a complex application that requires a good understanding of OS networking, VPNs, Kubernetes, and everything in between. We’ll kick off this meeting with a general architectural overview of Telepresence. We’ll talk about how we’ve managed the project to date, and our investments to make it easier. We want to then turn it over for an interactive discussion with participants to see what we can do to make it easier to contribute and grow the Telepresence community.
This document discusses DevOps test-driven development (TDD). It introduces DevOps and TDD concepts and practices. It provides an example of using a Node.js test framework and API testing to implement TDD for a login feature. The document emphasizes that TDD is about designing better code through testing rather than just writing tests. It also discusses using continuous integration/delivery (CI/CD) pipelines to automatically run tests on code changes.
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecMartin Etmajer
The goal of Continuous Delivery is, briefly, to get features into your users' or customers' hands as quickly and confidently as possible. In order to succeed, Development and Operations teams need to align and come up with both working and deployable software in short, regular intervals. Chef, Puppet, Ansible & Co. enable teams to code up application runtime environments, but alone do not allow for building quality into their processes. In this presentation I will show how you can apply the "Red, Green, Refactor Cycle" of Test-Driven Development and combine it with your configuration management or orchestration tool of choice in order to come up with better infrastructure that can automatically be tested using Puppet, Test Kitchen, Docker, Serverspec and RSpec.
Comparing Agile QA Approaches to End-to-End TestingKatie Chin
The document compares agile QA approaches like end-to-end testing and discusses how Quid uses both Selenium and RainforestQA for testing. It notes that while Selenium allows for fast automated testing, it is tied to the frontend implementation. RainforestQA uses human testers which is easier to maintain but slower. For complex products like Quid, RainforestQA has scaled testing better and freed up engineer time for more exploratory testing.
Taking AppSec to 11 - BSides Austin 2016Matt Tesauro
This document summarizes Matt Tesauro's presentation "Taking AppSec to 11" given at Bsidess Austin 2016. The presentation discusses implementing application security (AppSec) pipelines to improve workflows and optimize critical resources like AppSec personnel. Key points include automating repetitive tasks, driving consistency, increasing visibility and metrics, and reducing friction between development and AppSec teams. An AppSec pipeline provides a reusable and consistent process for security activities to follow through intake, testing, and reporting stages. The goal is to optimize people's time spent on customization and analysis rather than setup and configuration.
The document discusses the history and evolution of DevOps practices over time, from concepts like daily builds in the 1990s to more recent approaches like infrastructure as code and serverless architectures. It provides an overview of key figures and texts that helped establish ideas like continuous integration, continuous delivery, and site reliability engineering. The document also shares the author's perspective on what commercial security tools have been developed for DevOps workflows and mentions some open source collaboration and automation tools.
My last talk at DevTernity conference. It was about anti patterns captured consulting several projects on their DevOps adoption. There are few common pitfalls we can see repeating again and again over DevOps culture discovery. This talk is my experience summary there
The document discusses challenges with deploying a SaaS platform on-premises for customers. It notes that automation and tools developed for internal use may not work well for external customers due to different constraints around access, networking, security policies and variability between customer environments. Deploying on-premises requires implementing customizations for each unique customer setup, reduces ability to easily fix issues, and significantly increases costs compared to hosting in one's own infrastructure. The document recommends choosing a SaaS model over on-premises if possible to avoid these challenges.
This document discusses deploying software at scale through automation. It advocates treating infrastructure as code and using version control, continuous integration, and packaging tools. The key steps are to automate deployments, make them reproducible, and deploy changes frequently and consistently through a pipeline that checks code, runs tests, builds packages, and deploys to testing and production environments. This allows deploying changes safely and quickly while improving collaboration between developers and operations teams.
The Seven Habits of Highly Effective Puppet Users - PuppetConf 2014Puppet
The document outlines seven habits of highly effective Puppet users: 1) think like a software developer by applying software engineering principles to Puppet code; 2) treat Puppet like code by using version control, documentation, code reviews, and linting; 3) stop and design infrastructure by separating concerns, using roles and profiles, and data separation; 4) test all infrastructure code using unit, integration, and acceptance tests; 5) implement continuous integration and deployment with automated testing across versions; 6) learn Ruby as Puppet is built with Ruby; and 7) get involved in the open source Puppet community.
This document discusses continuous integration (CI) and why it should be used. It defines CI as applying quality control through small, frequent changes. The benefits discussed are direct feedback on deployability, control when releasing to production, and the ability to continue developing while automated tests run. It provides an example workflow of how CI is used with Git, a test/acceptance/production environment, and Jenkins to run automated jobs on commits. Future improvements mentioned are improving feature testing, automated rollbacks, and monitoring downtime.
11 Tools for your Open Source devops stack Kris Buytaert
11 Tools for your devops stack
- Devops is a growing movement to break down barriers between development and operations teams. It promotes automation, measurement, and sharing.
- Popular tools include Jenkins for continuous integration, FPM for packaging, Logstash for log collection, Graphite for metrics collection and visualization, Puppet/Chef for configuration management, and Vagrant for portable development environments.
- Other tools like MCollective and friends help with distributed automation tasks like checking server statuses or package versions across many servers.
Pipeline as code for your infrastructure as CodeKris Buytaert
This document discusses infrastructure as code (IAC) and continuous delivery pipelines. It introduces Puppet as an open-source configuration management tool for defining infrastructure as code. It emphasizes treating infrastructure configuration like code by versioning it, testing it, and promoting changes through environments like development, test, and production. The document also discusses using Jenkins for continuous integration to test application and infrastructure code changes and building automated pipelines for packaging and deploying changes.
Kris Buytaert gave a talk on open source monitoring tools. He discussed how monitoring used to be an afterthought but new tools now focus on automation and integration. Popular modern tools like Prometheus focus on metrics collection and short-term storage while shipping long-term data to systems like Graphite. Prometheus excels at containerized environments through scraping but can also monitor other systems. Visualization and alerting have many options like Grafana, Icinga, and AlertManager. The landscape continues evolving towards full observability of applications and services.
Automating MySQL operations with PuppetKris Buytaert
This document summarizes a presentation about automating MySQL operations with Puppet. It discusses:
- Why automation is important for consistency, security, and disaster recovery. Manual changes can introduce bugs and inconsistencies.
- Puppet is an open source configuration management tool that can be used to automate MySQL configuration, users, backups, replication, and high availability clustering with tools like Corosync/Pacemaker.
- Puppet modules define the desired state and Puppet ensures the actual state matches by making necessary changes. This provides auditability and change tracking through version control of Puppet code.
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Puppet
This document provides an overview of testing Puppet modules using Beaker and related tools. It demonstrates generating a test Puppet module, installing necessary tools like Bundler and the Puppet module skeleton, and running the initial tests. The document recommends further resources for learning more about Beaker and testing Puppet code.
Continuous Integration (CI) is a software development practice where developers regularly merge their work into a central repository. This allows for automated builds and tests which catch errors early. CI helps reduce integration problems, improves code quality, and allows for more frequent deployments. The document discusses implementing CI with tools like Jenkins, build scripts, unit testing, code analysis, and notifications to improve the development process.
Principles and Practices in Continuous Deployment at EtsyMike Brittain
This document discusses principles and practices of continuous deployment at Etsy. It describes how Etsy moved from deploying code changes every 2-3 weeks with stressful release processes, to deploying over 30 times per day. The key principles that enabled this are innovating continuously, resolving scaling issues quickly, minimizing recovery time from failures, and prioritizing employee well-being over stressful releases. Automated testing, deployment to staging environments, dark launches, and extensive monitoring allow for frequent, low-risk deployments to production.
Kris Buytaert discusses how they used Vagrant, Puppet, and other tools to improve their Puppet development and testing workflow. Some key points:
- Vagrant allows creating reproducible development environments for Puppet code.
- Puppet style guides help write more readable manifests. Tools like Puppet Lint can validate style.
- Testing Puppet code with rspec-puppet, cucumber-puppet, and other tools helps prevent errors.
- Using Git, GitHub, and Git flow practices helps manage Puppet modules in version control.
- Jenkins can automate building, testing, and deploying Puppet code and modules.
- Demonstr
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016Gavin Pickin
Everyone who wasn't writing JavaScript, probably is now. Atwood's Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
That's great, but how do we test it? In ColdFusion we have CFCs, most languages have classes... but JavaScript doesn't have classes (yet).
So how do I write unit tests, what units are there, and how do I make my code look like that? JavaScript is a flexible language, and with great flexibility comes great complexity and responsibility. Take your JavaScript spaghetti and make it unit testable.
Attendees should have some exposure to JavaScript, but this is for the Professional Newbie... who always needs to learn and adapt.
This document discusses building automated acceptance tests that are stable and maintainable for continuous delivery. It emphasizes that developers should own acceptance testing by writing tests in the same way they write production code. This includes writing many unit and regression tests, optimizing for test execution, using immutable environments like Docker for isolation, and leveraging techniques like parallelization and separation of concerns with domain-specific languages. The document also provides examples of testing strategies, tools, and processes that can help achieve this goal.
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
One of the challenges facing Telepresence is growing the contributor community. It’s a complex application that requires a good understanding of OS networking, VPNs, Kubernetes, and everything in between. We’ll kick off this meeting with a general architectural overview of Telepresence. We’ll talk about how we’ve managed the project to date, and our investments to make it easier. We want to then turn it over for an interactive discussion with participants to see what we can do to make it easier to contribute and grow the Telepresence community.
This document discusses DevOps test-driven development (TDD). It introduces DevOps and TDD concepts and practices. It provides an example of using a Node.js test framework and API testing to implement TDD for a login feature. The document emphasizes that TDD is about designing better code through testing rather than just writing tests. It also discusses using continuous integration/delivery (CI/CD) pipelines to automatically run tests on code changes.
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecMartin Etmajer
The goal of Continuous Delivery is, briefly, to get features into your users' or customers' hands as quickly and confidently as possible. In order to succeed, Development and Operations teams need to align and come up with both working and deployable software in short, regular intervals. Chef, Puppet, Ansible & Co. enable teams to code up application runtime environments, but alone do not allow for building quality into their processes. In this presentation I will show how you can apply the "Red, Green, Refactor Cycle" of Test-Driven Development and combine it with your configuration management or orchestration tool of choice in order to come up with better infrastructure that can automatically be tested using Puppet, Test Kitchen, Docker, Serverspec and RSpec.
Comparing Agile QA Approaches to End-to-End TestingKatie Chin
The document compares agile QA approaches like end-to-end testing and discusses how Quid uses both Selenium and RainforestQA for testing. It notes that while Selenium allows for fast automated testing, it is tied to the frontend implementation. RainforestQA uses human testers which is easier to maintain but slower. For complex products like Quid, RainforestQA has scaled testing better and freed up engineer time for more exploratory testing.
Taking AppSec to 11 - BSides Austin 2016Matt Tesauro
This document summarizes Matt Tesauro's presentation "Taking AppSec to 11" given at Bsidess Austin 2016. The presentation discusses implementing application security (AppSec) pipelines to improve workflows and optimize critical resources like AppSec personnel. Key points include automating repetitive tasks, driving consistency, increasing visibility and metrics, and reducing friction between development and AppSec teams. An AppSec pipeline provides a reusable and consistent process for security activities to follow through intake, testing, and reporting stages. The goal is to optimize people's time spent on customization and analysis rather than setup and configuration.
The document discusses the history and evolution of DevOps practices over time, from concepts like daily builds in the 1990s to more recent approaches like infrastructure as code and serverless architectures. It provides an overview of key figures and texts that helped establish ideas like continuous integration, continuous delivery, and site reliability engineering. The document also shares the author's perspective on what commercial security tools have been developed for DevOps workflows and mentions some open source collaboration and automation tools.
This document summarizes Spotify's approach to scaling their operations team. It discusses how in 2011, the operations team of 5 people was overwhelmed supporting Spotify's growing services. To address this, Spotify transitioned operations staff into feature "squads", giving each squad end-to-end responsibility for their services. This reduced technical debt by standardizing each service and allowed operations knowledge to be embedded within development teams. The current approach has improved availability and reduced handoffs. However, communication across teams remains a challenge. The document advocates for a DevOps model where every engineer learns full stack skills rather than separate dev and ops roles.
SREcon 2016 Performance Checklists for SREsBrendan Gregg
Talk from SREcon2016 by Brendan Gregg. Video: https://www.usenix.org/conference/srecon16/program/presentation/gregg . "There's limited time for performance analysis in the emergency room. When there is a performance-related site outage, the SRE team must analyze and solve complex performance issues as quickly as possible, and under pressure. Many performance tools and techniques are designed for a different environment: an engineer analyzing their system over the course of hours or days, and given time to try dozens of tools: profilers, tracers, monitoring tools, benchmarks, as well as different tunings and configurations. But when Netflix is down, minutes matter, and there's little time for such traditional systems analysis. As with aviation emergencies, short checklists and quick procedures can be applied by the on-call SRE staff to help solve performance issues as quickly as possible.
In this talk, I'll cover a checklist for Linux performance analysis in 60 seconds, as well as other methodology-derived checklists and procedures for cloud computing, with examples of performance issues for context. Whether you are solving crises in the SRE war room, or just have limited time for performance engineering, these checklists and approaches should help you find some quick performance wins. Safe flying."
The document discusses asynchronous programming in Node.js. It explains that Node.js uses an asynchronous and non-blocking model that requires using callbacks and event handlers. It compares synchronous and asynchronous code examples. It also discusses challenges with asynchronous code like the "pyramid of doom" and error handling. Finally, it introduces techniques for dealing with these challenges, like named callbacks, control flow libraries like Async.js, and promises.
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Puppet
This document discusses using Docker containers to build and test Puppet code. It describes setting up a Docker container to mimic a production environment by specifying hostname, custom facts, and operating system. Tests can be run on this container to validate Puppet code works as expected before deploying changes. Future enhancements proposed include supporting more operating systems and Puppet versions, linking multiple test nodes, and using an existing Puppet master.
I Love APIs 2015: End to End Testing: Bug Squashing for DevelopersApigee | Google Cloud
This document discusses various API testing methodologies and tools, including test-driven development (TDD), behavior-driven development (BDD), integration testing, unit testing, and mocking. It provides an overview of popular testing practices for API developers and recommends writing test cases first under a TDD or BDD approach. Specific tools mentioned include Apickli for integration testing APIs deployed to Apigee, and various options for unit testing API proxies locally without dependencies.
The talk from DevOps Days Silicon Valley 2015 conference which describes the signs of having or being a single point of failure expert on your system, and the ways to solve the problem
Chaos patterns - architecting for failure in distributed systemsJos Boumans
As we architect our systems for greater demands, scale, uptime, and performance, the hardest thing to control becomes the environment in which we deploy and the subtle but crucial interactions between complicated systems. Chaos Patterns help us establish and implement a virtuous cycle that let’s us both prove & improve our system along each of these dimensions before the inevitable happens.
While it may seem reckless or counter-intuitive, our experience has proven that it’s a matter of how and when (not if) we will learn about the limitations and failure modes of the system.
This is the story of the pitfalls we encountered, and how, through architecture, convention and common sense, we managed to build an infrastructure that is "Always Up" from the end user perspective and incredibly economical to build, scale & operate; using chaos testing, we learn more about how our system fails from a 10 second controlled failure than a multi-hour uncontrolled outage.
In this session we will cover various implementation techniques, available to any developer & operator, which will vastly increase the resilience of your systems and provide a superior end user experience; from optimizing your use of DNS for failure, to configuring your CDN to have your back, to synthetic responses and expected database outages.
But why stop there? Netflix has pioneered a culture and suite of tools that actively injects ‘once in a blue moon’ failures into its production systems, which lets you battle test your resilience design and let developers & operators sleep comfortably at night knowing their systems are able to handle even the worst of worst case scenarios.
The document discusses how logging in software is often broken and provides recommendations for making logging more effective. It recommends using continuous event IDs, transaction tracing, log aggregation and search tools, designing software with logging in mind, and making log severity levels configurable. This will help with tasks like verification, traceability, accountability, and diagnosing issues across development and operations teams.
This document discusses techniques and tools for having coherent discussions about performance in complex systems. It emphasizes making performance relevant and important, developing a performance culture focused on small wins, and using consistent terminology. The document also describes Dapper, Google's distributed tracing infrastructure, how it works, and examples of its use. It advocates for moving away from Thrift and Scribe in favor of other open source alternatives like Zipkin and libmtev that provide distributed tracing functionality with better performance.
Our monitoring team works in a cycle of 4 phases: Definition, Collection, Visualization and Action. We've found it effective to be clear about what phase we are in to help communicate our needs as well as our progress. This talk was presented as a lightning talk at Monitorama 2015 by Melanie Cey
Devops and Immutable infrastructure - Cloud Expo 2015 NYCJohn Willis
You often hear the two titles of "DevOps" and "Immutable Infrastructure" used independently.
In his session at DevOps Summit, John Willis, Technical Evangelist for Docker, will cover the union between the two topics and why this is important. He will cover an overview of Immutable Infrastructure then show how an Immutable Continuous Delivery pipeline can be applied as a best practice for "DevOps." He will end the session with some interesting case study examples.
Time to say goodbye to your Nagios based setup. Discover all the new cool tools out there to do some more efficient monitoring. A talk made at OSMC 2014.
https://www.youtube.com/watch?v=_BAWi9Zhmic
Identifying and fixing issues in new code before deploying it to production is important for every software development cycle. However, relying on traditional testing methods in the age of Internet-scale data driven problems may prove to be incomplete. Identifying and fixing the issues in production quickly is crucial, but it requires insight into usage patterns and trends across the whole architecture and application logic. In this talk I touch on inefficiencies of some of the most common testing methods, provide real world examples of discovering odd edge cases with monitoring and offer recommendations on top-down metric instrumentation to help DevOps organizations with identifying and acting on business-effecting problems.
Presentation given at QCon London on 4th March 2015
Tools, Collaboration, and Conway's Law: how to choose and use tools effectively for Continuous Delivery and DevOps
With an ever-increasing array of tools and technologies claiming to 'enable DevOps' or 'implement Continuous Delivery', how do we know which tools to try or to choose? In-house, open source, or commercial? Ruby or shell? Dedicated or plugins? It transpires that highly collaborative practices such as DevOps and Continuous Delivery require new ways of assessing tools and technologies in order to avoid creating new silos.
Matthew Skelton shares his recent experience of helping many different organisations to evaluate and select tools to facilitate DevOps and Continuous Delivery, including version control, log aggregation, deployment pipelines, monitoring and metrics, and infrastructure automation tools; the recommendations may surprise you.
DevOps Kaizen: Practical Steps to Start & Sustain a Transformationdev2ops
Damon Edwards (DTO Solutions) talk from #DOES15 on October 20, 2015 in San Francisco, CA.
Video coming soon... http://devopsenterprise.io
Atmosphere 2018: Yury Tsarev - TEST DRIVEN INFRASTRUCTURE FOR HIGHLY PERFORMI...PROIDEA
In this presentation Yury Tsarev will review practical examples of how to build infrastructure-as-code with a strong test-driven approach. While equipped with an opinionated tools selection, the audience will be provided with a generic framework to build upon where the components are fully replaceable. Further, Yury strongly believes that infrastructure code should be treated like any other code. This means applying a test driven development model, storing it in a source control system and building a regression test suite. He suggests doing this with Test Kitchen, a pluggable and extensible test orchestrator that originated in the Chef community. Using Test Kitchen’s disposable modules it is possible to test both mutable (e.g. based on Puppet/Chef/Ansible) as well as immutable infrastructure (e.g. Terraform based). Serverspec/Inspec can verify that the configuration code behaves properly. In addition, shell mocking can be used to bypass external dependencies and create hermetic infra tests. Having such a powerful test infra toolset enables DevOps/SRE teams to practice TDD, create strong CI/CD pipelines and reduce overhead by never having to test manually again.
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
Andy has made mistakes. He's seen even more. And in this talk he details the best and the worst of the container and Kubernetes security problems he's experienced, exploited, and remediated.
This talk details low level exploitable issues with container and Kubernetes deployments. We focus on lessons learned, and show attendees how to ensure that they do not fall victim to avoidable attacks.
See how to bypass security controls and exploit insecure defaults in this technical appraisal of the container and cluster security landscape.
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Richard Bullington-McGuire
Have you ever needed to wrestle a legacy application onto a modern, scalable cloud platform, while increasing security test coverage? Sometimes real applications are not easily stuffed into a Docker container and deployed in a container orchestration system. In this talk, Modus Create Principal Architect Richard Bullington-McGuire will show how to compose Jenkins, Docker, Terraform, Packer, Ansible, Packer, Vagrant, Gauntlt, OpenSCAP, the CIS Benchmark for Linux, AWS CodeDeploy, Auto Scaling Groups, Application Load Balancers, and other AWS services to create a performant and scalable solution for deploying applications. A local development environment using Vagrant mirrors the cloud deployment environment to minimize surprises upon deployment.
Scala, docker and testing, oh my! mario camouJ On The Beach
Testing is important for any system you write and at eBay it is no different. We have a number of complex Scala and Akka based applications with a large number of external dependencies. One of the challenges of testing this kind of application is replicating the complete system across all your environments: development, different flavors of testing (unit, functional, integration, capacity and acceptance) and production. This is especially true in the case of integration and capacity testing where there are a multitude of ways to manage system complexity. Wouldn’t it be nice to define the testing system architecture in one place that we can reuse in all our tests? It turns out we can do exactly that using Docker. In this talk, we will first look at how to take advantage of Docker for integration testing your Scala application. After that we will explore how this has helped us reduce the duration and complexity of our tests.
Truemotion Adventures in ContainerizationRyan Hunter
This document summarizes Ryan Hunter's experience switching his company's infrastructure from using Ansible to provision Debian-based servers to using Docker containers and ECS on AWS. Some key reasons for the switch included dependency issues with Ansible, inflexible server sizing, and a desire for more portable and standardized application builds. Docker provided containers as a flexible runtime artifact while ECS and CloudFormation helped with scheduling, provisioning, and configuring containers at scale on AWS. Monitoring tools like Consul, Sumo Logic, and custom monitoring libraries were also implemented.
This talk describes the current state of the Veil-Framework and the different tools included in it such as Veil-Evasion, Veil-Catapult, Veil-Powerview, Veil-Pillage, Veil-Ordnance
Next Generation Automation in Ruckus WirelessDavid Ko
This document provides a status update on the development of the Next Generation Automation (NGA) platform at DEV-IT. It summarizes that NGA is being developed as a microservices-based, API-driven automation execution platform that will allow anyone to write and run test cases anywhere through different deployment methods. It outlines the current automation process issues NGA aims to address. The document then details progress made in developing NGA, including its REST API, deployment options, test case execution capabilities, and plans for a GUI. It concludes with an overview of next steps such as adding more API status checks and migrating existing processes to leverage NGA.
Bgoug 2019.11 building free, open-source, plsql products in cloudJacek Gebal
Jacek Gębal is a principal software engineer at Fidelity Investments in Ireland who has been working with Oracle databases since 2000. He is a key contributor and maintainer of the open-source utPLSQL testing framework. In his talk, he discusses how he has leveraged free tools like Git, GitHub, Docker, Travis CI, and SonarCloud to collaborate globally on open-source projects and ensure their long-term sustainability through continuous integration, testing, and code quality practices. He provides examples of how to set up these tools for an Oracle database project.
Docker Compose allows developers to define and run multi-container Docker applications. It helps coordinate multiple containers to work together by defining them in a single compose file. This avoids the complexity of using raw Docker commands. Compose files define services, their images, dependencies, volumes, ports, etc. Compose then automates setting up and running the entire application with a single command. This provides an isolated development environment approximating production. It enables features like continuous integration testing against real services rather than mocks. Overall, Docker Compose improves the developer experience by simplifying and streamlining local development and testing of multi-container applications on Docker.
This document discusses Ansible, an open-source automation tool. It provides an overview of Ansible's capabilities including configuration management, orchestration, deployment and more. It also summarizes Ansible Tower which adds centralized control, RBAC, and other features to Ansible. Examples are given of using Ansible playbooks to automate tasks like installing and configuring Apache on Linux hosts and using Ansible modules to configure network devices.
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet
This document discusses Docker and Puppet and how they can be used together. It suggests using Puppet to install and configure Docker on the host system, and then using Dockerfiles to build container images in a deterministic way. While Puppet could theoretically be used to build containers, the document argues it is better to use Dockerfiles for image builds and to separate operational concerns like logging and monitoring into separate containers for better portability and flexibility.
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
This document discusses implementing DevOps with Python using Ansible. It provides an agenda for the presentation including discussing DevOps hotspots, infrastructure as code with Ansible, continuous integration/continuous delivery (CI/CD) using TravisCI and CircleCI, and an open discussion on monitoring and automated tests. It then covers problems commonly faced, how DevOps solves these problems, and the expected benefits of adopting a DevOps culture including standardized environments, infrastructure as code, automated delivery, monitoring, and improved collaboration. It provides an overview of Ansible concepts like inventories, ad-hoc commands, modules, playbooks, roles, and templates. It also demonstrates writing a custom Python module for Ansible and using it in a playbook. Finally, it
Docker is an open platform for developers and system administrators to build, ship and run distributed applications. Using Docker, companies in Jordan have been able to build powerful system architectures that allow speeding up delivery, easing deployment processes and at the same time cutting major hosting costs.
George Khoury shares his experience at Salalem in building flexible and cost effective architectures using Docker and other tools for infrastructure orchestration. The result allows them to easily and quickly move between different cloud providers.
DCSF 19 Building Your Development Pipeline Docker, Inc.
Oliver Pomeroy, Docker & Laura Tacho, Cloudbees
Enterprises often want to provide automation and standardisation on top of their container platform, using a pipeline to build and deploy their containerized applications. However this opens up new challenges; Do I have to build a new CI/CD Stack? Can I build my CI/CD pipeline with Kubernetes orchestration? What should my build agents look like? How do I integrate my pipeline into my enterprise container registry? In this session full of examples and how-to's, Olly and Laura will guide you through common situations and decisions related to your pipelines. We'll cover building minimal images, scanning and signing images, and give examples on how to enforce compliance standards and best practices across your teams.
Testing fácil con Docker: Gestiona dependencias y unifica entornosMicael Gallego
Docker es una tecnología que permite empaquetar el software de forma que se pueda ejecutar de forma sencilla y rápida, sin instalación y en cualquier sistema operativo. Es como tener cualquier programa instalado en su propia máquina virtual, pero arranca mucho más rápido y consume menos recursos. Docker está cambiando la forma en la que desplegamos software, pero también está afectando al propio proceso de desarrollo y particularmente al testing.
En este taller pondremos en práctica cómo usar Docker para facilitar la implementación de diferentes tipos de tests y su ejecución tanto en el portátil como en el entorno de integración continua. Aunque las técnicas que veremos se podrán aplicar en cualquier lenguaje de programación, los ejemplos estarán basados en Java y en JavaScript.
Scalable Spark deployment using Kubernetesdatamantra
The document discusses deploying Spark clusters on Kubernetes. It introduces Kubernetes as a container orchestration platform for deploying containerized applications at scale across cloud and on-prem environments. It describes building a custom Spark 2.1 Docker image and using it to deploy a Spark cluster on Kubernetes with master and worker pods, exposing the Spark UI through a service.
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Борис Зора
When you start your journey with µServices, you should be confident with your delivery lifecycle. In case of mistake, you should be able to navigate to appropriate tag in vcs to reproduce the bug with a test & go though pipeline within 3 hours to production with high confidence of quality.
We will discuss set of tools that could help you to achieve this within 3 months on your project. It does not include system decoupling suggestions. And in the same time, if you decide to break down monolith, it is better to do with dev & devOps best practices.
Pluggable Infrastructure with CI/CD and DockerBob Killen
The docker cluster ecosystem is still young, and highly modular. This presentation covers some of the challenges we faced deciding on what infrastructure to deploy, and a few tips and tricks in making both applications and infrastructure easily adaptable.
2. About Me
Russian engineer living in Prague
● Yury Tsarev
● Mostly QA & Systems Engineering background
● Previously
○ Sysadmin in Russian bank
○ QA/Sr. SWE in SUSE Linux
○ Sr. QA Engineer in Cloud Infra team of GoodData
● Currently QA Architect in GoodData focusing on
○ Private cloud
○ Internal PaaS
○ Continuous Delivery
● Contacts
○ [email protected]
○ https://github.com/ytsarev
○ https://linkedin.com/in/yurytsarev
○ https://twitter.com/xnullz
3. About GoodData
Information relevant to the talk
● GoodData runs cloud-based business intelligence (BI) and big data analytics
platform
● Operates on top of Openstack-based Private Cloud and Internal
Platform-as-a-Service
● Several datacenters, hundreds of hardware servers, thousands virtual machines,
internally complex distributed system to manage
● Relies on Puppet for Configuration Management
4. What to Expect From This Talk ?
● A real-life story of infrastructure development process evolution
● A practical guide with opinionated set of tools for testing
infrastructure at scale
● A framework which components are ready to be adjustable or
replaceable for your specific case
● No kittens, no unicorns, no Docker worship
5. Infrastructure as a Code
Puppet driven infra as a prerequisite
● Every infra change is tracked through puppet code, no exceptions
● Puppet code is stored in git
● Puppet code is a shared ground for whole DevOps organization
● Puppet code has quality problems
6. Puppet Architecture in GoodData
Server Type is an entrypoint
● Popular Roles&Profiles pattern is not implemented
● Instead there is notion of Type(can be understood as Server
Type/Role) which is a main entrypoint for code execution
● Type is a combination of puppet modules describing a resulting
server state
● Relatively huge codebase
○ Around 150 puppet modules
○ More than 100 types
● Applying a type on the instance is as easy as propagate
$EC2DATA_TYPE environment variable, e.g. from openstack
metadata endpoint
7. Challenges at Scale
Complex distributed platform to manage
● Puppet code is a base for everything:
from Openstack Private Cloud up to application frontend
● Several hundred of physical servers and thousands of VMs
● Multiple datacenters
● Multiplied by huge number of puppet types
● Tightly coupled modules with multiple interdependencies
● Complexity creates reliability and quality problems
8. Dependencies Depicted
Our puppet dependency graph
● Representation of puppet modules
interdependencies
● 2650 Resources
● 7619 Dependencies between them
9. Manual way of puppet validation
Does not work at scale
● Checkout new puppet code
● Run `puppet apply --noop`
● Evaluate the output
● If --noop looks fine then make real apply
● Manual smoke testing
Obviously such process does not scale
10. Introducing Puppet Self Check
As we need some test before the merge
● Linting (puppet-lint)
● Puppet catalog compilation
● Automated --noop run in fakeroot
● Integration with Jenkins
● Detailed feedback right in Pull Request
12. Puppet Self Check is not enough
Crucial, but only initial coverage
● Covering
○ Style errors
○ Syntax errors
○ Catalog compilation errors like circular dependencies
● Missing
○ Configuration file errors
○ Ability to check if services/processes were able to start
○ No configuration testing
○ No service smoke testing
● We want to catch the issues way before the merge
○ Shifting testing left is great for quality and velocity
○ Staging should uncover minimal amount of complex
integration issues
13. Introducing Test Kitchen
Something more for the next step of test pipeline
● http://kitchen.ci/
● Advanced test orchestrator
● Open Source project
● Originated in Chef community
● Very pluggable on all levels
● Implemented in Ruby
● Configurable through simple single yaml file
● "Your infrastructure deserves tests too."
14. ● Driver creates the instance
○ $ kitchen create ...
● Provisioner converges the puppet
code
○ $ kitchen converge …
● Verifier verifies the expected
result
○ $ kitchen verify ....
● Driver: what type of VM/containerization/cloud to use
○ Amazon EC2, Blue Box, CloudStack, Digital Ocean,
Rackspace, OpenStack, Vagrant, Docker, LXC containers
● Provisioner: which configuration management tool to apply
○ Chef, Puppet, Ansible, SaltStack
● Verifier: test automation type to verify the configuration
correctness with
○ Bats, shUnit2, RSpec, Serverspec
Test Kitchen architecture
Main components and verbs
15. Test Kitchen Sequential Testing Process
Create -> Converge -> Verify
Driver
creates
Provisioner
converges
Verifier
verifies
16. Test Kitchen Verbs Meaning
What is actually happening
Container/VM is
created
Configuration
Management
code is applied.
Instance is
converged to
desired state
Expected result
is verified by
running the test
suite
17. Which Driver to use ?
Or why we stick to Docker
● The openstack driver could be an obvious choice for our
openstack-based private cloud
● But remember we have more than 100 puppet types to test?
● That would mean at least one full-blown VM for each
type-under-test
● Even with minimum instance flavour it is too much
● Thus, we stick to Docker
19. Docker Driver Specifics
What does it bring and take away
● Resource utilization is a game changer
○ Instead of spawning more than 100 VMs we are managing the testing load
within small 3-nodes jenkins slave cluster
● Shared testing environment
○ Same containers spawned on jenkins slaves and on developer laptops
● Allows to create system containers that are mimicking VMs/servers
● It does not come for free
○ Docker specific limitations and constraints
○ Deviation from real VM scenario
○ Hard to debug issues with process concurrent behavior. Most of them
relate to the fact that users are not namespaced in Linux kernel
20. ● Basic docker driver
definition in .kitchen.yml
● Uses the image from
private docker registry
● Specifies provision
command for test
container runtime
preparation
● Separate project
https://github.com/portertech/kitchen-docker
● driver:
name: docker
image: docker-registry.example.com/img:tag
platform: rhel
use_sudo: false
provision_command:
yum clean all && yum makecache
Docker Driver Project & Configuration
Driver section of .kitchen.yml
21. ● Volume management
● Kernel capabilities
● Custom Dockerfile for
testing container
● volume:
- /ftp
- /srv
● cap_add:
- SYS_PTRACE
- SYS_RESOURCE
● dockerfile:
custom/Dockerfile
Docker Driver Additional Features
That are useful for testing
22. “Now we are fully prepared for Create stage.
`kitchen create` will spawn fresh testing
container.
Next one is Converge.
And Converge means Provisioner.
23. Puppet Provisioner
An obvious choice to run puppet code
● Also distinct upstream project
https://github.com/neillturner/kitchen-puppet
● Uploads puppet code into instance under test
● Runs puppet there a.k.a. getting instance to converged state
● Provides extremely useful functionality for creating puppet
related testing constraints
○ Puppet facts customization facility
○ Hiera
○ Facterlib
○ Custom installation, pre-apply, post-apply commands
○ And much more documented in provisioner_options.md
24. ● Specifies local paths to
manifests, modules, hiera
under test
● Overrides the puppet
facts to create testing
constraints
● Describe custom script
to be executed before
puppet run
● provisioner:
name: puppet_apply
modules_path: puppet/modules
manifests_path: puppet/manifests
hiera_data_path: puppet/hieradata
facterlib: /etc/puppet/facter
install_custom_facts: true
custom_facts:
ec2data_type: web_frontend
docker: 1
ec2data_freeipa_otp: test
ec2data_nopuppet_cron: 1
ec2_public_ipv4: 127.0.0.1
…
custom_install_command: |
# custom setup script
Puppet Provisioner Configuration
Provisioner section of .kitchen.yml
25. “Looks like we are good with Provisioner and
can proceed to Verifier?
27. External Dependencies
Or how to test in isolation
● Quite frequently puppet types under test will require some
external service to communicate with
● We want to avoid external communication in most cases
● Because we want fast and deterministic results
● And we do not want to spoil production services with test data
● Same goes for additional load
● Exceptions (the things that we still do want to communicate )can
be core services like ntp, rpm repository server, etc.
28. Introducing Shellmock
Extremely simple stub/mocking tool
● https://github.com/gooddata/shellmock
● Solution to external dependency problem a.k.a dependency
injection
● A simple ruby script that placed instead of package manager
strictly within testing instance
● Intercepts calls to package manager
● Installs a mock instead of real package if this mock is defined in
shellmock configuration
● If mock is not defined passes the request to real package manager
for real package installation
● Same trick is used to bypass number of docker limitations like
sysctl calls within container
29. ● Format is simple
package:
/path/to/executable:|
contents
● If no content specified the mock
defaults to simple message that
returns
exit code 0
Shellmock Example Configuration
Separate shellmock.yaml that lives in puppet repo
Mock configuration Resulting mock
ipa-client:
/usr/sbin/ipa-client-install: |
echo 'server = freeipa.example.com' >
/etc/ipa/default.conf
echo 'fake' > /etc/krb5.keytab
$ cat /usr/sbin/ipa-client-install
echo 'server =
freeipa.example.com' >
/etc/ipa/default.conf
echo 'fake' > /etc/krb5.keytab
sssd:
/usr/sbin/sssd:
$ cat /usr/sbin/sssd
#!/bin/bash
echo I am a fake /usr/sbin/sssd
30. “If all external dependencies are satisfied the
Converge will be passing.
`kitchen converge` will successfully apply
puppet.
Now it is time to deal with Verifier.
31. Verifier
A component that executes test framework
● Serves as tiny configuration for test execution
● Tests are written separately with the test framework of choice
● Out of the box support for Bats, shUnit2, RSpec, Serverspec, Cucumber
32. Why Serverspec?
Because it rocks
● Standalone open source project
http://serverspec.org/
● Rich resource library
http://serverspec.org/resource_types.html
● DSL to describe expected configuration state
● Based on famous RSpec framework
● Multi OS support
● Readable, flexible, extensible
● Low entry barrier
33. ● Command resource deserves
special attention
● It allows to check anything you
can do in shell
● More advanced scenarios will
require creation of custom
resources
Serverspec DSL Examples
describe file('/var/log/httpd') do
it { should be_directory }
end
describe command('apachectl -M') do
its(:stdout) { should
contain('proxy_module')}
end
describe default_gateway do
its(:ipaddress) { should eq
'192.168.10.1' }
its(:interface) { should eq 'br0'
}
end
describe cgroup('group1') do
its('cpuset.cpus') { should eq 1 }
end
describe
docker_container('focused_curie') do
its(:HostConfig_NetworkMode) {
should eq 'bridge' }
its(:Path) { should eq '/bin/sh' }
end
describe port(53) do
it { should
be_listening.with('udp') }
end
34. What and How to Test?
A frequent question
● The most effective way to create a serverspec test is to think: “What would I
anyway manually check after server deployment?”
● Then express it in serverspec DSL
● Most powerful serverspec tests are covering not only puppet produced
configuration but testing the outcome
35. ● The test that checks behaviour
of actual API endpoints after
instance converge
● Notice that the test is still
isolated within one instance
● Serverspec/RSpec is internal
DSL so you can easily use Ruby
right in the test definition
under_kerberos_auth = ['', 'status', 'status.json',
'status/payload', 'images/grey.png']
under_kerberos_auth.each do |path|
describe command("curl -k -X POST http://127.0.0.1/#{path}") do
its(:stdout) { should match(/301/) }
end
describe command("curl -k -X POST https://127.0.0.1/#{path}")
do
its(:stdout) { should match(/401/) }
its(:stdout) { should match(/Authorization Required/) }
end
end
Testing the Outcome
DSL plus a bit of basic Ruby
36. Test Suite Composition
There is no official reference
● Serverspec provides only DSL and abstraction over configuration
resources
● The test suite organization and composition is completely up to you
● Great example of advanced, yet simple setup
https://github.com/vincentbernat/serverspec-example
● GoodData implementations that were built on top of that example
○ https://github.com/gooddata/serverspec-core
○ https://github.com/gooddata/serverspec-ui
● These projects are only test executors, actual tests should be placed
together with the code, e.g. same git repo with puppet
37. What Was Added on Top of Serverspec
Tiny bits of functionality
● YAML based configuration to define
○ Environments, e.g. dev/prod or geographical data centers
○ Host to role/type assignment
● Tests are placed in the directory structure according to defined hierarchy
● Parallel execution
● Reporting in multiple formats
● Coding style for tests (rubocop)
38. ● From kitchen configuration
point of view it is just shell
verifier
● remote_exec makes command
to be executed within testing
instance ( execution from host
is default )
● command invokes serverspec
test suite with control variables
and params
verifier:
name: shell
remote_exec: true
command: |
sudo -s <<SERVERSPEC
export SERVERSPEC_ENV=$EC2DATA_ENVIRONMENT
export SERVERSPEC_BACKEND=exec
serverspec junit=true tag=~skip_in_kitchen
check:role:$EC2DATA_TYPE
SERVERSPEC
Shell Verifier and Serverspec
Flexibility of invocation
39. “Create -> Converge -> Verify harness is ready.
`kitchen verify` will test the infra code.
But only for one puppet type.
How to describe multiple types?
40. Platforms and Suites
Additional structures in .kitchen.yml
● The way to create multiple test configurations
● Platforms are usually used to specify distribution/image to test on top of
● Suites are used to reflect semantics of test run
In our case it is puppet type
● The configuration options from main components of Driver/Provisioner/Verifier
can be overridden on Platform and Suite levels
41. ● Driver configuration is
overridden per platform
● Additional tricks to run systemd
within container
platforms:
- name: el6
driver:
image: docker-registry.example.com/el6:6.8
cap_add: SYS_PTRACE
- name: el7
driver:
image: docker-registry.example.com/el7:7.2
dockerfile: t/kitchen/centos7-dockerfile
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
run_command: /usr/lib/systemd/systemd
Multi Distro Testing With Platforms
Covering EL6 to EL7 migration
42. ● Driver and Provisioner are
overridable on suite level as
well and has a priority over
Platform level
suites:
- name: frontend
provisioner:
custom_facts:
ec2data_type: frontend
- name: backend
provisioner:
custom_facts:
ec2data_type: backend
- name: database
provisioner:
custom_facts:
ec2data_type: database
driver:
cap_add:
- SYS_RESOURCE
Multiple Types Description With Suites
43. ● Kitchen composes test run
( Instance column ) out of
suite + platform definitions
● Each puppet type ( specified as
suite ) is going to be tested on
each specified platform
$ kitchen list
Instance Driver Provisioner Verifier Transport Last Action
frontend-el6 Docker PuppetApply Shell Rsync <Not Created>
frontend-el7 Docker PuppetApply Shell Rsync <Not Created>
backend-el6 Docker PuppetApply Shell Rsync <Not Created>
backend-el7 Docker PuppetApply Shell Rsync <Not Created>
database-el6 Docker PuppetApply Shell Rsync <Not Created>
database-el7 Docker PuppetApply Shell Rsync <Not Created>
Resulting Test Composition
How kitchen composes suite and platform
44. Now We Can Make It Test Driven!
Having it all combined we can write infra code with
test-first approach
● Write serverspec expectation for new code
● $ kitchen verify <type>
● Observe related test is red
● Write the puppet code
● $ kitchen converge <type> # reapply the modified puppet code
● $ kitchen verify <type>
● Observe related test is green
● Commit the changes and create PR to puppet repo
45. TDD Has to Scale
Technically and culturally
● Infrastructure testing should be integral part of development process and
supported by strong testing culture within organization
● We test on a developer desktop even before git commit
● After commit/PR but before the merge we need to trigger test pipeline
● Serverspec test suite should be reused later in the pipeline after the merge on
actual staging servers
● And ultimately test suite should travel to production servers after release for
continuous regression self-testing integrated with monitoring
47. Next Challenge: Test Only Affected Types
And spare resources and time for Pull Request testing
● We have more than 100 puppet types
● It is acceptable number for puppet-self-check because it is fast and does not
consumes lot of resources
● It is different for Test Kitchen: we cannot spawn more than 100 containers for
each Pull Request! It is suboptimal and resource demanding
● We need to figure out affected puppet types in automated way
48. Getting Diff From Puppet Code Change
How to actually deduct affected types?
● Puppet build complex graph out of
○ Interdependent modules
○ Hiera variables
○ Autogenerated custom facts
● So a mere file based diff will not help
● Puppet generated graph is too complex to reliably analyze
● Solution
○ Compare compiled catalogs
○ Create affected type list
○ Feed the list to Test Kitchen
49. Introducing Puppet-Catalog-Diff
Yet another open source tool
● https://github.com/acidprime/puppet-catalog-diff
● Two puppet catalogs as an input
● Compares catalog json
● Diff as an output
● Helps to catch
○ Unexpected modifications in seemingly unrelated types
○ Idempotency issues
50. Extending Puppet-Self-Check
With the puppet-catalog-diff
Compile
catalog
Diff catalog
with stable
Is there
a diff ?
Proceed to
next type
Add type
to
affected
type list
yes
no
52. Final State of Pipeline
With the catalog diff extension
Puppet
self-check
Staging
Clusters
Production
Clusters
Merge Release
Test Kitchen
Docker Container(s)
Puppet Serverspec
Shellmocking
Puppet
Serverspec
Puppet
Serverspec
Promote
puppet-lint
Catalog
compilation
Catalog diff
Testing only
affected types
53. Side note on CI/CD tooling set
What do we use to orchestrate pipelines
● Jenkins - popular open source automation server
● Jenkins Job Builder - takes simple descriptions of Jenkins jobs in
YAML or JSON format and uses them to configure Jenkins
○ Everything under GIT version control
● Zuul is used to gate the source code repository of a project so that
changes are only merged if they pass tests.
○ Check pipeline for fast (most frequently unit) tests
○ Gate pipeline for longer resource demanding (integration)
tests before actual merge
○ Optimistic merge strategy enables testing multiple Pull
Requests in parallel
54. Replaceability
A note on agnostic approach
● Kitchen driver is agnostic to virtualization solution/cloud provider
● Kitchen provisioner is agnostic to configuration management solution
● Serverspec is agnostic to configuration type at all
● Capability to make brave movements in future!
○ Major upgrades like Puppet 3.x to 4.x
○ Change of configuration management solution
○ Using drivers other than Docker for different pipelines (e.g. openstack
driver to test VM image bootability and configuration)
● Same framework can be used for completely different projects and solutions
○ Chef, ansible, salt, different cloud providers and even different test
frameworks - the Test Kitchen approach will be still relevant
55. OSS, Upstream
Open source and contributions
● Multiple open source projects combined
○ Different upstreams diversifies the overall ecosystem
○ Different maintainers - different level of upstream response
○ Can be both good and bad
● GoodData has contributed multiple patches to related kitchen
projects and serverspec
● GoodData has open-sourced internal implementations
○ https://github.com/gooddata/serverspec-core
○ https://github.com/gooddata/serverspec-ui
○ https://github.com/gooddata/shellmock
56. What Could be Done Better
If we would start from scratch
● More modular Puppet, less interdependencies
● More investment into unit tests, see rspec-puppet
● Reduction of number of puppet types with Roles & Profiles
pattern
57. Benefits Recap
of Puppet, Test Kitchen, Docker, Serverspec tandem
● Scratch testing environment
● Testing infra in isolation
● Easy to test permutations
● Resource Efficiency
● Replaceability
● TDD for Infra
● Short feedback loop
● Naturally growing regression test suite
● Easily pluggable into CI/CD pipeline
● Open Source
58. “Now you know how we build test driven infra
with open source tool set.
You can reuse it fully or partially with
adaptation to your specific case.
Hopefully see you upstream!
59. We are hiring!
A clear conference time abuse
● If you like challenges described above visit
http://www.gooddata.com/company/careers
● In case you find something attractive don’t hesitate to drop me a
line directly to [email protected]
60. Recommended Reading and Questions
To not to create useless ‘questions?’ slide
● Books that are full of practical wisdom
○ Puppet Best Practices
○ Infrastructure as Code
○ Test-Driven Infrastructure with Chef
● Thanks for not running away till the
end of the talk! Questions?