SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
CORWIN ONCORWIN ON
CONTAINERSCONTAINERS
WHO AM I?WHO AM I?
Corwin Brown
But you can call me Kory.
Traditionally come from a DevOps background.
Worked at places like:
Rackspace
Fitbit
Plus a bunch of places you haven't heard of.
Currently a Full-Stack Developer at BloomReach here in
Dallas.
WHAT ARE WE TALKING ABOUTWHAT ARE WE TALKING ABOUT
TODAY?TODAY?
CONTAINERS!CONTAINERS!
What is Containerization?
The History fo Containers.
How containers work.
Process Namespaces.
Control Groups.
How we can use containers here at BloomReach.
Questions at marked sections.
QUICK ASIDE ON DEVOPSQUICK ASIDE ON DEVOPS
"DevOps is about recognizing that the
backing infrastructure is not separate from
your application, but rather a vital part of
it."
CONTAINERSCONTAINERS
LINUX CRASH COURSELINUX CRASH COURSE
Everything in Linux is a file.
Network sockets.
Hardware devices.
etc
User space:
The Section of system memory that User Processes run
in.
Contrasted with Kernel space, where the Kernel
executes processes.
CONTAINERSCONTAINERS
WHAT IS CONTAINERIZATION?WHAT IS CONTAINERIZATION?
OS feature that allows for the existance of multiple
isolated User Spaces.
These user-space slices are known as containers.
Each container is made aware of only specific
resources.
A container can contain anything from a single running
process to an entire operating system.
VERY SIMILAR TO VIRTUALVERY SIMILAR TO VIRTUAL
MACHINESMACHINES
But no need to maintain a bunch of different OS installs.
No backups.
No policies around backups.
No upgrades.
No patches.
etc
Ship your application's context alongside your
application.
CONTAINERS TEND TO BE LIGHTERCONTAINERS TEND TO BE LIGHTER
THAN VMSTHAN VMS
Each VM would require significant overhead that comes
with running an OS.
Both in compute resources, and human time.
Allows you to efficiently bin-pack resources onto a
machine.
HISTORY OFHISTORY OF
CONTAINERSCONTAINERS
CHROOTCHROOT
"Change-Root"
Provided file system isolation.
Convinces a process its root directory is something
other than "/".
FREEBSD JAILS AND SOLARIS ZONESFREEBSD JAILS AND SOLARIS ZONES
File system and network isolation
Zones also provided also snapshots courtesy of ZFS.
LXCLXC
Originally the backend for Docker.
Generally works closer to a traditional Virtual Machine.
Generally runs an entire OS.
Produced containers tend to be less portable than Docker.
Designed to be a lightweight system, as opposed to a
lightweight service.
DOCKERDOCKER
Currently the most popular container engine.
Succeeded largely because of it's focus on ecosystem.
RKTRKT
Potentially the future.
Takes a lot of Docker concepts, and improves upon them.
Follows a more Linux-like process model.
Built to strongly adhere to the Open Container
Standard, but also be backwards compatible with
Docker.
As a drop in replacement, has a lot of potential promise
for the future.
HOW DO CONTAINERSHOW DO CONTAINERS
WORK?WORK?
PROCESS NAMESPACESPROCESS NAMESPACES
CONTROL GROUPS (CGROUPS)CONTROL GROUPS (CGROUPS)
PROCESS NAMESPACESPROCESS NAMESPACES
Allows the Kernel to isolate and virtualize system
resources.
Seven Namespaces:
mnt
pid
net
ipc
UTS
user
cgroup
EXAMPLEEXAMPLE
Instead of communicating with eth0:
Create a virtual interface.
Present that to a process instead of the hardware.
Allows for each container to be walled off from the
hadware.
Allows for each container to have it's own networking
information.
CONTROL GROUPSCONTROL GROUPS
Developed at Google in 2006 and merged into the Linux
Kernel in 2007.
Feature that limits, accounts for, and isolates system
resources.
Provides:
Resource limiting.
Prioritization.
Accounting.
Control.
CGROUP IMPLEMENTATIONCGROUP IMPLEMENTATION
Like most things with Linux, CGroups are represented on
the file system.
In Ubuntu 16.04, they exist at "/sys/fs/cgroup".
CGROUP FILESYSTEMCGROUP FILESYSTEM
CGROUP MEMORY LIMITINGCGROUP MEMORY LIMITING
CREATE NEW CGROUPCREATE NEW CGROUP
cgcreate -g memory:test_cgroup
SEE THE NEW GROUP!SEE THE NEW GROUP!
INSIDE THE NEW CGROUPINSIDE THE NEW CGROUP
IN SUMMARYIN SUMMARY
Process Namespaces: Control what you can see.
Control Groups: Control what you can do.
FURTHER READINGFURTHER READING
Mocker
https://github.com/tonybaloney/mocker
WHAT CAN YOU DOWHAT CAN YOU DO
WITH CONTAINERS?WITH CONTAINERS?
TESTING NEW TECHNOLOGIESTESTING NEW TECHNOLOGIES
Wanted to try out a monitoring backend for an alerting
service.
I'd used Prometheus in the past, and was interested in
testing it out.
... but I really didn't want to set it all up locally or maintain
a VM for ten minutes of vetting.
IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE
$ docker run --rm -p9090:9090
prom/prometheus
DEVELOPING WITH SPECIFICDEVELOPING WITH SPECIFIC
DEPEDENCIESDEPEDENCIES
Project requires Postgres 9.6.
Not interested in installing Postgres locally.
What if I need a different version later?
Maintaining different installs is a pain.
I don't want my laptop chugging to run a database
when I don't need it.
IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE
$ docker run --rm postgres:9.6.6
POSTGRESQL (CONTD)POSTGRESQL (CONTD)
Still need psql to interact with PostgreSQL.
Still have to install junk on my laptop.
...Or do you?
POSTGRESQL (CONTD)POSTGRESQL (CONTD)
I can spin up a container with PostgreSQL...
I can spin up a container with PSQL...
... and I can link them with a "Docker network".
IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE
$ docker network create dbnet
$ docker run --rm --net dbnet --name db postgres:9.6.6
$ docker run --rm --net dbnet -it postgres:9.6.6 psql -h db -U postgr
POSTGRESQL (CONTD)POSTGRESQL (CONTD)
Actual workflow we use:.
To get a development environment setup, do the
following:
1. Open the src directory in a terminal.
2. Run some Make commands.
IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE
$ make postgres-start
$ make populate-postgres
$ make postgres-shell
TESTINGTESTING
Can be difficult to test data oriented so ware.
Tends to lead to lots of Mocks...
... at which point you o en end up just checking if the
"return" keyword works.
Uness of course your tests involve spinning up a database
and checking against real data.
IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE
$ make test
TESTING (CONTD)TESTING (CONTD)
This test process sets up a local PostgreSQL instance.
Including populating it with data.
Runs tests inside a container linked to that database.
Bam, testing against a production-ish database.
More over, a good end to end test you can run on Jenkins.
FRONTEND TESTINGFRONTEND TESTING
These workflows can benefit frontend developers too!
Spin up headless Chrome in a container and run end to
end tests!
Spin up a framework like Zalenium!
This one actually records and outputs video of test
failures!
BUILDINGBUILDING
Let's say you're running into problems with the bulid
machine.
You don't have access to make changes on that box.
Just build your application inside a container you DO have
control over.
DevStudio builds it's Javascript bits in a container.
THE FUTURETHE FUTURE
Imagine we get out of the business of running EC2
instances.
Batch jobs are just scheduled to run in our
Kubernetes/Mesos cluster.
Autoscale the number of container's deployed for any
service.
Deployments are less "Run this fabric script", more "Tell
Kubernetes to ensure X instances are running".
Get out of the business of maintaining servers, and into
the business of running services.
Ensure we get the box utilzation we pay for.
Datacenter as an Operating System
QUESTIONS?QUESTIONS?

