school ofengineering andnatural sciences, university ...€¦ · school ofengineering andnatural...

24
PARALLEL & SCALABLE MACHINE LEARNING & DEEP LEARNING Prof. Dr. – Ing. Morris Riedel Adjunct Associated Professor School of Engineering and Natural Sciences, University of Iceland Research Group Leader, Juelich Supercomputing Centre, Germany Docker and Container Management November 22 th , 2018 Room Endurmenntun – Naustið Cloud Computing & Big Data SHORT LECTURE 12

Upload: others

Post on 20-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

PARALLEL & SCALABLE MACHINE LEARNING & DEEP LEARNING

Prof. Dr. – Ing. Morris RiedelAdjunct Associated ProfessorSchool of Engineering and Natural Sciences, University of IcelandResearch Group Leader, Juelich Supercomputing Centre, Germany

Docker and Container ManagementNovember 22th, 2018Room Endurmenntun – Naustið

Cloud Computing & Big Data

SHORT LECTURE 12

Page 2: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Review of Lecture 11 – Data Analytics & Cloud Data Mining

Data Analytics & Clustering

Short Lecture 12 – Docker and Container Management

Association Rule Mining

Collaborative Filtering

(causality vs. correlation) (unsupervised learning)

[1] An Introduction to Statistical Learning

(role of parameter k & uncertainty)

(visualization helps in unsupervised learning)

[2] Jupyter Web page [3] scikit-learn Web page

(news articles, blogs, twitter, shoping baskets, online advertising, etc.)

HDInsight[4] Azure HDInsight Web page

[5] Apache Spark2 / 24

Page 3: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Outline of the Course

1. Cloud Computing & Big Data

2. Machine Learning Models in Clouds

3. Apache Spark for Cloud Applications

4. Virtualization & Data Center Design

5. Map-Reduce Computing Paradigm

6. Deep Learning driven by Big Data

7. Deep Learning Applications in Clouds

8. Infrastructure-As-A-Service (IAAS)

9. Platform-As-A-Service (PAAS)

10. Software-As-A-Service (SAAS)

Short Lecture 12 – Docker and Container Management

11. Data Analytics & Cloud Data Mining

12. Docker & Container Management

13. OpenStack Cloud Operating System

14. Online Social Networking & Graphs

15. Data Streaming Tools & Applications

16. Epilogue

+ additional practical lectures for our

hands-on exercises in context

Practical Topics

Theoretical / Conceptual Topics3 / 24

Page 4: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Short Lecture 12 – Docker and Container Management

Outline

This is only a Short Lecture Goal is to provide a few pointers to other

advanced related university courses/topics ‘Docker & Container Management’

needs a full course & substantial tutorial Links previous Lectures & Practical Lectures

with further material to study & research

Docker & Container Management Cloud Service Challenge & Docker Container Virtualization vs. Container Approaches Kubernetes & Apache Mesos Tools AWS & Google & MS Azure Cloud Examples Apache Mesos AirBNB Example

Promises from previous lecture(s):

Lecture 5: Lecture 12 provides details on containers & Docker used in cloud computing for machine learning

Lecture 8: Lecture 12 provides more details about containers, images, and registries including tool Docker

Lecture 9: Lecture 12 provides more details about Kubernetes, containers & registries including tool Docker

4 / 24

Page 5: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Docker & Container Management

Short Lecture 12 – Docker and Container Management 5 / 24

Page 6: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Cloud service customers pay for? Hardware, storage, network (e.g. AWS IAAS, cf. Lecture 8) General software elements (e.g. GAE PAAS elements, cf. Lecture 9) Service: the heart of the cloud offering (apps & added-value, cf. Lecture 10)

Revisited: What is Cloud Computing from 10.000 ft?

Short Lecture 12 – Docker and Container Management

[6] Distributed & Cloud Computing Book

Challenge: Service development typically means wasting hours setting up remote developer environments, intalling and configuring required software libraries, system tools, spinning up new instances (e.g. EC2 AWS compute instances) and making copies of production code to run locally

Motivation: Need for a tool that bundles all dependencies/configurations & make remote runs easy

(service-oriented platform with virtualized resources)

(desktops)

(laptops)

(powered by global data centers)

6 / 24

Page 7: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Docker Tool – Container & Images

Known for ‘containerization of software‘ Docker container enable a software to be ready-to-run ‘Container images‘ contain everything that is needed to run:

source code, runtime, system tools, specific libraries, data, … Enables flexibility and portability

on where the application softwareis able to run (‘towards a standard‘)

E.g. same docker image can run onAmazon Web services, GoogleCloud platform, or Microsoft Azure

Short Lecture 12 – Docker and Container Management

[7] Docker Web page

The core idea of Docker is to provide a software container with all required software elements that guarantees that the application within the software container will always run the same way, regardless of the environment it is running in or which cloud infrastructure is used underneath

Docker is an open-source tool that automates the deployment of applications within so-called software containers that can be bundled as a Docker image and broadly used in Clouds today

(Note: there is also a commercial Docker Enterprise version)

7 / 24

Page 8: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Docker Tool – Docker Hub Repositories Example

Docker community image repository 100,000+ free applications in

public and private registries Find and pull images from community and official libraries Manage, push to, and pull from private image libraries Automatically create new images (e.g. changes via source code repository) E.g. tools for developer-test pipeline automation or applications for users

Short Lecture 12 – Docker and Container Management

[8] Docker Hub Web page

(Apache Web serverfor developing anddeploying Web services,e.g. REST, SOAP, etc.)

(Statistical Computing withR software ready to use fordata analysis, data mining,and machine learning, etc.)

8 / 24

Page 9: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Using VMs (cf. Lecture 4) Approach for Docker hosts to run on Hypervisors Deployment approach is transparent for Docker Engine

Interaction with VM software E.g. App 4 running as isolated application on the Docker Engine can

interact with a database that is hosted in the ‘pure VM‘ (not in container)

Container Approaches using Virtualization – Docker Example

Short Lecture 12 – Docker and Container Management

[7] Docker Web page

(practice: by mixing Docker hosts with traditional VMssystem administrators get a better resource utilization)

(traditional VM)

9 / 24

Page 10: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Virtualization (high storage footprint) VMs include application, binaries, libraries and an

entire guest operating system (~tens of GBs)

Containers (low storage footprint, vendor-lock free) Include application, all dependencies, runs isolated, but share kernel of

the operating system with other containers (vendor independence )

Virtualization vs. Container Approaches – Docker Example

Short Lecture 12 – Docker and Container Management

[7] Docker Web page

10 / 24

Page 11: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Docker Tool – Docker Hub Repository – Hadoop Example

Docker community image repository 100,000+ free applications including Hadoop (e.g. map-reduce, cf. Lecture 5)

Short Lecture 12 – Docker and Container Management

[8] Docker Hub Web page

11 / 24

Page 12: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Kubernetes Container Orchestration Tool & Apache Mesos

Kubernetes tool Scheduler that

manage severalDocker imageinstances onvarious nodes(e.g. AWS EC2)

Apache Mesos tool Resource management and scheduling

across entire datacenter taking intovarious applications (e.g. Hadoop & Spark, cf. Lecture 5)

Short Lecture 12 – Docker and Container Management

[9] Kubernetes Web page

Kubernetes is an open-source container orchestration tool for automated container deployment, scaling, and management that is often used with Docker and integrated into many clouds today

Apache Mesos is an open-source tool that abstracts CPU, memory, storage, and compute resourcesaway from machines to enable a datacenter that looks like a single pool of resources for end users

[10] Slideshare, ‘BuildingClustered Applications withKubernetes and Docker’

[11] Apache Mesos Web page

12 / 24

Page 13: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

AWS Cloud Service Portfolio – Compute – Revisited

Multiple compute products Deploy, run, and scale applications as

virtual servers, containers, or code Products & Usage

Amazon EC2: Virtual servers in the cloud Amazon EC2 Container Registry: Store and retrieve Docker images Amazon EC2 Container Service: Run & manage Docker containers Amazon Lightsail: Launch and manage virtual private servers Amazon VPC: Isolated cloud resources AWS Batch: Run batch jobs at any scale AWS Elastic Beanstalk: Run and manage Web Apps AWS Lambda: Run your code in response to events Auto Scaling: Automatic Elasticity

Short Lecture 12 – Docker and Container Management

[12] AWS Web page

13 / 24

Page 14: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Container Registry – Amazon EC2 Container Registry Example

Repository features Provides Docker container

registry & reliable access Simplify development to

production workflow Push container images to ECR

using Docker CLI from development laptop

Works together with Amazon EC2 Container Service (ECS)

Short Lecture 12 – Docker and Container Management

