+ All Categories
Home > Documents > SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications....

SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications....

Date post: 14-Aug-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
35
Company Confidential – For Internal Use Only Copyright © SAS Institute Inc. All rights reserved. SAS FANS Introduction to Containers with SAS Stavanger, 12 September 2019 Tor Ove Kilnes SAS Institute
Transcript
Page 1: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

SAS FANSIntroduction to Containers with SAS

Stavanger, 12 September 2019

Tor Ove Kilnes

SAS Institute

Page 2: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Agenda

• SAS and clouds – brief overview

• What is containers?

• Container benefits

• Orchestration?

• Container deployment

• A little demo with focus on SAS Programming container

• Word summary below

Docker Docker Image Docker Container

Software deployment

method

Orchestration -Kubernetes

Page 3: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

SAS® and Cloud ComputingOur Overall Cloud Strategy

SAS® on Cloud Providers

Results-as-a-Service

Managed Services

Software-as-a-Service

Developer* Cloud Deployment

Patterns

Cloud-Specific

Offerings

General Support for

Cloud Providers

SAS for Containers

Options like: SaasNow (external hosting, saasnow.com)SaaS with analytics: https://www.sas.com/en_us/software/machine-learning-cloud.html

SSOD (SAS hosting)

Page 4: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Possible container high level logical architecture

https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3489-2019.pdf

Page 5: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

5

What is Containers?

Page 6: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

IntroductionHistory of containers and container orchestration

• Containers are relatively new technology.

• Docker is an Open Source technology that is free, but also has a premium version

• Docker, one of the main technologies for containers, were public march 2013

• Kubernetes, one of the main technologies for container orchestration, were public in version 1.0 July 2015.

Source: https://containerjournal.com/2017/03/23/docker-4-milestones-docker-history/

Page 7: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

IntroductionWhat is Docker?

• Docker is a collection of interoperating software-as-a-service and platform-as-a-service offerings.

• Is an operating-system-level virtualization to cultivate development and delivery of software inside standardized software packages called containers.

• The software that hosts the containers is called Docker Engine. This is often referred to as Docker.

• A Docker image is a read-only template used to build containers. Images are used to store and ship applications.

• A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI.

• A Docker service allows containers to be scaled across multiple Docker daemons. The result is known as a swarm, a set of cooperating daemons that communicate through the Docker API.

• Registries is a Docker registry is a repository for Docker images. Docker clients connect to registries to download ("pull") images for use or upload ("push") images that they have built.

• Docker is supported by many, like Amazon Web Services, Google Cloud, Microsoft Azure, Openstack, Kubernetes to mention some.

Source: https://en.wikipedia.org/wiki/Docker_(software)

Page 8: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

IntroductionWhat is Kubernetes?

• Kubernetes is (or short k8s) is an open-source container platform for automating application deployment, scaling, and management.

• This also includes that the containers can be portable from one system to another, like from Google to Azure.

• Kubernetes is Greek for helmsman or pilot.

• The short K8s is the K and then the next 8 letters (ubernete) plus s..

Source: https://en.wikipedia.org/wiki/Kuberneteshttps://kubernetes.io/docs/concepts/overview/what-is-kubernetes/

Page 9: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

IntroductionWhat is Kubernetes?

• When there is a larger architecture with many containers, orchestration for making sure the containers are running is needed.

• A service for making the container communicate is needed.• In kubernetes the containers are organized in deployed pods and may communicate via

a service. • Service Mesh is a infrastructure layer for handling service-to-service communication, for

example Instio.

Source: https://en.wikipedia.org/wiki/Kuberneteshttps://kubernetes.io/docs/concepts/overview/what-is-kubernetes/

Page 10: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Container DeploymentOverview

• SAS 9.4 for Containers has been available since 2016

• Includes the portfolio of SAS Viya offerings or SAS Analytics Pro (9.4)

• The SAS Viya offering is a:

- Pre-packaged Docker container

