SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
DOCKER @ FLUX7 LABS
DOCKER AUSTIN

FOR MORE DISCUSSIONS ON DOCKER!
Who am I?
● Aater Suleman
○ Part-time UT Professor
○ Geek, Architect, Developer, Ops, DevOps …

● Co-founder & CEO Flux7 Labs
○ DevOps Solutions
■ Deployments
■ Cost/performance optimized large scale
website (Ruby on rails, node.js, Django) and
Hadoop deployments
Four projects:
VyScale Dev Flow
Docker's impact on performance (whitepaper WIP)
Multi-tenancy
Live process migration using CRIU (criu.org)
Application: Single Service Provider
Internet of Things -- Solar Panel Monitoring

Receive
Sensor Data

XML Data
over TCP

Report
Generation
based on data

Big Data
Analytics

Report sent to
End User
Gateway3

sensors
Gateway1

Gateway2

Location1

Location3

Location2

Provider Span
A provider has Mifi routers installed at
multiple Locations which collect data from
sensors and sends it to a remote TCP
server via the internet.

Browser
Uses the Flask
app at port 80

Internet

Flask App
Port 80

TCP server
Port 6000

Cassandra
port 9160

Single Provider System
COMPONENTS

1. Cassandra for data persistence which we later use for generating reports
for each gateway.

2. A Twisted TCP server listening at PORT 6000, for data ingestion from
multiple gateways owned by the provider.

3. A Flask app serving at PORT 80 as the admin panel for setting
customizations and viewing reports.
Customer 1

G

Customer 2 …

Customer N

G

G

G

Each customer can have
multiple gateways
commissioned to them.

*G - Gateway

Remote Twister TCP Server
(Non–Blocking I/O)

Web App

Power consumption
status on website and
mails

Mailer

Cassandra NoSQL data store
(High Volume High Velocity Write
which scales Linearly across the
cluster )
SINGLE PROVIDER LAUNCH
For launching the single provider version, the following was done:

1. nohup python tcp_server.py & # For firing up the TCP server.
2. nohup python flask_app.py &

# For firing up the admin panel

Both these code bases houses hard-coded Cassandra KEYSPACE

Success!
Application: Multiple Service Providers

…
Provider 2 sends data to port
6002 and accesses flask app at
port 8082

Provider 1 sends
data to port 6001
and accesses flask
app at port 8081

Internet

TCP server containerruns at port 6000.
Exposes port 6000 and
published it to port 6001
for provider 1

Flask container-runs
flask app at port 80.
Exposes port 80 and
published it to port 8081
for provider 1

TCP server container-runs
at port 6000. Exposes
port 6000 and published it
to port 6002 for provider 2
Flask container-runs flask
app at port 80. Exposes
port 80 and published it to
port 8082 for provider 2

Cassandra
KNEE-JERK APPROACH
Sprinkle Tenant ID everywhere in the code and DB

Time consuming

Poor isolation
Security

Expensive

Maintenance
Rigidity
MULTIPLE HOST/VMS
An alternate solution is to use Virtual Machine (VM)

Hosts are expensive ($)
VMs are expensive (high overhead)
AND THE SOLUTION
WHY DOCKER?

Docker containers provide isolation that is
Fast

Inexpensive

How: Isolated environments for running multiple instances of the app
PLAN

Create a docker container for the new version of the app

Setup environments/dependencies correctly

