Apply ''ChatOps'' for a Cheap Ticket to DevOps
Apply ''ChatOps'' for a Cheap Ticket to DevOps
See how Errbot, Python, and automation create a chat that enables and drives DevOps at your organization.
Join the DZone community and get the full member experience.Join For Free
Despite the fact the history of DevOps started in 2009, there are still companies that are just now considering adopting DevOps. It is very important that the process be as smooth as possible because it affects the speed of transformation, its success, and people's willingness to be involved in the process. A crucial step is attraction of the silent majority.
"Build Critical Mass and Silent Majority: In the next phase, we seek to expand DevOps practices to more teams and value streams with the goal of creating a stable base of support. By working with teams who are receptive to our ideas, even if they are not the most visible or influential groups, we expand our coalition who are generating more successes, creating a “bandwagon effect” that further increases our influence. We specifically bypass dangerous political battles that could jeopardize our initiative." -The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations:
A chat plays a key role here. First of all, people within the company use the chat for communication, including non-IT people. This means DevOps achievements are visible to everyone. We can find references to this in The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations: "Regardless of how we scope our initial effort, we must demonstrate early wins and broadcast our successes."
Unfortunately, ChatOps is not something we can start with. We need to solve many small tasks before ChatOps becomes possible. Imagine you have managed to prepare automation for everything and your CI/CD is almost perfect. However, only a tight circle of IT specialists can appreciate the result. This is the right moment when the chat can make your work visible, can demonstrate the pros of DevOps and can help decrease fear of deployments. Here's an interesting fact from The DevOps Handbook:
Unlike at Facebook where deployments are managed by release engineers, at Etsy deployments are performed by anyone who wants to perform a deployment, such as Development, Operations, or Infosec. The deployment process at Etsy has become so safe and routine that new engineers will perform a production deployment on their first day at work—as have Etsy board members and even dogs!
A bot is present in the chat room together with people. Now, it is not a simple chat, it is a log file with dates and times which can be used in post-mortems. Again quoting The DevOps Handbook:
Having this work performed by automation in the chat room (as opposed to running automated scripts via command line) had numerous benefits, including:
• Everyone saw everything that was happening.
• Engineers on their first day of work could see what daily work looked like and how it was performed.
• People were more apt to ask for help when they saw others helping each other.
• Rapid organizational learning was enabled and accumulated.
I hope we have reached the moment when nobody doubts that ChatOps is at least helpful and a DevOps-ish thing. Let's get to the technical part. I really want to share very technical details with you, but I understand that 99% of them are applicable only to my project. You probably noticed that most articles about ChatOps contain almost no tech details, but I am going to write at least something.
Personally, I like the following combination of buzzwords you can Google:
Although Errbot is in the second position, it is probably the most important player. This is the guy you will be talking to, and you have to do your best to teach him as many things as possible. Unfortunately, it requires Python knowledge. Only imagine what you can do with python. Python + boto gives you power over AWS. Python + google-api-python-client lets you work with Google calendar. Python + urllib means you can communicate with Jenkins. I am sure that Python + python-consul also can be useful and so on, and so on...
ChatOps is not an easy thing, regardless of what other specialists write, but it is worth every man-day you spend implementing it. In my case, the result was exactly as described in “The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations.” This is the reason why I am writing this article.
I wrote a plugin for errbot which
- Checks if a microservice can be released. There are a couple of reasons why a release might fail. One of the reason is SNAPSHOT dependencies (in Java projects). Another one is that the pipeline has not finished successfully.
- Schedules release and deploy
- Updates the team's Google calendar.
- Reminds developers to review and merge all git PRs to meet a deadline.
- Releases and deploys the app.
As I said, I wrote the plugin. Actually, I wrote two plugins. One of them is "assistant" - "master" and the other is "worker." "Assistant" deals with dates and times. It does nothing except for sending commands to "worker" on time.
Here are materials you can start with:
User guide: This is your starting point for Errbot.
Remote access API: This link is here because interaction with Jenkins assumes getting and parsing requests. To make your life easier, Jenkins can return JSON.
Parameterized build: Here you can read how to start a Jenkins job remotely.
Calendar API: Get familiar with the Google API.
Opinions expressed by DZone contributors are their own.