bots are taking my job, so i started rollin my own

63
Infracoders Meetup GRAZ 21. February 2017

Upload: juergen-brueder

Post on 22-Jan-2018

1.108 views

Category:

Internet


0 download

TRANSCRIPT

Infracoders Meetup GRAZ21. February 2017

Infracoders

• Infrastructure Automation

• Technologies: Chef, Puppet, Docker, Jenkins etc.

• Exchange of ideas

• Tips & tricks

• Networking

Leitnergasse 16, 8010 Graz | www.infralovers.com

Plan for the future

• Revive Infracoders Meetups

• Every 6 weeks

• Cooperation

• Give a speech

• Contact: linkedin.com/in/theresa-wallas

[email protected]

Leitnergasse 16, 8010 Graz | www.infralovers.com

Agenda

• 19:00-20:00 Talk, Questions & Answers

• 20:00-21:00 Networking

• Drinks are sponsored by Infralovers

• Additional drinks at the bar

Leitnergasse 16, 8010 Graz | www.infralovers.com

Bots are taking my job,so I started rollin’ my own…

About me

• Jürgen Brüder (@jaybrueder)

• Senior IT-Consultant at Infralovers

• Trainer at Commandemy

• Before that, I did Start-Ups

• Barcamp-Graz Orga

Leitnergasse 16, 8010 Graz | www.infralovers.com

Infralovers

• IT-Consultancy for over 13 years

• CEO is Edmund Haselwanter

• Customers include Telekom Austria, Sony NetServices,

SAP, GE Capital to mention a few

• Our focus: IT-Infrastructure, Cloud and Automation

Leitnergasse 16, 8010 Graz | www.infralovers.com

• We also love to teach

• Our courses include topics like OpenStack, AWS, Jenkins,

Ruby, Chef, BDD, Kubernetes, Docker etc.

• Tech that we actually use as Consultants

• http://commandemy.com

Leitnergasse 16, 8010 Graz | www.infralovers.com

Agenda

• The problem we needed to solve

• ChatBots and ChatOps

• How we solved the problem

• Live-Demo

• Q&A

Leitnergasse 16, 8010 Graz | www.infralovers.com

Customer story

Moving to the cloud

• For two years we accompanied a customer on his move to

the cloud (Amazon Web Services)

• Speed up deployments

• Create an automated deployment pipeline

• Reducing manual labour and human error

Leitnergasse 16, 8010 Graz | www.infralovers.com

What is a Deployment?

“The process of uploading a new version of software to a server”

Communication is key

• 5 enterprise applications moved so far

• Each having it’s own remote developer team…

• in 4 different countries (AT, DE, FIN, UK)

• All managed by a couple of people in Austrian HQ

Leitnergasse 16, 8010 Graz | www.infralovers.com

We did interviews

• Where are the pain points?

• What can we help improve?

• What works? What does not?

• How do employees feel about moving to the cloud?

Leitnergasse 16, 8010 Graz | www.infralovers.com

Answers

• We want as little operations as possible

• We want to know what is going on all the time

• Developers rely heavily on other people to deploy

• Management does not appreciate what we do

• More tools are good, but can we trust our employees?

Leitnergasse 16, 8010 Graz | www.infralovers.com

Goals

• We wanted to give people the power to deploy as often as they needed to

• No access to deployment tools, except chat

• Visibility and common history

• Increase management appreciation

Leitnergasse 16, 8010 Graz | www.infralovers.com

ChatOps

ChatOps

• A collaboration model that connects people, tools,

processes, and automation into a transparent workflow

• It’s all about conversation

• It’s basically your whole company happening inside a chat

tool

Leitnergasse 16, 8010 Graz | www.infralovers.com

You already use it with your friends

• Sending SMS or WhatsApp messages instead of calling

• Discussing important news inside Facebook comments

• You probably chat with your co-workers through Skype

• Are you still using E-Mails?

Leitnergasse 16, 8010 Graz | www.infralovers.com

ChatOps in the enterprise

• Using a chat tool is pretty common in the enterprise

(Skype, Jabber)

• Employees chatting with each other is normal

• But does your IT infrastructure also chat with you?

• Can you chat with your IT infrastructure?

Leitnergasse 16, 8010 Graz | www.infralovers.com

What do we see?

• Channels for each project

• Direct reference of co-worker

• External systems posting channel relevant messages

(Trello, Mailchimp)

• Interaction with Trello post

Leitnergasse 16, 8010 Graz | www.infralovers.com

Interacting with IT is changing

• Human to human interaction is driven by communication

• Human to machine interaction used to be driven by buttons

• With ChatOps, we can also communicate with machines and

tools

• But not all tools are ChatOps ready yet…

Leitnergasse 16, 8010 Graz | www.infralovers.com

http://nordicapis.com/12-frameworks-to-build-chatops-bots/

ChatOps Tools

Things to remember

