[MUSIC PLAYING]
Thank you very, very much for
coming-- and watching online--
if you're here.
This is "Building
Physical Visualizations
for Cloud Services,"
or more aspirationally,
"Be a Cloud DJ."
So I'm going to misuse MIDI
controllers and electronics
and stuff to try to
visualize what's going
on in cloud systems today.
So what's the first thing
you think of when I say,
"dashboard"?
Take that image.
Put that in your head.
We're going to ask
the internet by proxy.
Do a search.
You know live search, right?
It's what you do at talks.
So this is what
the internet thinks
dashboards look like, right?
It's all these kinds of
computer screens and the like.
I want us to think back
more of the dashboards
that we first saw.
The computer
dashboards-- that's like
a metaphor for
actual dashboards,
and go out a little further.
Like control rooms--
you think about what
they use to fly to space
or run a nuclear plant.
They've got these amazing rooms
full of dials and screens,
and stuff.
Wouldn't you want
this for your app--
know exactly what's going on?
So we're going to talk
about that a little bit.
And, of course, we're going
to start with the gauge,
because this is kind of
the most fundamental thing.
And the big thing
I want to-- this
is not going to be like an
amazing, things you never
knew were possible before talk.
But it is way easier
than it used to be.
So that's the kind of
take-away from this-- making
ambient visual
versions of the stats
that you collect on
your applications
is way easier than it could be.
So this is a little analog
panel meter from Adafruit.
And what this looks like
from a code perspective
is pretty straightforward.
This is Python.
The main bit is right here.
We set PWM-- how often
the signal is up.
So we're giving it power, and
kind of more or less of that.
Let me actually just copy this.
And then we'll give this a try.
So there's this library
called, "Pi GPIO,"
and so a general purpose IO pin.
And then, of course, the
initialisation-- this
gets a little recursive.
It's pigpio.pi.
So we can kind of start and
end with the same thing.
And then-- actually,
if we can switch over
to this screen over here,
we've got a live panel meter,
where these meters set up.
And there we go.
That's all there.
And we give it a value
between 0 and [? 35, ?]
because that's the
natural state of numbers.
So we do that, and I hit Enter.
Whoo!
Isn't that amazing? [LAUGHING]
On some level, that's kind
of like, "yeah, whatever,"
but now I can put that in any
box or cardboard thing or hook
it up to any cloud
API or anything you're
gathering metrics on.
And you just feed it
numbers, and it moves around,
which-- I don't know.
[LAUGHING] I'm kind
of excited about this.
And so this is a little spike
that just kind of moves it
up and down as you go.
I think this is kind of the
fundamental, initial thing.
You can get pretty
far with this.
Like, think about
requests per second, CPU
usage, some sort of capacity
issue-- anything that's kind
of a proportion of a whole.
You can go pretty far with this.
So that's pretty
straightforward.
And what's going on
in the covers is,
there's a Raspberry Pi, which
I'll show you in a second.
And I've plugged in two
wires and a resistor,
and we're good to go.
So, pretty straightforward.
But I mentioned DJ, right?
So could we go a little
further than that?
I think we could.
We want to get closer to that
control room kind of idea.
And that means blinky lights.
We need lots of blinky lights.
And if there's anybody
who's good at blinky lights,
it's electronic
musicians and DJs.
If you look for
electronic instruments,
there's all kinds
of things out here.
And most of these
talk over a protocol
called MIDI, which is just
bytes sent over serial.
So it's either actual
serial cables or sort
of showing up as
USB, which means
we can talk kind
of bidirectionally
to all of these things.
So the keyboards can feed into
us, and the lights-- we can
light up from the computers.
I don't even know
what that is, but we
need to check it out later.
But I have one of these here.
And this is a launchpad.
And so we can connect
to that and actually
visualize, with our amazing,
high-density display
of eight-by-eight LEDs,
what's going on in the system.
And the system I'm
going to visualize
is Kubernetes,
because that's what
I work on the most these days.
It's amazing.
And if you're doing Docker
containers or containers
running a lot of machines,
definitely check it out.
That's not what this
talk is about, at all.
For the purpose of
this talk, you've
got a bunch of
computers, and you've
got programs running on them.
So you got processes
running on them, right?
And so, now, I
have an API to see
what processes are
running on which computer
and how loaded they are,
and all this kind of stuff.
We can come back over here.
Shall we live dangerously?
I wasn't kidding about
a resistor and wire.
We un-clip that guy.
And then, we've got a
launchpad hooked up.
And what you can't
see on my screen
is, Kubernetes has a command
line tool, where I can say,
hey, I'd like to run 10 copies
of this or 50 copies of this.
And right now, the cluster--
the visualization I've done
is, vertically,
we've got computers.
So this is representing
eight computers.
And there's two processes on
this one, and one on this one.
And good to go.
So I can say, oh my
gosh, our website's
gotten really busy-- I
actually want to run 25.
And I hit Enter.
And maybe this is an ambient
display up on a wall somewhere,
and every who walks by
is like, oh, hey, wow,
what's going on today?
And then, as it goes back down--
maybe it goes down to five--
and Kubernetes jumps up really
fast and then kind of goes
down a little more gradually.
So we can see that happening.
I actually have
learned something
about the way Kubernetes
manages processes--
super-active about
getting them started.
And then, they kind
of pick up there.
So already, I've
learned something.
I went down to five
this time, not three.
So that's fun.
And this also is
very straightforward.
There's a library
called, "Pi Launchpad."
You grab that, install a few
things, and you're good to go.
And the way you talk to
it is, there's an xy-grid,
and you just poke 1, 4.
Set that to green, set it
to red, and it lights up.
So, OK, what really happened
behind the scenes here, right?
Because, actually, when
I hit the button there,
I was actually logged in SSH
to a machine in the cloud,
talking with a command
line tool to an API.
I've got another process
that's watching-- actually,
I'm pulling, because I
did this last minute--
watching the Kubernetes
API for what happened,
and then updating the display
and pushing that to a message
queue, and then, on the
Raspberry Pi-- it's sitting,
waiting on the message
queue to see what happened.
So if any new messages
come in, it displays them.
When I hit Enter
there, that went,
Enter to SSH in the cloud, to
an API, something else that
read the API, put it
in a message queue,
came down through my phone,
wireless to the Raspberry Pi,
and lit up-- which is kind
of a lot of moving parts.
But because there's a message
queue in between these,
I can add more devices,
more visualizations.
You can have a web-based
version of this,
all hitting the same queue.
So you can kind of
publish your messages--
your stats-- into queues.
And then, various different
programs can listen to that
and see what's going on.
What else can we do with
eight-by-eight LEDs?
This is one of those design
constraints exercises,
in a way.
What I did here was
processes on computers.
I'm not really using the color.
We could imagine, for
example, each process--
how much of its assigned
CPU it was using.
It could go more to
the red or green.
You could arrange
things differently.
Kubernetes has this
idea of process groups
that it calls, "the
replication controller."
So instead of grouping by a
physical machine, which maybe
isn't so meaningful,
you could group
by logical parts of your
system-- or anything
that makes sense for your app.
And there's tons of other stuff.
One-- this device is
actually an input device.
It's a MIDI controller.
What needs to happen next?
Here's on my personal
aspirations list
for this stuff.
When you hit one of the
buttons, then it actually
sends a command back
up to the system.
And then, we can
kill that process.
And then it goes away.
So that one would go away.
And then, we've
got Chaos Monkey.
Have you guys heard
of Chaos Monkey?
You know, you've got
your cloud systems.
You've got some process that
runs and just deletes stuff
randomly so you make sure that
your system is actually robust?
And one of my colleagues
suggested this-- you actually
recruit a three-year-old
to play on your system,
and see whether it's
actually robust.
That would be crazy.
There's also other little RGB
LED displays that you can get,
and I was imagining a
handheld version of this
that you could carry
around with you.
And this morning, I built it.
So it totally exists.
This is a Raspberry Pi,
and it totally works here.
Let me bump this up to 25,
also going through my phone.
So hopefully, it'll come up.
And yay!
There's more going on.
So then, you can
set this anywhere.
You could walk up to
your colleague's desk
and be, like, so,
keep an eye on that.
Or what's going on here?
I don't know.
It's kind of crazy, but I
think that would be super fun.
And since I already had the
infrastructure in place,
these messages were
flowing, and I had
the rough code for an agent.
All I had to do is
swap the library out
for talking to that display
versus the launchpad.
And I actually did that
in the hotel this morning.
And then, there are all
kinds of different devices.
This is a different
MIDI controller.
And it's made to be your
faders for audio control.
But this could easily be
system controls, right?
Maybe you turn it up and down.
You want to get a feel for how
your system actually works.
You can have your
own control center.
That's actually the
crux of this talk.
Just think about
the things you have
and which of the
knobs-- because we
talk metaphorically about
knobs and dials on our systems
all the time, and
having displays,
and meters, and metrics.
Is there a place where it
would really make sense
to bring that out into
the physical world, where
people visiting your
office or colleagues
could actually interact with a
part of your system in a very
physical, real way?
And I guess that's kind
of the root of this.
For a little bit of inspiration,
let's-- if you do a search
on "MIDI controller,"
they're super diverse.
And, in a way, the MIDI protocol
is like so many other things
we use in software.
It's this real
time-evented system.
So you can wire all this up
into the rest of your systems
you're running.
So you can have keyboard-y
displays, these button kinds
of things, sliders and knobs.
This is a grid, but each grid
is sensitive to vibration
in each direction.
So you can do more
subtle things.
Anyway, give it a look.
Consider bringing your systems
out into the real world.
And that's it.
Thank you very much.
[APPLAUSE]
And I think-- oh, yeah.
We've got time for questions.
Did we have any Q&A?
And no.
OK, we're done.
Thank you very much.
[APPLAUSE]
[MUSIC PLAYING]
