Category: DevOps Toolbox

  • ElasticBox Jenkins Plugin – Easy Continuous Integration Setup

    ElasticBox Jenkins Plugin – Easy Continuous Integration Setup

    Introduction to Jenkins and ElasticBox

    ElasticBox has recently released a Jenkins plugin which makes it possible to configure a continuous integration or continuous deployment scenario without writing any code or scripts! How have we done this you ask? Simple, it was magic. In all seriousness, magic is the end result if you integrate ElasticBox and Jenkins with the source control software of choice.

    For those who rely on Jenkins for daily work, performing integration builds, orchestrating complex, large scale scenarios for testing or managing continuous delivery of applications with many configurations across multiple environments, is not uncommon. These types of scenarios require a lot of time setting up slaves and performing manual steps to configure the provisioning of cloud providers. Keeping consistency and across the environments becomes exponentially complex when you factor multiple clouds or hybrid cloud environments into the picture.

    You can reduce the amount of manual configuration and scripting, while abstracting the provisioning of infrastructure, by using ElasticBox with the ElasticBox Jenkins Plugin. This means that you can use ElasticBox to solve complex continuous integration or deployment use cases in the quickest, most consistent and reliable way possible.

    How Does It Work:

    Here at ElasticBox we trigger tests, builds, and deployments on pull requests and merges, which is a very common use case. These actions start workflows that result in Jenkins triggering tests, builds and the deploying of instances. For more information on our internal continuous deployment scenario, take a look at this slideshare deck we presented earlier this year.

    The first thing to understand is that we manage Jenkins as an instance that we deploy into our private datacenter through ElasticBox. We have a single Box that installs Jenkins Server on the provider of your choice. This makes it convenient to scale when multiple builds are slowing things down or to simply redeploy if something breaks all together.

    The second piece of the puzzle are the required plugins, like the recently releasedElasticBox Jenkins Plugin, which, along with the Github Jenkins Plugin, makes it entirely possible to set up a continuous integration or deployment server without writing any code.

    Setting Up Jenkins and ElasticBox:

     

    First you have to set up ElasticBox as a cloud in the configuration page of Jenkins. You simply enter the ElasticBox url (http://elasticbox.com), a maximum number of instances, retention time, in minutes, and your ElasticBox username and password. Once all this information is entered correctly, you can go ahead and then test the connection.

     

    Screenshot 2014-07-01 17.57.13

     

    ElasticBox Jenkins Example:

    In this basic example, we’ll show you how we test changes to our website. When a branch is submitted as a pull request, we deploy a new staging instance of our Website Box. We validate the changes on an instance that is a replica of our production environment before merging the pull request into our master branch. When the code is merged, we then trigger a Jenkins job that reinstalls our production instances with the latest code changes (not shown in this demo). Now, our workflow for website changes is almost fully automated, minus the pull request and merge!

    1) The first step is to create a new Jenkins item where we select “Build a free-style software project”

     

    Screenshot 2014-07-02 11.34.50

    2) Once we’ve created a new item, we add the Github project URL and check the ‘this build is parameterized’ box. While this step isn’t required, it allows you to trigger a build manually and execute code from a specific branch.

    Screenshot 2014-07-02 11.46.36

     

    3) In the source code management section, we specify the source code management tool, the ‘Repository URL’, provide credentials in the form of Username / Password, and for the Branch Specifier, use ‘${sha1}’ which represents the commit url of the branch submitted in the pull request. The Jenkins Git plugin is extremely complex and we highly recommend reading the Wiki on the plugin.

    In the Build Triggers section, you’ll want to select “Github Pull Request Builder” Which is what will be triggering the Jenkins build and instance deployment in ElasticBox.

    Screenshot 2014-07-02 11.48.44

    4) The final step is configuring the Build steps. With the ElasticBox plugin, you’ll have access to all your workspaces, boxes and deployment profiles. For more information on each of these features, please check out the links to our documentation. Specify the Workspace, the Box and the Deployment profile you would like to use. In our case, we specify our Production Workspace, our Website Box and our Staging Deployment Profile.

    Screenshot 2014-07-02 13.31.32

     

    Conclusion:

    Once all these configurations are set, you can test changes on new staging instances just by submitting pull requests. Even though this is a basic example, by continuous integration standards, you can see how the ElasticBox Jenkins plugin can seriously reduce the amount of configurations required to setup a continuous integration server.

    With ElasticBox abstracting the infrastructure provisioning and allowing you to reuse existing application or infrastructure components, it’s much easier to scale the process in a repeatable and dependable way. We’ll be following up with blog posts that provide more technical examples on how to use Jenkins and ElasticBox for integrated builds, testing and continuous delivery models.

  • Deploying a MongoDB Cluster with ElasticBox

    Deploying a MongoDB Cluster with ElasticBox

    Our founders, back in the day,  were part of the .NET framework team at Microsoft. So it’s no surprise that their first version of ElasticBox was written on C#, .NET framework and SQL Server.

    Fast forward to 2012. As the ElasticBox vision crystallized, we wanted a robust, scalable architecture to match our vision. So we reevaluated all the existing technologies.

    Among other things, we decided to move from a relational database model to a document based approach. The main reason was because we wanted to store hierarchical data and be able to version it.

    Today, to accommodate our data needs, ElasticBox relies on MongoDB clusters, which we run on three separate providers–two public, one private. Thanks to ElasticBox, we can now deploy our MongoDB cluster in a matter of minutes.

    The Basics

    What is MongoDB? MongoDB is an open-source document store database.

    Why would you want to cluster MongoDB? To provide redundancy and high-availability for production deployments.

    How We Use MongoDB

    In our case, MongoDB is using a replica set model. A replica set is a group of MongoDB instances that host the same data set. One MongoDB, the primary, receives all write operations. All other instances, secondaries, apply operations from the primary so that they have the same data set.

    The primary accepts all write operations from clients. Replica sets can have only one primary. Because only one member can accept write operations, replica sets provide strict consistency.

    Screenshot 2014-06-18 16.47.20

    Deploying MongoDB through ElasticBox

    ElasticBox provides a default MongoDB box that’s available to the public. It deploys a standalone instance of the MongoDB server. Our MongoDB production box very closely resembles the default box, minus a few configuration settings required for our production scenario.

    While the default MongoDB box configuration is suited for development purposes, it needs to be configured further to use in production. To configure the MongoDB default box for production use, follow the steps below:

    Step 1. Create a new box called MongoDB Replica. Add a box variable for the MongoDB Server (this is to use the default box settings).Screenshot 2014-06-18 16.11.18

    Screenshot 2014-06-18 16.12.08

    Step 2. Add a text variable REPLICA_SET to hold the replica set name. This value must be shared between all the members of the cluster.

    Screenshot 2014-06-18 16.12.42

    Step 3. Expand the MongoDB Server box. Edit its file variable COMMON_YAML and paste the following:

    Screenshot 2014-06-18 15.35.45

    mongodb::replica_set: {{ REPLICA_SET }}

    mongodb::key_file: /etc/mongod.key

    Screenshot 2014-06-18 16.15.36

    This file will be used by hiera to pass arguments to puppet automatically without modifying the existing puppet default.pp file.

    Step 4. Add a binding named primary of type MongoDB Replica (the box you just created).

    Screenshot 2014-06-18 16.14.05

    Step 5. Add an install script. Get the script here.

    Screenshot 2014-06-18 16.16.10

    Screenshot 2014-06-18 22.34.28

    Step 6. Add a start script. Get the script here.

    Screenshot 2014-06-20 11.40.08Screenshot 2014-06-20 11.40.35

    When you deploy the box without a binding, it creates a cluster for you with an initial configuration. On the other hand, if you bind to an existing instance, it adds the instance to the existing cluster!

    There, you have it, a MongoDB cluster in a few easy steps!

  • Flexible and Scalable Multi-tier Application Deployments

    Flexible and Scalable Multi-tier Application Deployments

    This is a guest post from Alberto Arias Maestro, CTO and co-founder of ElasticBox

    One of the biggest problems facing software engineers since the dawn of the multi-tier application is, well, how to make it multi-tier.

    It’s more than just having several supporting applications – it is about connecting the layers correctly and allowing them to communicate with each other. All this is to create a scalable and responsive deployment that can be easily updated and adapted to changing business needs.

    It is about ensuring that your infrastructure can co-ordinate the order in which your application tiers are spun up, even when the apps themselves have not been designed to perform these critical dependency checks.

    What Are You Looking For?

    Intelligently handling your solution’s dependencies is an inherent problem in multi-tier deployments – at whatever scale you are operating. For instance,

    As a developer working on a project:

    “I want to ensure that my database is up and running before my web-server is deployed.”

    As the CTO of a rapidly growing startup:

    “I want to bootstrap on basic AWS services (such as managed cache, load balancing, and managed databases), but as the product evolves, I want to give myself the freedom to evolve the services I connect to and consume – experiencing as little downtime as possible.”

    As the Head of IT Operations of a large-scale enterprise:

    “I need to reign in a heterogenous environment where I have hundreds of highly inter-dependent applications that range from just-released to legacy and everything in between.”

    At ElasticBox, we’ve found a way to solve this problem using the concept of Boxes, and now, Bindings, a feature we are launching today.

    ‘Bindings’

    ElasticBox lets you build and deploy complex, multi-tier applications using boxes as basic building blocks. Specifying a ‘binding’ from one box to another is a way to declare that there exists a dependency between the boxes.

    It is a construct that allows the different tiers of a multi-tier applications to communicate with each other and exchange data.

    Bindings enable users to introduce not just structure, but also flexibility to their multi-tier deployments. For example,

    Our developer’s Apache Web-server Box can use a required binding to specify, that to launch correctly it needs a connection to a running MySQL DB instance.

    Our startup CTO, who has been trying to make a choice between AWS SQS (Simple Queue Service) and RabbitMQ, can simply switch bindings, with his business application experiencing little to no downtime.

    Our Head of IT Operations, can chain his applications so that they come up in the right order. He has the flexibility to modify this chain at anytime – to accommodate new applications or possibly remove old ones, without having to bring the entire system down. If you are thinking about deadlocks – don’t worry, bindings are designed to handle these.

    On-Prem? Cloud?

    For enterprises, bindings can be a very powerful way to evaluate different cloud strategies for business solution with minimal disruption to the existing deployment. Bindings allow switching between an AWS RDS instance and an on-prem database all with a single click.

    As you can see from some of the use-cases above, ‘bindings’ is a powerful concept that solves a very prevalent problem in advanced deployments and provides users a simple way to evaluate different strategies. To learn more about how to incorporate bindings into your deployment, please visit our documentation. For a free consultation about how bindings can benefit your particular use-case, please email us at support@elasticbox.com.

  • How	 Ansible makes automation easy

    How Ansible makes automation easy

    Continuing our series of videos from the recent Gluecon 2014 conference, here is our next one again courtesy of CloudSoft. In this video Peter Sankauskas talks about using Ansible to make automation easy especially with AWS.  Hope you enjoy it.

  • Using Docker & Ansible by John Minnihan @Gluecon 2014

    Using Docker & Ansible by John Minnihan @Gluecon 2014

    Continuing our series of videos from the DevOps track at Gluecon this past year, our next video is “Why Docker + Ansible Make Chef and Puppet 100% Unnecessary by John Minnihan, ModernRepo”  Again many thanks to CloudSoft for recording and making these videos available to us to post. Also the picture above is from the Ansible website originally.

    This presentation sounds pretty controversial if you just look at the title. Actually John is not advocating throwing away your Puppet or Chef scripts.  If you already have Chef or Puppet set up and you like the way it is working, there is no reason to change.  However, John believes that Docker with Ansible can negate the need to use either of these tools going forward. John is primarily talking about a greenfield situation here I believe.  Anyway, the video like the previous ones in this series are about 30 minutes. Enjoy!

  • Amplifying Docker with AMP and Brooklyn

    Amplifying Docker with AMP and Brooklyn

    Here is the second video in our series of DevOps talks from Gluecon 2014. Again thanks much to our friends at CloudSoft for providing the video services and providing them to us to post here.

    In this session CloudSoft CTO Alex Heneveld talks about how to amplify Docker using the open source Brooklyn Project (now an Apache incubation project) or the commercial version of Brooklyn, AMP by CloudSoft.  Docker is certainly one of the hottest technologies in the cloud/PaaS/development space right now.  Using Brooklyn or AMP makes Docker easier.  Alex did a really nice job in this presentation. Hope you enjoy the video

  • 6 things you didn’t know about SaltStack

    6 things you didn’t know about SaltStack

    I recently had the pleasure of moderating the first day of the DevOps track at Gluecon 2014.  As I wrote about in a previous post, the good folks at CloudSoft were kind enough to have the days sessions video taped (OK I don’t know if they actually use tape anymore, but you know what I mean). They have made these videos available to us here at devopsy.kinsta.cloud. We have uploaded them to YouTube and will be posting them here through the week.

    The DevOps sessions got started with Thomas Hatch of SaltStack presenting, 6 things you don’t know about SaltStack. Kudos to Thomas who due to a technical glitch had to start off without his slides up on the screen. But Thomas did not miss a beat and gave the audience some insight into SaltStack and what makes it best for certain tasks.

    Below is the video

  • An open-source pipeline for trusted images

    An open-source pipeline for trusted images

    There are a lot of good reasons to use a trusted image (aka “foundation image”), including reliability, reduced time to launch, secure configuration. [We’ve discussed them previously]

    In this article we are going to describe a development and quality assurance process for making trusted (aka “foundation” or “golden”) images.

    First, this is the tool set to be used.

    • Source Control Keeps track of all your scripts. Images will be built 100% by scripts, not by manual keying. Therefore source control is essential.
    • Virtual Machines You’ll need to periodically start from blank slate, when you make changes to your approach which are incompatible with the current state of your machine. Using virtual machines enables us to rapidly reset to a known state and re-apply scripts.
    • Vagrant Vagrant is a virtualization tool that makes it easy to quickly launch and re-launch virtual machines, bootstrap virtual machines with base packages and ssh configuration, and synchronize your files to the guest operating system.
    • Continuous Integration (CI) Server For reliability and repeatability, CI servers run scheduled and automated jobs which fetch and merge the latest code, produce output, run tests, and apply tags and other metadata.
    • Packer Provides the ability to build many images destined for different cloud environments from a single set of scripts.

    Now let’s move into the three steps required for creating a trusted image:

    1. Creating and testing the image on your local machine;
    2. Building the image, and;
    3. Validating and promoting the image.

     

    Step 1: Create and Test Your Trusted Images Locally

    Trusted images should not be built by hand, or you’ll quickly lose track of what’s on them! First, use version-controlled scripts to build up a virtual machine that works according to your specifications. When you control the target OS, you can use basic shell scripts. If you are building for multiple target operating systems, configuration management tools like Chef or Puppet will give you the ability to write a single set of platform-independent scripts. Vagrant is a very useful tool which makes virtualization and configuration management technologies work seamlessly together.

    Vagrant works by reading a Vagrantfile which you create for your project. It describes the base image (operating system) you want, the software you need to install, and the way you want to access the machine.

    You can then use Vagrant to launch local virtual machines right on your laptop/workstation using a virtualization tool like VirtualBox (a cross-platform virtualization tool), or you can work with remote virtual machines such as EC2.  Vagrant syncs a local folder to the VM so you can edit your scripts either locally or right on the VM, and because the scripts are right on the VM you can test them out in realtime as you edit and save. This makes the code/test cycle as rapid as possible, and it’s easy to keep both the scripts and the VM configuration (Vagrantfile) in source control.  Here’s an example of a Vagrantfile which starts with Ubuntu Precise and builds out the image using chef-solo:

    Vagrant.configure("2") do |config|
      The base operating system that you’ll start from
      config.vm.box = "precise64"
      config.vm.box_url = "http://files.vagrantup.com/precise64.box"
      If you install software using Git, you’ll want to forward your ssh key
      config.ssh.forward_agent = true
      We are using chef-solo as the “provisioner” to execute the configuration scripts.
      You can also use shell scripts, Puppet, SaltStack, etc.
      config.vm.provision :chef_solo do |chef|
      This configuration is specific to Chef. Other provisioners have their own options.
    	chef.roles_path = "roles"
    	chef.add_role 'myapp'
      end
    end 

    Your provisioner scripts (in this case, Chef) is where you will implement features on the VM like:

    • Installing and configuring 3rd party software packages
    • Downloading and installing your own company’s software, e.g. from Git
    • Applying system-wide configuration settings such as iptables, log rotation, syslog, etc
    • Installing any custom  SSL certificates that you may want the VM to trust

    Once you have scripts that build the virtual machine you want, and you’ve committed your code, it’s time to build an image candidate.

     

    Step 2: Building and Managing Images

    To build an image candidate, you’ll start over with a fresh virtual machine, run your scripts, and capture an image from it.

    Building an image is about the same as any other software “build” job; continuous integration tools like Jenkins are well-suited to this task. Create a Jenkins job to build your images. As you commit changes to your scripts, push to the source control repository and trigger the job which builds a new  image.  You can tag your images with build job number and other metadata.  This metadata will be very helpful as your image library grows. In particular, you’ll always need to be able to identify exactly which versions of your configuration scripts were used to build a specific image.

    Vagrant isn’t quite as good for building images as it is for launching and managing VMs, so for image building we will use a dedicated tool called Packer. Packer is a tool for creating identical machine images for multiple platforms from a single source configuration file.

    Packer can take your scripts and produce a variety of different images for platforms such as EC2, GCE, OpenStack, VirtualBox, Docker, Digital Ocean, and more. Packer’s JSON format has pretty much the same information as the Vagrantfile:

     {
      "variables": {
        "aws_account": "",
        "aws_region": "us-east-1",
        "ssh_username": "",
        "source_ami": "",
        "access_key_id": "{{env `AWS_ACCESS_KEY_ID`}}",
    	"secret_access_key": "{{env `AWS_SECRET_ACCESS_KEY`}}"
      },
      "builders": [
    	{
      	"type": "amazon-ebs",
          "ssh_timeout": "3m",
          "access_key": "{{user `access_key_id`}}",
          "secret_key": "{{user `secret_access_key`}}",
      	"region": "{{user `aws_region`}}",
          "ssh_username": "{{user `ssh_username`}}",
          "source_ami": "{{user `source_ami`}}",
          "instance_type": "m3.medium",
          "ami_name": "myapp-{{timestamp}}"
    	}
      ],
     
      "provisioners": [
    	{
      	"type": "chef-solo",
      	"roles_path": "roles",
          "cookbook_paths": ["vendor/cookbooks"],
          "run_list": [ "role[myapp]", "recipe[myapp::ami-cleanup]" ]
    	}
    }

     

    Step 3: Image Validation and Promotion

    Because your images aren’t exactly the same as the Vagrant environment that you used for developing configuration scripts, you need to perform software testing and quality assurance (QA) on each image candidate. Images that pass their tests will be promoted and released to downstream workflows (development/stage/production).

    This should sound like a familiar problem! Again, it’s well-suited to automated continuous integration systems like Jenkins. Like any other build job, your image-building job has a build number, can trigger downstream jobs (for performing QA on the image), and it can run promotion scripts. Use these facilities to validate your images, keep track of which ones have been fully tested, and tag them with important metadata such as the branch/sha of the scripts that built it.

    Conclusion

    With this “trusted” or “foundation” image you can easily create and push validated images to multiple cloud environments. This can alleviate the wait time of building and launching individual machines and the issues which can arrive with those repeated human components. And isn’t automation what DevOps is all about?

    Acknowledgements:  Kevin Gilpin, Hleb Rubanau, and Lucia Capano are coauthors on this post.

  • Let’s keep the countdown going: Reason #2 for StackStorm to join the fray

    Let’s keep the countdown going: Reason #2 for StackStorm to join the fray

    stackstorm-brandStackstorm is a new company focused on automation, operations and DevOps. It’s co-founder and CEO Evan Powell has been keeping a running journal as the company made ready to emerge from stealth. This is the 2nd in the series of posts from Powell’s thoughts and experiences as a new DevOps company comes to market.f


    In yesterday’s hello devopsy.kinsta.cloud – and “hello world”- post we put the 10-100x boost in productivity of the top DevOps operators in historical context.  It’s like software is catching up with Moore’s Law’s relentless beat of exponential progress all at once.  The shift is changing the world, has changed the world.

    However, there are barriers.  Like many technology life cycles, a fundamental limitation is us – the people involved in this transition.

    And that’s where driver #2 for us starting StackStorm comes in:

    There are not enough DevOps unicorns in the world – and there never will be.

    The ideal DevOps engineer is a full stack engineer who can code at least in python and is really good at cross-functional collaboration.  We are a magnet for this type of unicorn – we have hired a few and have a handful in our utterly kick-ass advisory board.

    However:

    a)  Being a full stack engineer is really, really hard; in my time leading Nexenta, we were happy to find someone who knew something about virtualization and could go deep on storage and while that is rare even that is not a full stack perspective.

    b)  To add to the job spec of being truly full stack to also know how to code well enough that your scripts work reliably and are trusted is extremely rare.

    c)  To then combine that with the personality types that seem to thrive in the “anti-siloed” world of DevOps is really, really rare.

    Folks that have attributes 1, 2 and 3 – and can lead teams to deliver cohesively – are worth their weight in gold. Software needs to step in here – to help extend and automate these full stack unicorn automators.

    As an aside, I may be biased because I have had the pleasure of leveraging DTRACE in Nexenta products over the years, but this has got to be the most awesome Unicorn image going:

    dtrace_pony_xray-2

    Automating all things is great.  Automating the automators is even better.  

    And that’s where we are headed.  That’s where the massive operators already are.  Amazon, Facebook, Google, PayPal and others have built systems and applied some level of machine learning to the operations systems to enable them to operate at scale and to capture improvements.  They’ve entered into a virtuous cycle.  Not surprisingly, the IP behind these operations systems is not freely shared with the outside world.  Components developed at Amazon and elsewhere may be shared, but the operations automation platforms and intelligence are rarely shared.

    That’s where we and the broader community come in.  Which leads to the next driver: the community.  I’ll discuss how OpenStack and the success of related communities led us to found StackStorm tomorrow.

    If you are interested in being invited to StackStorm’s private beta of our operations automation software – please register here: www.stackstorm.com/beta