Más contenido relacionado

La actualidad más candente

Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Jérôme Petazzoni
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applicationsTerry Chen
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
Securing Containers, One Patch at a Time - Michael Crosby, Docker
Securing Containers, One Patch at a Time - Michael Crosby, DockerSecuring Containers, One Patch at a Time - Michael Crosby, Docker
Securing Containers, One Patch at a Time - Michael Crosby, DockerDocker, Inc.
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Jérôme Petazzoni
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...Puppet
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by DockerTerry Chen
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of usJérôme Petazzoni
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Carlos Sanchez
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDocker, Inc.
 
Docker at Spotify
Docker at SpotifyDocker at Spotify
Docker at SpotifyRohan Singh
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Ruoshi Ling
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersAnthony Chu
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveKazuto Kusama
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Puppet
 
The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)Casey Bisson
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with dockerJohan Janssen
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza Batel Zohar Tova
 

La actualidad más candente (20)

Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)Immutable infrastructure with Docker and containers (GlueCon 2015)
Immutable infrastructure with Docker and containers (GlueCon 2015)
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Securing Containers, One Patch at a Time - Michael Crosby, Docker
Securing Containers, One Patch at a Time - Michael Crosby, DockerSecuring Containers, One Patch at a Time - Michael Crosby, Docker
Securing Containers, One Patch at a Time - Michael Crosby, Docker
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Develop QNAP NAS App by Docker
Develop QNAP NAS App by DockerDevelop QNAP NAS App by Docker
Develop QNAP NAS App by Docker
 
Docker: automation for the rest of us
Docker: automation for the rest of usDocker: automation for the rest of us
Docker: automation for the rest of us
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Docker at Spotify
Docker at SpotifyDocker at Spotify
Docker at Spotify
 
Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨Docker 初探,實驗室中的運貨鯨
Docker 初探,實驗室中的運貨鯨
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
 
The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)The Lies We Tell Our Code (#seascale 2015 04-22)
The Lies We Tell Our Code (#seascale 2015 04-22)
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza
 

Similar a Corwin on Containers

codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014Carlo Bonamico
 
Linux containers & Devops
Linux containers & DevopsLinux containers & Devops
Linux containers & DevopsMaciej Lasyk
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container RevolutionRomain Dorgueil
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Ricardo Amaro
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJérôme Petazzoni
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecturejoaquincasares
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next GenerationTravis Thieman
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapPatrick Chanezon
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesJérôme Petazzoni
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Henryk Konsek
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...Shakacon
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesNicola Ferraro
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 

Similar a Corwin on Containers (20)

codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Linux containers & Devops
Linux containers & DevopsLinux containers & Devops
Linux containers & Devops
 
Docker and the Container Revolution
Docker and the Container RevolutionDocker and the Container Revolution
Docker and the Container Revolution
 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
 
Dev Environments: The Next Generation
Dev Environments: The Next GenerationDev Environments: The Next Generation
Dev Environments: The Next Generation
 
Docker intro
Docker introDocker intro
Docker intro
 
Docker 101
Docker 101 Docker 101
Docker 101
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 

Último

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Último (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Corwin on Containers

  • 2. WHO AM I?WHO AM I? Corwin Brown But you can call me Kory. Traditionally come from a DevOps background. Worked at places like: Rackspace Fitbit Plus a bunch of places you haven't heard of. Currently a Full-Stack Developer at BloomReach here in Dallas.
  • 3. WHAT ARE WE TALKING ABOUTWHAT ARE WE TALKING ABOUT TODAY?TODAY?
  • 4. CONTAINERS!CONTAINERS! What is Containerization? The History fo Containers. How containers work. Process Namespaces. Control Groups. How we can use containers here at BloomReach. Questions at marked sections.
  • 5. QUICK ASIDE ON DEVOPSQUICK ASIDE ON DEVOPS
  • 6. "DevOps is about recognizing that the backing infrastructure is not separate from your application, but rather a vital part of it."
  • 8. LINUX CRASH COURSELINUX CRASH COURSE Everything in Linux is a file. Network sockets. Hardware devices. etc User space: The Section of system memory that User Processes run in. Contrasted with Kernel space, where the Kernel executes processes.
  • 10. WHAT IS CONTAINERIZATION?WHAT IS CONTAINERIZATION? OS feature that allows for the existance of multiple isolated User Spaces. These user-space slices are known as containers. Each container is made aware of only specific resources. A container can contain anything from a single running process to an entire operating system.
  • 11. VERY SIMILAR TO VIRTUALVERY SIMILAR TO VIRTUAL MACHINESMACHINES But no need to maintain a bunch of different OS installs. No backups. No policies around backups. No upgrades. No patches. etc Ship your application's context alongside your application.
  • 12. CONTAINERS TEND TO BE LIGHTERCONTAINERS TEND TO BE LIGHTER THAN VMSTHAN VMS Each VM would require significant overhead that comes with running an OS. Both in compute resources, and human time. Allows you to efficiently bin-pack resources onto a machine.
  • 14. CHROOTCHROOT "Change-Root" Provided file system isolation. Convinces a process its root directory is something other than "/".
  • 15. FREEBSD JAILS AND SOLARIS ZONESFREEBSD JAILS AND SOLARIS ZONES File system and network isolation Zones also provided also snapshots courtesy of ZFS.
  • 16. LXCLXC Originally the backend for Docker. Generally works closer to a traditional Virtual Machine. Generally runs an entire OS. Produced containers tend to be less portable than Docker. Designed to be a lightweight system, as opposed to a lightweight service.
  • 17. DOCKERDOCKER Currently the most popular container engine. Succeeded largely because of it's focus on ecosystem.
  • 18. RKTRKT Potentially the future. Takes a lot of Docker concepts, and improves upon them. Follows a more Linux-like process model. Built to strongly adhere to the Open Container Standard, but also be backwards compatible with Docker. As a drop in replacement, has a lot of potential promise for the future.
  • 19. HOW DO CONTAINERSHOW DO CONTAINERS WORK?WORK?
  • 20. PROCESS NAMESPACESPROCESS NAMESPACES CONTROL GROUPS (CGROUPS)CONTROL GROUPS (CGROUPS)
  • 21. PROCESS NAMESPACESPROCESS NAMESPACES Allows the Kernel to isolate and virtualize system resources. Seven Namespaces: mnt pid net ipc UTS user cgroup
  • 22. EXAMPLEEXAMPLE Instead of communicating with eth0: Create a virtual interface. Present that to a process instead of the hardware. Allows for each container to be walled off from the hadware. Allows for each container to have it's own networking information.
  • 23. CONTROL GROUPSCONTROL GROUPS Developed at Google in 2006 and merged into the Linux Kernel in 2007. Feature that limits, accounts for, and isolates system resources. Provides: Resource limiting. Prioritization. Accounting. Control.
  • 24. CGROUP IMPLEMENTATIONCGROUP IMPLEMENTATION Like most things with Linux, CGroups are represented on the file system. In Ubuntu 16.04, they exist at "/sys/fs/cgroup".
  • 26. CGROUP MEMORY LIMITINGCGROUP MEMORY LIMITING
  • 27. CREATE NEW CGROUPCREATE NEW CGROUP cgcreate -g memory:test_cgroup
  • 28. SEE THE NEW GROUP!SEE THE NEW GROUP!
  • 29. INSIDE THE NEW CGROUPINSIDE THE NEW CGROUP
  • 30. IN SUMMARYIN SUMMARY Process Namespaces: Control what you can see. Control Groups: Control what you can do.
  • 32. WHAT CAN YOU DOWHAT CAN YOU DO WITH CONTAINERS?WITH CONTAINERS?
  • 33. TESTING NEW TECHNOLOGIESTESTING NEW TECHNOLOGIES Wanted to try out a monitoring backend for an alerting service. I'd used Prometheus in the past, and was interested in testing it out. ... but I really didn't want to set it all up locally or maintain a VM for ten minutes of vetting.
  • 34. IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE $ docker run --rm -p9090:9090 prom/prometheus
  • 35. DEVELOPING WITH SPECIFICDEVELOPING WITH SPECIFIC DEPEDENCIESDEPEDENCIES Project requires Postgres 9.6. Not interested in installing Postgres locally. What if I need a different version later? Maintaining different installs is a pain. I don't want my laptop chugging to run a database when I don't need it.
  • 36. IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE $ docker run --rm postgres:9.6.6
  • 37. POSTGRESQL (CONTD)POSTGRESQL (CONTD) Still need psql to interact with PostgreSQL. Still have to install junk on my laptop. ...Or do you?
  • 38. POSTGRESQL (CONTD)POSTGRESQL (CONTD) I can spin up a container with PostgreSQL... I can spin up a container with PSQL... ... and I can link them with a "Docker network".
  • 39. IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE $ docker network create dbnet $ docker run --rm --net dbnet --name db postgres:9.6.6 $ docker run --rm --net dbnet -it postgres:9.6.6 psql -h db -U postgr
  • 40. POSTGRESQL (CONTD)POSTGRESQL (CONTD) Actual workflow we use:. To get a development environment setup, do the following: 1. Open the src directory in a terminal. 2. Run some Make commands.
  • 41. IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE $ make postgres-start $ make populate-postgres $ make postgres-shell
  • 42. TESTINGTESTING Can be difficult to test data oriented so ware. Tends to lead to lots of Mocks... ... at which point you o en end up just checking if the "return" keyword works. Uness of course your tests involve spinning up a database and checking against real data.
  • 43. IN CASE OF DEMO FAILUREIN CASE OF DEMO FAILURE $ make test
  • 44. TESTING (CONTD)TESTING (CONTD) This test process sets up a local PostgreSQL instance. Including populating it with data. Runs tests inside a container linked to that database. Bam, testing against a production-ish database. More over, a good end to end test you can run on Jenkins.
  • 45. FRONTEND TESTINGFRONTEND TESTING These workflows can benefit frontend developers too! Spin up headless Chrome in a container and run end to end tests! Spin up a framework like Zalenium! This one actually records and outputs video of test failures!
  • 46. BUILDINGBUILDING Let's say you're running into problems with the bulid machine. You don't have access to make changes on that box. Just build your application inside a container you DO have control over. DevStudio builds it's Javascript bits in a container.
  • 47. THE FUTURETHE FUTURE Imagine we get out of the business of running EC2 instances. Batch jobs are just scheduled to run in our Kubernetes/Mesos cluster. Autoscale the number of container's deployed for any service. Deployments are less "Run this fabric script", more "Tell Kubernetes to ensure X instances are running". Get out of the business of maintaining servers, and into the business of running services. Ensure we get the box utilzation we pay for. Datacenter as an Operating System