Who am I?

Description
  • Tomaz Muraus (Kami)
  • Engineer at StackStorm
  • Previously: Cloudkick, Rackspace, DivvyCloud
  • Likes: Distributed systems, infrastructure, open standards and open source systems, startups, tinkering / "hacking" 80's music, working out

DevOps

What is DevOps?

Description
source: http://blog.sei.cmu.edu/post.cfm/devops-agile-317

What is DevOps?

Description
source: http://www.edureka.co/blog

What is DevOps?

  • Bridging the gap between developers and operations
  • Cultural and organization shift
  • A lot of shared values and principles with agile
  • In the end (final goal), it's all about making customers happy

DevOps benefits

  • Faster iteration
  • Smaller changes, less impact
  • Happier customers / user

StackStorm

What is StackStorm?

  • Platform for integration and automation across services and tools
  • Allows you to take actions in response to events
  • IFTTT for operations
  • Open source, Apache 2.0 licensed
  • Primarily targeted towards DevOps and SREs
  • It's all code! (and some YAML)

What is StackStorm?

Description
source: http://expertintegratedsystemsblog.com

Clients

StackStorm - CLI

Description

StackStorm - WebUI

Description

StackStorm - Programming Language Clients

pip install st2client

from st2client.client import Client

client = Client()

actions = client.actions.get_all()
print(actions)
...

npm install st2client

var st2client = require('st2client');

var client = st2client(config);
var auth = st2client.authenticate(config.credentials.user,
                                  config.credentials.password);

auth.then(function onAuth() {
  console.log(st2client.actions.list());
});
...

ChatOps

ChatOps

  • Conversation driven development
  • All the information and context you need in your chat
  • Execute tasks / retrieve information directly from the chat
  • Transparency
  • Save time
  • Chat bots - Hubot, Lita, Err, etc.

ChatOps - Bots

Description

ChatOps - Command and Control Example

Description

ChatOps - Notifications / Context Example

Description

StackStorm Use Cases

Advanced CI / CD

Description

Advanced CI / CD

Description

Advanced CI / CD

Description

Advanced CI / CD

Facilitated Troubleshooting

Description

Closed Loop Remediation

Description

Using StackStorm for Security Automation

Description

StackStorm - Terminology and Concepts

  • Sensors - Inbound integrations (events)
  • Triggers - Contain information about a particular event
  • Actions - Outbound integrations
  • Workflows - Allow you to perform complex bussines logic
  • Rules - Wire together triggers and actions
  • Timers - Allow you to run action on a pre-defined time interval or on a specific date

StackStorm - Terminology and Concepts

Description

StackStorm - Sample Sensor

...
    def _handle_pubmsg(self, connection, event):
        trigger = 'irc.pubmsg'
        payload = {
            'source': {
                'nick': event.source.nick,
                'host': event.source.host
            },
            'channel': event.target,
            'timestamp': event.timestamp,
            'message': event.arguments[0]
        }
        self._sensor_service.dispatch(trigger=trigger, payload=payload)
...
{
    "source": {
        "nick": "Kami__",
        "host": "gateway/web/irccloud.com/x-uvv"
    },
    "channel": "#test989",
    "timestamp": 1419166748,
    "message": "this is a test message"
}

StackStorm - Sample Action

Send an email using Mailgun API.

import httplib
import requests
from st2actions.runners.pythonrunner import Action

SEND_EMAIL_API_URL = 'https://api.mailgun.net/v2/%(domain)s/messages'

class SendEmailAction(Action):
    def run(self, sender, recipient, subject, text, html=None):
        domain = self.config['domain']
        api_key = self.config['api_key']
        data = {
            'from': sender,
            'to': recipient,
            'subject': subject,
            'text': text
        }
        if html:
            data['html'] = html

        api_url = SEND_EMAIL_API_URL % {'domain': domain}
        response = requests.post(api_url, auth=('api', api_key), data=data)
        return response.status_code == httplib.OK

StackStorm - Sample Action

Send an email using Mailgun API.

#!/usr/bin/env bash

API_KEY=$1
DOMAIN=$2
SENDER=$3
RECIPIENT=$4
SUBJECT=$5
MESSAGE=$6

curl -X POST -H "Content-Type: application/json" --user "api:key-${API_KEY}" \
  https://api.mailgun.net/v2/${DOMAIN}/messages \
  -d '{"from": "${SENDER}", "to": "${RECIPIENT}", "subject": "${SUBJECT}", "message": "${MESSAGE}"}'

StackStorm - Sample Rule

Relay messages from IRC channel to Slack.

---
  name: "relayed_matched_irc_message"
  description: "Relay IRC message to Slack if the message contains word StackStorm"
  enabled: true

  trigger:
    type: "irc.pubmsg"
    parameters: {}

  criteria:
      trigger.message:
          type: "icontains"
          pattern: "StackStorm"

  action:
    ref: "slack.post_message"
    parameters:
        message: "{{trigger.source.nick}} on {{trigger.channel}}: {{trigger.message}}"
        channel: "#irc-relay"

StackStorm - Existing Integrations

Description

StackStorm - Existing Integrations

Description

StackStorm - Existing Integrations

Description
source: http://expertintegratedsystemsblog.com

Autoscale Demo

Autoscale Demo - Flow

Description

Autoscale Demo - Used Packs

  • core
  • st2
  • rackspace
  • newrelic
  • debian
  • chef
  • slack

Autoscale Demo

Roadmap

  • Improved ChatOps support (ChatOps as a first-class citizen)
  • Windows runners
  • Runner affinity
  • Reliability and scale improvements
  • RBAC
  • ...
  • Your ideas and contributions are welcome!

Go Check it Out / Learn More

Thank You!