• Never share confidential data through a ChatOps tool

• Mattermost is self-hosted, other tools are not

• External tools often integrate with Slack/Mattermost out-

of-the-box

Leitnergasse 16, 8010 Graz | www.infralovers.com

It’s not all sunshine and flowers

• Info diet

• Wiki / Documentation becomes “look into the chat history”

• Danger of being always “on”

• Ding, ding, ding – Notification hell

Leitnergasse 16, 8010 Graz | www.infralovers.com

I recommend this GitHub repo

• https://github.com/buritica/collaboration-guides

• Guidelines for Effective Collaboration

• Has a lot of great info about when to message, who to

message and when a phone call is a better idea

Leitnergasse 16, 8010 Graz | www.infralovers.com

ChatBots

What is a ChatBot?

• Software that can respond to your text messages

• Should “mimic” conversation with people using artificial

intelligence

• Can take action according to your wishes

• “Claire, book me a flight to San Francisco tomorrow”

Leitnergasse 16, 8010 Graz | www.infralovers.com

Why should you care?

• StartUp Buzzword of the year

• Will play a role in IT-Automation

• Do you like terminal windows? You’ll love bots!

• Consumer vs. Business

• Integrate a bot into your ChatOps tool

Leitnergasse 16, 8010 Graz | www.infralovers.com

Our solution

What we implemented

• ChatOps was a big part of solving our customers problem

• We created our own bot that joins the conversation

• The bot is able to interact with the deployment pipeline

• Employees are able to interact with the bot

• They are not able to interact with the deployment pipeline

directly

Leitnergasse 16, 8010 Graz | www.infralovers.com

Rollin our own…

• Our own bot is running on the Lita bot framework

• Extended by writing custom plugins

• Using the Ruby programming language

• Listens in on Slack (like a user)

• Triggers deployments with Jenkins

• Actually, we implemented two bots!

Leitnergasse 16, 8010 Graz | www.infralovers.com

via Bot

Why Lita?

• We really like Ruby

• At the time a very advanced bot framework

• Great Slack integration

• Plugins are like Ruby Gems

• Easiest to customize for us Rubyists

• We also use other Ruby tools in the deployment pipeline

Leitnergasse 16, 8010 Graz | www.infralovers.com

There are other bot options

Did you say two bots?

• We have one bot for each “environment”

• One for staging

• One for production

• Reason: Security

• We called them “Marvin” and “Bender”

Leitnergasse 16, 8010 Graz | www.infralovers.com

Bot Security

• Marvin is only allowed to deploy to staging

• All developers can communicate with Marvin

• Bender does “the heavy lifting” in production

• Only selected users can trigger production deployments

• We can grant and revoke deployments rights on a per user

basis

Leitnergasse 16, 8010 Graz | www.infralovers.com

The Bot and Jenkins

• The bot runs on the same instance as Jenkins does

• No cross-network triggering of jobs

• Jenkins dashboard is only accessible via SSH tunnel

• Jenkins gives job info to the bot, the bot posts it in Slack

• The bot is like a proxy.

• Ability to add more tools later (e.g. GitLab, GitHub)

Leitnergasse 16, 8010 Graz | www.infralovers.com

What other magic do we use?

• Amazon EC2 & Elastic Beanstalk (depends on app)

• Amazon CloudFormation for orchestration

• Amazon Lambda for serverless code execution

• Chef for Configuration Management

• Artifactory for artifact storage

• Datadog for monitoring

• GitLab for source control management

• Jenkins for continuous deployment

• There a also tools for a ”per app” basis (e.g. RunScope)

Leitnergasse 16, 8010 Graz | www.infralovers.com

Demo

Lessons learned

Leitnergasse 16, 8010 Graz | www.infralovers.com

• Empowering for the developers

• Removed unnecessary human interaction in deployments

• There is still QA going on (staging vs production)

• Management sees work happening

• Common place for information

What the future holds

Leitnergasse 16, 8010 Graz | www.infralovers.com

• Two-Factor Auth with Smartwatch (https://duo.com/)

• Amazon Alexa

• Google Assistant

• Apple Siri

• Using a more advanced bot as basis (Cog)

You want to learn more?

Leitnergasse 16, 8010 Graz | www.infralovers.com

We offer courses on

• ChatOps and custom bots

• Amazon Web Services

• Jenkins

• Chef

• Automated Workflows

• http://commandemy.com

We are [email protected]

Time for Q&[email protected]

Where can we find the demo code?

Leitnergasse 16, 8010 Graz | www.infralovers.com

https://github.com/infralovers/chatops-demo-cookbook

https://github.com/infralovers/chatops-demo-lita-plugin

References

Leitnergasse 16, 8010 Graz | www.infralovers.com

https://github.com/operable/cog

https://github.com/github/hubot

https://www.lita.io/

https://github.com/errbotio/errbot

https://github.com/buritica/collaboration-guides