6 DevOps automation techniques to maximize productivity
DevOps practices can help to introduce quality, process, and standardization in all stages of your software development lifecycle (SDLC).
Whether you’re a small startup or a multibillion-dollar company, utilizing automation in your DevOps strategy goes a long way in saving valuable time for your team. However, knowing what part of your process to focus on can be challenging.
In this article, we'll introduce DevOps automation and walk through six important DevOps automation techniques that can massively scale up your professional or personal projects:
- Containerize your applications
- Separate deployment from release
- Integrate quality checks as early as possible
- Automate observability
- Focus on elasticity
- Orchestrate your containers
What is DevOps automation?
DevOps automation describes leveraging technology to perform recurrent tasks that are normally completed manually by a human. Repetitive, laborious tasks are prime candidates for automation. Programmatically handing off these tasks to a computer can save your team a lot of time and be a huge boost to morale, eliminating some of the mundane duties your team may dread getting roped into. There are a vast number of tasks that can be automated. A few simple but common examples include:
- Database backups
- Updating schemas for documents
- Importing historical data
- Integrating source control
- Monitoring query health and reporting on it
- Incident reporting and management
- Restarting microservices
- Upgrading services
- Provisioning new servers
- Changing network policies
Of all the automation strategies out there, we've chosen six key techniques to cover based on the following criteria:
- They are relatively simple while still high impact.
- They are generic and apply to almost any team or company.
- They are common best practices in the SDLC.
- They will help you complete your tasks faster and with a high degree of accuracy.
Let's get right into it! The first automation technique we'll discuss is containerizing your applications.
1. Containerize your applications
Interoperating between machine setups, operating systems, or environments has always been a nightmare for development teams. Trying to run code written on a Mac on a Windows box is infuriating—while the code “just works” on one system, it won’t even compile on the other. If you’ve faced similar issues, you may benefit from using containerization more often.
What is containerization?
Containers allow you to “abstract away” software dependencies, machine setups, or libraries and just focus on writing code. Containerization can be utilized in many ways: your configuration, the applications you write, or the infrastructure you’re running.
There are a number of benefits to containerizing your applications. Some of the most notable include:
- When onboarding new developers you can focus on helping them understand the codebase rather than sinking time into setting up their machines and dealing with software dependencies.
- Your containers are more reliable, granting you the assurance that they won’t blow up the moment they move into the production environment.
- Containers make it easy for your whole development team to collaborate better, allowing everyone (regardless of machine) to contribute effectively.
Even better, once your applications are containerized, you can take advantage of a host of automations on top of them such as:
- Running automated tests on the containers in your CI/CD pipelines.
- Automating deployment of changes to the codebase (from staging to release, for example).
- Pushing your container automatically into a central container registry.
2. Separate deployment from release
Releasing “Big Bang” is often a headache. A Big Bang release occurs when a team works for several weeks to months on a massive project with the intention of going live all at once (rather than launching incremental releases of smaller, new features). Often times releases that can't be broken up into smaller, more modular releases result in sleepless nights, quality issues, and developers working around the clock when it comes to support.
Many developers see little difference between moving code to production and customers running the new updated code. However, these events can (and should) be separate events and as loosely coupled as possible. You can release your code in a “switched off” state, essentially leaving it running in production but not yet “activated.”
Decoupling your deployment from your release completely changes the release process, allowing you to “turn off” parts of your code if you face an issue in production. Being able to rapidly remove issues on-site with a back door like this means that you can debug things more effectively and without these issues having harmful downstream effects on your customers, for example.
Enacting these changes essentially incorporates feature flags into your systems, giving you a very easy “off” switch in case you run into incidents or critical bugs on-site. A feature flag is a mechanism used in the software development world to turn certain features of your project on and off remotely and without the need for deployment.
3. Integrate quality checks as early as possible
Automating quality gates in your codebase ensures you are constantly shipping performant, scalable, and maintainable code. You can set yourself up for success by integrating these checks into your systems as early as possible.
There are a number of processes and health checks your code can run through inside your pipelines including:
- Enabling automatic linting to ensure standardization across the codebase
- Running smoke tests before your code is committed to ensure your acceptance criteria has been met
- Automatically generating documentation to aid developers who need to support the new feature
- Running integrated tests to ensure your deployment has been successful
- Calculating cyclomatic complexity per release to ensure the code is readable and discoverable
- Completing compilation/transpilation steps to ensure good cross-compatibility with older browsers (for example)
- Running simple unit tests to ensure nothing has been broken in the new work
Enforcing these checks helps ensure high-quality code and ultimately supports all kinds of important metrics such as bug/error count in the code, retention rates, bounce rates, and session duration.
4. Automate observability
Observability is the ability to measure the internal state of your system by examining its outputs.
Knowing every minuscule data point, bug, bottleneck, and unintended side effect in your code would be wonderful but is incredibly hard to do. When you have a simple system, doing so is easier, but as you add things like multiple time zones, complex features, multiple languages, and more complicated architecture, this level of insight becomes almost impossible.
However, by creating goals around metrics inside your code, you can ensure high quality on an automated schedule.
For instance, large tech companies typically create error log counts in their codebase, and if those thresholds get worse per release, they automatically roll back the code. This is the power that observability can give you: an incredibly detailed, focused view on the health of your system, however your company decides to measure it. Perhaps you want to ensure your API can still perform the same (or better) under a load test per release, or maybe you simply want to closely monitor error log counts from your users—either way, observability can help you gain a clear bird’s-eye view of your system. It allows you to prioritize issues in your codebase before they become critical and to deliver rapidly, increasing both the pace and frequency of your releases thanks to a broad understanding of what is happening in your code.
5. Focus on elasticity
Trying to estimate your customer load is difficult. You may face random spikes or prolonged quiet periods making it challenging to accurately assess. You want to avoid having a track record of common outages and a perception that your site is buggy. One solution for this is autoscaling.
Autoscaling is a DevOps automation concept that allows you to dynamically scale your load. Being able to grow and shrink resources as necessary will help stop your system from crashing as well as save you money in the long run.
For instance, AWS’s Auto Scaling service monitors your application and automatically adjusts its capacity to maintain predictable performance. This can turn the manual task of installing servers on your private cloud into an effortless automation that is managed by code monitoring the resources you consume on your behalf.
6. Orchestrate your containers
Employing too many manual tasks in your software ecosystem is counterproductive, but it happens all the time.
To save your developers and company time and money, you can use a container orchestration tool like Kubernetes to automate the management of many tasks like the following:
- Distributing your containers
- Scheduling your containers
- Scaling your containers
- Monitoring container health (or self-healing)
- Automating deployments
- Configuring secrets
Kubernetes can automate a huge portion of the lifecycle your infrastructure will go through and can immediately fix potential issues before they become big problems.
DevOps automation with Airplane
As we've discussed, automation is a crucial part of any SDLC. In most software systems there are hundreds of individual tasks to keep track of. Automation helps to simplify, improve, and assist these types of processes. One platform that can help incorporate automation techniques into your DevOps strategy is Airplane.
Airplane is a developer platform for building internal tools. You can transform scripts, queries, APIs, and more into apps for your team. For example, Airplane can help you separate your deployments from your releases by enabling you to implement feature flags into your codebase. Airplane also provides a number of enterprise-grade features out of the box to make building business-critical workflows quick and easy. Some of these include:
- Granular permissions and approval flows
- Schedules to automatically run jobs on a recurring cadence without having to maintain cron or Airflow
- Audit logs
- Alerts and notifications
- Integrations with Slack, GitHub, and more
Getting started with Airplane takes just a few minutes. You can sign up for a free account to try it out today!
Author: Kealan Parr
Kealan is a senior software engineer and technical writer who is passionate about software development. He is a member of the Unicode Consortium, non-profit corporation devoted to developing, maintaining, and promoting software internationalization standards and data.
Subscribe to new blog posts from Airplane: