Nuka

Libérez le devops qui est en vous

images/pycon.svg

A propos

Histoire

Existant

Le choix

images/choice.jpg

Photo by Martin Fisch, CC via Flickr

La douleur

images/pain.jpg

Photo by Thomas Hawk, CC via Flickr

Le bricolage

images/repair.jpg

Photo by (Mick Baker)rooster, CC via Flickr

You see the light

images/light.jpg

Photo by Stuart Williams, CC via Flickr

DIY!

POC

How it works (1/2)

How it works (1/2)

Hosts

A task

# -*- coding: utf-8 -*-
from nuka.task import Task


class mytask(Task):

    def do(self):
        res = self.sh(['ls', '/var'])
        return dict(res, changed=1)

    def diff(self):
        res = self.sh(['ls', '/var'])
        diff=self.texts_diff('', res['stdout'])
        return dict(res, diff=diff)

Task

Use it (1/2)

#!bin/python
import nuka
from nuka.hosts import DockerContainer

from tasks import mytask


async def do_tasks(host):
    res = await mytask()
    print(res.stdout)

nuka.run(do_tasks(DockerContainer('pyconfr')))

Use it (1/2)

$ pip install nuka
$ pip install nuka[full]
$ pip install \
  -e git+git@github.com:bearstech/nuka.git#egg=nuka[full]

$ python do_task.py -h

Gantt

images/gantt.png

Use cases

Pourquoi c’est lent ?

images/why.jpg

Photo by Tintin44, CC via Flickr

Perfs

% ./list_hosts | ./benches.py -q -d .01

Got 296 valid results for 296 hosts in 15.19s

                 min       max       avg     count
connect     0.000009  0.000057  0.000012       296
auth_time   0.185978  9.049197  7.170807       296
timeouts    0.000000  0.000000  0.000000       296

Status

Known issues