The Amazon EC2 Container Registry (ECR) provides a highly reliablerepository in order to store and retrieveDocker images that in turn can be easilydeployed on the EC2 Amazon IAAS cloud(cf. Lecture 8)

[12] AWS Web page

14 / 24

Page 15: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Container Registry – Amazon EC2 Container Service Example

Service features Provides service to run and

manage Docker containers Pulls Docker images from ECR

directly to the EC2 IAAS cloud for production deployments

Access torepositoriesand enablesdefinitionsof clusters/tasks

Short Lecture 12 – Docker and Container Management

The Amazon EC2 Container Service (ECS) is a highly scalable, fast, container management service that runs, stops, and manages Docker containers on the EC2 Amazon IAAS cloud (cf. Lecture 5)

[12] AWS Web page

15 / 24

Page 16: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Container Registry & Service – Amazon Pricing Example

ECR Pricing No upfront fees Pay for use of data

stored in repositories and data transferred

Storage is $0.10 per GB / month

ECS Pricing No additional charge

for this serive(!) But: Pay-per-use for other AWS

resources that are available E.g. EC2 instances or EBS

volumes (cf. Lecture 8)

Short Lecture 12 – Docker and Container Management

[12] AWS Web page

16 / 24

Page 17: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Google Cloud – Compute & Storage – Revisited

Short Lecture 12 – Docker and Container Management

The Google Cloud Platform offers a wide variety of IAAS/PAAS/SAAS technologies in the areas of compute, storage and databases, networking, big data, machine learning, management tools, developer tools, as well as identity and security – many of them can be combined for applications

The Google App Engine (GAE) PAAS solution is taking advantage of the IAAS Google infrastructure

(PAAS level)

(IAAS level)

17 / 24

Page 18: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Google Cloud – Kubernetes Engine

Short Lecture 12 – Docker and Container Management 18 / 24

[14] Google Cloud – Kubernetes Engine

Page 19: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Microsoft Azure – Azure Kubernetes Service

Short Lecture 12 – Docker and Container Management 19 / 24

[15] Microsoft Azure Cloud Azure Kubernetes Service

Page 20: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

[Video] Apache Mesos Example at AirBnB

Short Lecture 12 – Docker and Container Management

[13] YouTube, ‘How Airbnb Simplifies with Mesos’

20 / 24

Page 21: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Lecture Bibliography

Short Lecture 12 – Docker and Container Management 21 / 24

Page 22: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Lecture Bibliography (1)

[1] An Introduction to Statistical Learning with Applications in R, Online: http://www-bcf.usc.edu/~gareth/ISL/index.html

[2] Jupyter Web page,Online: http://jupyter.org/

[3] scikit-learn Web page,Online: https://scikit-learn.org

[4] Microsoft Azure HDInsight Cluster Web page, Online: https://azure.microsoft.com/en-us/services/hdinsight/

[5] Apache Spark Web page, Online: http://spark.apache.org/

[6] K. Hwang, G. C. Fox, J. J. Dongarra, ‘Distributed and Cloud Computing’, Book, Online: http://store.elsevier.com/product.jsp?locale=en_EU&isbn=9780128002049

[7] Docker Web page, Online: https://www.docker.com/

[8] Docker Hub Web page, Online: https://hub.docker.com/

[9] Kubernetes Web page, Online: https://kubernetes.io/

[10] Slideshare, ‘Building Clustered Applications with Kubernetes and Docker‘, Online: https://www.slideshare.net/wattsteve/kubernetes-48013640

Short Lecture 12 – Docker and Container Management 22 / 24

Page 23: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Lecture Bibliography (2)

[11] Apache Mesos Web page, Online: http://mesos.apache.org/

[12] Amazon Web Services Web Page, Online: https://aws.amazon.com

[13] YouTube Video, ‘How Airbnb Simplifies with Mesos‘, Online: https://www.youtube.com/watch?v=GfpGmhZwaoM

[14] Google Cloud Kubernetes Engine,Online: https://cloud.google.com/kubernetes-engine/

[15] Microsoft Azure, Azure Kubernetes Service,Online: https://azure.microsoft.com/en-gb/services/kubernetes-service/

Short Lecture 12 – Docker and Container Management 23 / 24

Page 24: School ofEngineering andNatural Sciences, University ...€¦ · School ofEngineering andNatural Sciences, University ofIceland Research Group Leader, JuelichSupercomputingCentre,

Short Lecture 12 – Docker and Container Management 24 / 24