Start a Cassandra container.
AUTOMATION
An automation was the next foreseeable step, and for that we found Docker-py
extremely useful. We used something like:
# Yes. We love Python!
def start_provider(provider_id, gateway_port, admin_port ):
docker_client = docker.Client(base_url='unix://var/run/docker.sock', version='1.6',
timeout=100)
# start a docker container for consuming gateway data at gateway_port
start_command = 'python software/remote_server.py ' + provider_id
remote_server = docker_client.create_container('flux7/labs', # docker image
command=start_command, # start command contains the keyspace parameter, keyspace is the
provider_id
name='remote_server_' + provider_id, # name the container, name is provider_id
ports=[(6000, 'tcp'),]) # open port for binding, remote_server.py listens at 6000
docker_client.start(remote_server, port_bindings={6000: ('0.0.0.0', gateway_port)},
links={'db': 'cassandra'})
# start a docker container for serving admin panel at admin_port
start_command = 'python software/flask_app.py ' + provider_id
remote_server = docker_client.create_container('flux7/labs', # docker image
command=start_command, # start command contains the keyspace parameter, keyspace is the
provider_id
name='admin_panel_' + provider_id, # name the container, name is provider_id
ports=[(80, 'tcp'),]) # open port for binding, remote_server.py listens at 6000
docker_client.start(remote_server, port_bindings={80: ('0.0.0.0',admin_port)}, links=
{'db': 'cassandra'})
OUR SOLUTION- EXPLAINED

For now, a locally running container serving at PORT 9160 using the command
similar to this:
docker run -d -p 9160:9160 -name db flux7/cassandra
OUR SOLUTION- EXPLAINED
▪ Create a keyspace ‘provider1’ using pycassaShell.
We fired up our two code bases on two separate containers like this:

docker run -name remote_server_1 -link db:cassandra p 6000:6000 flux7/labs python software/remote_server.
py provider1
docker run -name flask_app_1 -link db:cassandra -p
6000:6000 flux7/labs python software/flask_app.py
provider1
DOCKER ISSUES DISCOVERED

Docker does not support multiple instances of Cassandra running on the
same machine.

Hosting multiple database instances on a single machine can quickly
cause resource shortages
OUR SOLUTION
❑ Followed the traditional solution to make an application multi-tenant

Use of KEYSPACE as the namespace for each provider in the data store

Code Changes

Cassandra
KEYSPACE /
provider ID

•• To data ingestion server and web server by adding
the keyspace parameter to the DB accesses.

•• Passed to each instance of the app on the
command line.

❑ Each provider in the data store gets a separate namespace without making
any changes to the column family schema.
LESSONS WE LEARNED
1.

Docker is an extremely fast and elegant isolation framework: easy to
port, cheap to run, easy to orchestrate

2.

Multi-tenancy != changing the app to support multiple tenants

3.

Docker orchestration frameworks are not at par with Docker today.
What we have written is yet another one but for multi-tenancy.

4.

Dockerfiles still need work -- we used shell scripts in some places

5.

We can run multiple commands/container
DOCKER AUSTIN

FOR MORE DISCUSSIONS ON DOCKER!

Contenu connexe

Tendances

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJustyna Ilczuk
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmMario IC
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloudLadislav Prskavec
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on DockerRightScale
 
Docker with openstack
Docker with openstackDocker with openstack
Docker with openstackLiang Bo
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on RailsMuriel Salvan
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016Walid Shaari
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker ComposeMario IC
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...Sébastien Portebois
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaGiovanni Toraldo
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with dockerMaciej Lukianski
 
From Docker Run To Docker Compose
From Docker Run To Docker ComposeFrom Docker Run To Docker Compose
From Docker Run To Docker ComposeFitra Aditya
 

Tendances (20)

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker Swarm
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
How to easy deploy app into any cloud
How to easy deploy app into any cloudHow to easy deploy app into any cloud
How to easy deploy app into any cloud
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
The state of the swarm
The state of the swarmThe state of the swarm
The state of the swarm
 
Docker with openstack
Docker with openstackDocker with openstack
Docker with openstack
 
Ruby and Docker on Rails
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on Rails
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker compose
Docker composeDocker compose
Docker compose
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker Compose
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
From Docker Run To Docker Compose
From Docker Run To Docker ComposeFrom Docker Run To Docker Compose
From Docker Run To Docker Compose
 

Similaire à Docker Multi-Tenant IoT

Practical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingPractical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingDocker, Inc.
 
Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Codemotion
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesPaul Czarkowski
 
Docker Internet Money Gateway
Docker Internet Money GatewayDocker Internet Money Gateway
Docker Internet Money GatewayMathieu Buffenoir
 
Network Design patters with Docker
Network Design patters with DockerNetwork Design patters with Docker
Network Design patters with DockerDaniel Finneran
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsSjuul Janssen
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetesLiran Cohen
 
Docker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker ContainersDocker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker ContainersHugo Henley
 
Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerJorge Juan Mendoza
 
Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Dan Mackin
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 PresentationSreenivas Makam
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...Guillaume Morini
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12dotCloud
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on OpenstackDocker, Inc.
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)DynamicInfraDays
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015Patrick Chanezon
 
Managing multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerManaging multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerThierry Gayet
 

Similaire à Docker Multi-Tenant IoT (20)

Practical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingPractical Design Patterns in Docker Networking
Practical Design Patterns in Docker Networking
 
Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Docker Internet Money Gateway
Docker Internet Money GatewayDocker Internet Money Gateway
Docker Internet Money Gateway
 
Docker img-no-disclosure
Docker img-no-disclosureDocker img-no-disclosure
Docker img-no-disclosure
 
Network Design patters with Docker
Network Design patters with DockerNetwork Design patters with Docker
Network Design patters with Docker
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
Docker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker ContainersDocker Workshop - Orchestrating Docker Containers
Docker Workshop - Orchestrating Docker Containers
 
Simplify Networking for Containers
Simplify Networking for ContainersSimplify Networking for Containers
Simplify Networking for Containers
 
Building a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in dockerBuilding a sdn solution for the deployment of web application stacks in docker
Building a sdn solution for the deployment of web application stacks in docker
 
Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)Docker Networking - Boulder Linux Users Group (BLUG)
Docker Networking - Boulder Linux Users Group (BLUG)
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015Docker Platform and Ecosystem Nov 2015
Docker Platform and Ecosystem Nov 2015
 
Managing multicast/igmp stream on Docker
Managing multicast/igmp stream on DockerManaging multicast/igmp stream on Docker
Managing multicast/igmp stream on Docker
 