- “recipe”, that runs in a variety of cloud infrastructures

- Build on your own..

• First SAS Viya on containers release is a programming-only, SMP mode

• Later releases will include visual capabilities and MPP deployment patterns will be supported.

• You will be able to customize what SAS Viya offerings that goes into a container

- For pre-packaged Docker containers this is “adding layering”, like authentication and Jupityr

Page 11: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

What is a Container?

From: https://www.rightscale.com/blog/cloud-management-best-practices/docker-vs-vms-combining-both-cloud-portability-nirvana

Page 12: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

What is a Container?

Server

Host OS

Container

Docker Engine

Container Container

LIBS

App

LIBS

App

LIBS

App

/|- bin|- boot|- dev|- etc|- home|- opt

|- sas|- viya

|- usr|- sbin|- proc|- var

Containers is a process that packages the “Application” and all it’s dependencies inside it.

All containers share the same OS on a host. And share the resources of the machine (Memory / CPU).

Docker Engine executes the containers as an “app” and ensures that they are isolated from each other.

And since there is no VM or OS overhead (per container) startup times are low.

Page 13: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Usage Patterns in Virtual Machines and Containers

• Traditional and most popular virtualization method today (50-60% or workloads)

• Complex applications (that need multiple components) can deploy an perform well on the same VM instance

• They can handle STATE (meaning they stay up and running to keep all the components functional)

• Great for storage of Data needed for the applications on same instance

• VM’s are ideal for monolithic type applications

• Emerging as a virtualization layer (today 5-10% workloads, 3 years out expecting 30-40%)

• Ideal for running single services• Ideal for being STATELESS/EPHEMERAL

(they can be spun up and down fast, to respond to compute demand)

• Decouple data and code from the compute (save STATE outside of the container)

• Highly Portable: move containers to multiple infrastructures that are container compliant

Page 14: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

SAS Container Recipe vs SAS Container Image

Container Recipe from SAS• Instructions for building your own• Tested and supported• Can be modified to some extent• 9.4 and SAS Viya Programming

available now

Container Image from SAS• Already created• Tested and supported• Limited customizations• SAS Viya

Build SAS “stuff” in a Docker Container• Build your own• Whether you should or not, is up to you• Not tested, limited support• Our customers are trying this today

?

Page 15: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

What can be in a container system?

Source: https://go.documentation.sas.com/?docsetId=dplyml0phy0dkr&docsetTarget=p0xefji214iy8an0z3tcldp7mury.htm&docsetVersion=3.4&locale=no

Page 16: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Type of SAS containerized applications

Runtime Container:Definition: A single container that has one or more analytics runtime (e.g. SAS9, CAS, R or Python)Analytics Usage: This can be used for ad-hoc development work or running batch jobsUtilization: Designed to be spun up and down on-demand with fast spin-up time (seconds)SAS Products: SAS9 MVA, VIYA CASIDEs: SAS Studio/Jupyter

Viya Enterprise Grade Applications:Definition: Multi-container deployment with microservices, stateful services and distributed computeAnalytics Usage: User concurrency on interactive visual web clients (exploration, model building and dashboarding)Utilization: The applications are not spun-up/down as oftenSAS Applications: VA/VS/VDMML etc…

Page 17: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

SAS for ContainersOffering Overview

SAS for Containers is a deployment pattern, not a product

Page 18: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

18

Container Benefits

Page 19: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.Source:https://www.sas.com/en_us/solutions/cloud-computing/on-providers/deployment-patterns/for-containers.html

Page 20: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

• Build once, run anywhere• Portable runtimes• Scale to problem• Platform/language agnostic• New modelling paradigms

Data Scientists

Speed, Flexibility, and Compatibility

Page 21: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

IT Organization

• Reduced infrastructure cost• Repeatable and scalable • Efficient use of resources• Faster deployment• Runs anywhere

Cost, Efficiency, Reliability

Page 22: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

23

Container Deployment

