Programming for Hostile Environments Our adversary: bare metal - - PowerPoint PPT Presentation

programming for hostile environments
SMART_READER_LITE
LIVE PREVIEW

Programming for Hostile Environments Our adversary: bare metal - - PowerPoint PPT Presentation

Programming for Hostile Environments Our adversary: bare metal infrastructure June 2018 About Me Nathan Goulding, SVP Engineering ~15 years frontline engineer for infrastructure/cloud and media companies Currently lead engineering team at


slide-1
SLIDE 1

Programming for Hostile Environments

Our adversary: bare metal infrastructure

June 2018

slide-2
SLIDE 2

About Me Nathan Goulding, SVP Engineering

~15 years frontline engineer for infrastructure/cloud and media companies Currently lead engineering team at Packet me = n+3

@NathanGoulding / nathan@packet.net

slide-3
SLIDE 3

APP

What Packet Does

“serverless”

(still runs on a server)

CONTAINER HYPERVISOR SERVERS We automate bare metal, physical infrastructure Founded in 2014 by infrastructure geeks Over 15,000 users x86 and ARM CPU architectures 16 locations around the world 20 supported operating systems 50,000 installs per month

@NathanGoulding / nathan@packet.net

slide-4
SLIDE 4

“DRIVERLESS”

@NathanGoulding / nathan@packet.net

slide-5
SLIDE 5

Programming for Hostile Environments

@NathanGoulding / nathan@packet.net

Topics we’ll cover: Transitioning from monolith (ruby) to microservices (golang) Turning antipatterns into patterns Applied best practices Goals we set for ourselves Ephemeral nanoservices

slide-6
SLIDE 6

@NathanGoulding / nathan@packet.net

Hostility of the Environment

APP CONTAINER HYPERVISOR SERVER

slide-7
SLIDE 7

packet.net / @packethost

The Problem, Abstract

slide-8
SLIDE 8

REST API

PORTAL

Datacenter #2

Out-of-band DHCP Power Control VPN Metadata OS Images Bare metal racks

IPAM

Datacenter #1

DNS

Out-of-band DHCP Power Control VPN Metadata OS Images Bare metal racks

@NathanGoulding / nathan@packet.net

slide-9
SLIDE 9

From monolith to microservices

API

Internal and External Services

Client Portal

Device, Project, Billing, Token Management

SOREN Sflow Agg & Analysis NARWHAL Physical Switch Automation S.O.S Serial Console Out of Bound Access DOORMAN Customer Backend VPN MAGNUM IP Multi-Tenant IPAM PB&J Power and Boot Control TINKERBELL DHCP & iPXE Server KANT EC2 Style Metadata OSIE In Memory Installation Environment PENSIEVE Forward and rDNS @NathanGoulding / nathan@packet.net

slide-10
SLIDE 10

Moving to golang

@NathanGoulding / nathan@packet.net

Compiled Static typing Very little “magic” The best of prior programming languages minus the cruft

slide-11
SLIDE 11

An emerging pattern

slide-12
SLIDE 12

@NathanGoulding / nathan@packet.net

An emerging pattern

slide-13
SLIDE 13

Best Practices, in Practice

#1 - gRPC for communication / rpc #2 - Get your data as close to where you need it as quickly as possible #3 - Don’t hide code you don’t like

@NathanGoulding / nathan@packet.net

slide-14
SLIDE 14

#1 gRPC for communication / rpc

packet.net / @packethost

Handles backoff / retry Straightforward service definition for request / response Streaming data and authentication via SSL Paradigm for dealing with message format changes

slide-15
SLIDE 15

#2 Get data close to where it needs to be, quickly

packet.net / @packethost

The network is unreliable, the network is unreliable, the network is unreliable Speed up access times + experience for everyone Be careful of “I’ll just request it (remotely) whenever I need it”

slide-16
SLIDE 16

#3 Don’t hide code you don’t like

packet.net / @packethost

Don’t use interfaces / providers to hide code you wish didn’t exist Use drivers / implementations where it counts

slide-17
SLIDE 17

Why Does it Matter?

@NathanGoulding / nathan@packet.net

slide-18
SLIDE 18

Goal #1: Can we provision in under 60 seconds?

@NathanGoulding / nathan@packet.net

slide-19
SLIDE 19

Provisioning Timing Distribution

@NathanGoulding / nathan@packet.net

slide-20
SLIDE 20

Provisioning Timeline

@NathanGoulding / nathan@packet.net

slide-21
SLIDE 21

@NathanGoulding / nathan@packet.net

slide-22
SLIDE 22

Ephemeral Nanoservices

@NathanGoulding / nathan@packet.net

Function Job Nanoservice Microservice Monolith Ephemeral ✓ ✓ ✓ ✕ ✕ Encapsulated ✓ ✓ ✓ ✓ ✕ Logging ? ✓ ✓ ✓ ✓ Complex tasks ✕ ✓ ✓ ✓ ✓ Monitored ✕ ✕ ✓ ✓ ✓

slide-23
SLIDE 23

Nanoservice Use Cases

@NathanGoulding / nathan@packet.net

Services that have complex tasks or functionality to perform, and... Need to communicate with other services, and... Need to be kept up and running, but... Will never be used past their “life” Analogy: an ephemeral nanoservice is an “instantiation” of a microservice

slide-24
SLIDE 24

Goal #2: Can we go a full day without a single provisioning failure?

@NathanGoulding / nathan@packet.net

slide-25
SLIDE 25

@NathanGoulding / nathan@packet.net

slide-26
SLIDE 26

What’s next?

#1 - Flexible workflows via directed graphs #2 - Distributed tracing for service logs

@NathanGoulding / nathan@packet.net

slide-27
SLIDE 27

Q&A

(we're hiring)

@NathanGoulding / nathan@packet.net