Dernier

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Dernier (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic 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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Docker Multi-Tenant IoT

  • 2. DOCKER AUSTIN FOR MORE DISCUSSIONS ON DOCKER!
  • 3. Who am I? ● Aater Suleman ○ Part-time UT Professor ○ Geek, Architect, Developer, Ops, DevOps … ● Co-founder & CEO Flux7 Labs ○ DevOps Solutions ■ Deployments ■ Cost/performance optimized large scale website (Ruby on rails, node.js, Django) and Hadoop deployments
  • 4. Four projects: VyScale Dev Flow Docker's impact on performance (whitepaper WIP) Multi-tenancy Live process migration using CRIU (criu.org)
  • 5. Application: Single Service Provider Internet of Things -- Solar Panel Monitoring Receive Sensor Data XML Data over TCP Report Generation based on data Big Data Analytics Report sent to End User
  • 6. Gateway3 sensors Gateway1 Gateway2 Location1 Location3 Location2 Provider Span A provider has Mifi routers installed at multiple Locations which collect data from sensors and sends it to a remote TCP server via the internet. Browser Uses the Flask app at port 80 Internet Flask App Port 80 TCP server Port 6000 Cassandra port 9160 Single Provider System
  • 7. COMPONENTS 1. Cassandra for data persistence which we later use for generating reports for each gateway. 2. A Twisted TCP server listening at PORT 6000, for data ingestion from multiple gateways owned by the provider. 3. A Flask app serving at PORT 80 as the admin panel for setting customizations and viewing reports.
  • 8. Customer 1 G Customer 2 … Customer N G G G Each customer can have multiple gateways commissioned to them. *G - Gateway Remote Twister TCP Server (Non–Blocking I/O) Web App Power consumption status on website and mails Mailer Cassandra NoSQL data store (High Volume High Velocity Write which scales Linearly across the cluster )
  • 9. SINGLE PROVIDER LAUNCH For launching the single provider version, the following was done: 1. nohup python tcp_server.py & # For firing up the TCP server. 2. nohup python flask_app.py & # For firing up the admin panel Both these code bases houses hard-coded Cassandra KEYSPACE Success!
  • 11. Provider 2 sends data to port 6002 and accesses flask app at port 8082 Provider 1 sends data to port 6001 and accesses flask app at port 8081 Internet TCP server containerruns at port 6000. Exposes port 6000 and published it to port 6001 for provider 1 Flask container-runs flask app at port 80. Exposes port 80 and published it to port 8081 for provider 1 TCP server container-runs at port 6000. Exposes port 6000 and published it to port 6002 for provider 2 Flask container-runs flask app at port 80. Exposes port 80 and published it to port 8082 for provider 2 Cassandra
  • 12. KNEE-JERK APPROACH Sprinkle Tenant ID everywhere in the code and DB Time consuming Poor isolation Security Expensive Maintenance Rigidity
  • 13. MULTIPLE HOST/VMS An alternate solution is to use Virtual Machine (VM) Hosts are expensive ($) VMs are expensive (high overhead)
  • 15. WHY DOCKER? Docker containers provide isolation that is Fast Inexpensive How: Isolated environments for running multiple instances of the app
  • 16. PLAN Create a docker container for the new version of the app Setup environments/dependencies correctly Start a Cassandra container.
  • 17. AUTOMATION An automation was the next foreseeable step, and for that we found Docker-py extremely useful. We used something like: # Yes. We love Python! def start_provider(provider_id, gateway_port, admin_port ): docker_client = docker.Client(base_url='unix://var/run/docker.sock', version='1.6', timeout=100) # start a docker container for consuming gateway data at gateway_port start_command = 'python software/remote_server.py ' + provider_id remote_server = docker_client.create_container('flux7/labs', # docker image command=start_command, # start command contains the keyspace parameter, keyspace is the provider_id name='remote_server_' + provider_id, # name the container, name is provider_id ports=[(6000, 'tcp'),]) # open port for binding, remote_server.py listens at 6000 docker_client.start(remote_server, port_bindings={6000: ('0.0.0.0', gateway_port)}, links={'db': 'cassandra'}) # start a docker container for serving admin panel at admin_port start_command = 'python software/flask_app.py ' + provider_id remote_server = docker_client.create_container('flux7/labs', # docker image command=start_command, # start command contains the keyspace parameter, keyspace is the provider_id name='admin_panel_' + provider_id, # name the container, name is provider_id ports=[(80, 'tcp'),]) # open port for binding, remote_server.py listens at 6000 docker_client.start(remote_server, port_bindings={80: ('0.0.0.0',admin_port)}, links= {'db': 'cassandra'})
  • 18. OUR SOLUTION- EXPLAINED For now, a locally running container serving at PORT 9160 using the command similar to this: docker run -d -p 9160:9160 -name db flux7/cassandra
  • 19. OUR SOLUTION- EXPLAINED ▪ Create a keyspace ‘provider1’ using pycassaShell. We fired up our two code bases on two separate containers like this: docker run -name remote_server_1 -link db:cassandra p 6000:6000 flux7/labs python software/remote_server. py provider1 docker run -name flask_app_1 -link db:cassandra -p 6000:6000 flux7/labs python software/flask_app.py provider1
  • 20. DOCKER ISSUES DISCOVERED Docker does not support multiple instances of Cassandra running on the same machine. Hosting multiple database instances on a single machine can quickly cause resource shortages
  • 21. OUR SOLUTION ❑ Followed the traditional solution to make an application multi-tenant Use of KEYSPACE as the namespace for each provider in the data store Code Changes Cassandra KEYSPACE / provider ID •• To data ingestion server and web server by adding the keyspace parameter to the DB accesses. •• Passed to each instance of the app on the command line. ❑ Each provider in the data store gets a separate namespace without making any changes to the column family schema.
  • 22. LESSONS WE LEARNED 1. Docker is an extremely fast and elegant isolation framework: easy to port, cheap to run, easy to orchestrate 2. Multi-tenancy != changing the app to support multiple tenants 3. Docker orchestration frameworks are not at par with Docker today. What we have written is yet another one but for multi-tenancy. 4. Dockerfiles still need work -- we used shell scripts in some places 5. We can run multiple commands/container
  • 23. DOCKER AUSTIN FOR MORE DISCUSSIONS ON DOCKER!