Page 23: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Common Container TechnologiesExamples

Container Platforms:

• Docker

Orchestration systems:

• Kubernetes

Enterprise Container Platforms:

• Docker Swarm

• RedHat OpenShift

• Apache Mesos

Public Cloud Providers Container Platforms:

• Amazon Elastic Containers Service (ECS) based on Docker

• Amazon Elastic Container Service for Kubernetes (EKS)

• Azure Kubernetes Service (AKS)

• Google Kubernetes Engine

Page 24: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Container Deployment Terminology

• Container Image: is a static file that includes the executable code (components of software in short). The image also shares the same OS kernel as the host machine. IT professionals can layer multiple software components on top of an existing image.

• Registry: is a service for storing Docker images (you can have public registries or private ones)

• Repository: is a collection of different docker images that have different tags (image ID). In short, you can have a repository of docker images in a registry.

• You can think of it as a hierarchy: Registry>Repository>Images>Tags

Page 25: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Docker container layers

• A container is built up on layers. • Each command in the Dockerfile makes a layer.Example Dockerfile with 4 layers:

FROM ubuntu:15.04

COPY . /app

RUN make /app

CMD python /app/app.py

• A difference between a container and an image is the top writable layer. • All writes to the container that add new or modify

existing data are stored in this writable layer.

• When the container is deleted, the writable layer is also deleted. The underlying image remains unchanged.

Source: https://docs.docker.com/storage/storagedriver/

Page 26: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo

Page 27: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo 1Show basic Docker commands

• The local Docker Engine is interacted by line commands. Help from:

• sudo docker --help

• Show docker installation info, and note number of images and running containers

• sudo docker info

• List the images on the local docker platform:

• sudo docker images

• List the running containers

• sudo docker ps

• List logs from a container via container ID or its name

• sudo docker logs 0932e4465864

• sudo docker logs registry

Page 28: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo 2Show startup script for SAS-Viya-Programming and start it

• View script: more /opt/sas/docker_container/viya34_programming/launchsas.sh

• Show image that is base for the container layer

• Note the unique ports for HTTP and CAS, and name of image and hostname.

• Show the local repository at http://192.168.213.132:5000/v2/_catalog

• Start the SAS-Viya-programming container: ./launchsas.sh

• Find the generated password for user sasdemo:

• sudo docker logs 5926c757072c | grep Password

• Open a browser with: http://192.168.213.132:8081/SASStudio/

• Log in as sasdemo

• In SAS Studio, look at the folder properties for “data” and “cas/data”. Compare to volumes in launchsas.sh

• These folders are relative to the container root folder: /opt/sas/docker_container/viya34_programming/

• Note that these are available both to the container and to the local centOS console.

• Run the test program: TestProgram_sas94_viya.sas

Page 29: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo 2Show startup script (launchsas.sh) for SAS-Viya-Programming and start it

Page 30: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo 2Login to SASStudio running on container

• Open link with user sasdemo and password from container log: http://192.168.213.134:8081/SASStudio/

• Run program and get table information for the promoted table

Page 31: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Demo 3Use container SAS-Viya-Programming as a batch engine

• View script: more /opt/sas/docker_container/viya34_programming/launch_batchsas.sh

• Show image that is base for the container layer

• Note the unique ports for HTTP and CAS, and name of image that is internal references in docker

• Show the current running containers using: sudo docker ps

• Start the SAS-Viya-programming container: ./launch_batchsas.sh

• Now, login to the container “bash” console using:

• sudo docker exec -it sas-programming2 bash

• Navigate to /data to see the program run in the previous demo

• Run a sas program interactively

• Navigate to: cd /opt/sas/spre/home/SASFoundation/

• Run: ./sas -sysin /data/testpgm.sas -log /data/testpgm.log

• Open the log and see that it is newly created: ll /data (NOTE: the time may be wrong on image)

• Then “exit” to leave the container.

• The same thing can be achieved by running an EXEC command via docker

• sudo docker exec -d sas-programming2 /opt/sas/spre/home/SASFoundation/sas -sysin /data/testpgm.sas -log /data/testpgm.log

• Stop the container: sudo docker stop sas-programming2

• This interactive process can then become a complete background script: run_batchdemo.sh

Page 32: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

33

Questions?

Page 33: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Pre-requisitesFor pre-made SAS Viya Programming container

• A Linux image. Typically a «lean» type, like CentOS

• Resources:

• OS: Tested on CentOS 7 NOTE: Docker do not support CentOS 6.x So use CentOS 7.

• VMs: 1 machine, created using vmware workstation 12, CentOS7 ISO image from https://centos.org/download/

• CPU: 4 cores, selected 1 cores.

• RAM: 2-4 GB, selected 4GB

• Disk space: approc 11 GB without data on file system. The CentOS7 image made with 25GB diskspace

- NOTE: The container itself should NOT store data, as it is stateless.

• Docker version: 17.05.0 or later, here 17.06.0-ce is chosen.

• Kubernetes version: 1.10 or later. For a “SAS-Programming only” container this is not needed.

• Java JRE is needed: JRE1.8.x (OpenJDK and Oracle JRE is the tested types)

• Security: By default, SAS Studio is using «host authentication», not LDAP and a «sasdemo» as a fixed user.

• No TLS (Transport Layer Security) in “Programming Only” deployments.

• Docker is run by «root» and a ad-hoc setup utilizes a «developer mode», where end-user sasdemo is created automatically.

• For more users, an LDAP setup is advised as an additional «layer»

Page 34: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Installation steps for SAS programmingAll based on online doc:

https://go.documentation.sas.com/?docsetId=dplyml0phy0dkr&docsetTarget=p0v90u98fmv1k7n1ru9atb7j54c1.htm&docsetVersion=3.4&locale=no

• Step 1: Check that the pre-requisites for the Linux and Docker environment is met.

• Step 2: Copy the SOE file to: /opt/sas/docker_container/viya34_programming using winScp or similar.

• Step 3: Extract the file in this folder using:

• Step 4: Download Mirror Manager from: https://support.sas.com/en/documentation/install-center/viya/deployment-tools/34/mirror-manager.html

• Step 5: Find the latest container matching the SOE file and note the output. This will be a SAS Viya 3.4 Programming container.

• Step 6: Install Docker CE (Community Edition)

• Step 7: Configure Docker to know about and have certificates for ses.sas.download

• Step 8: Get and validate the image from ses.sas.download

• Step 9: Optional: Register the image in a local Docker registry

• Step 10: Install SAS Viya data volumes etc. to the docker image

• Step 11: Start the sas-programming container and validate the install

Page 35: SAS FANS...•A Docker container is a standardized, encapsulated environment that runs applications. A container is managed using the Docker API or CLI. •A Docker service allows

Company Conf ident ia l – For Internal Use OnlyCopyright © SAS Inst itute Inc. A l l r ights reserved.

Useful URLs

• SAS for containers: https://www.sas.com/en_us/solutions/cloud-computing/on-providers/deployment-patterns/for-containers.html

• SAS containers on github: https://github.com/sassoftware/sas-container-recipes

• CentOS download: https://centos.org/download/

• Setup and install using:• SAS Programming only container from SAS Registry

• Install methodology used here:- https://go.documentation.sas.com/?docsetId=dplyml0phy0dkr&docsetTarget=n1c74wl94owmvyn16gcx91ymasg8.htm&docsetVersi

on=3.4&locale=no

• Docker is chosen as the deployment tool

• Kubernetes is more relevant in multiple containers deployments and optional here.

• SAS for containers: https://support.sas.com/rnd/containers/index.html

• Build the container itself: https://blogs.sas.com/content/sgf/2019/03/06/getting-started-sas-containers/

• Global Forum papers: • https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/1875-2018.pdf

• https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3489-2019.pdf


Recommended