Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services

1,229 views 43 slides May 01, 2019
Slide 1
Slide 1 of 77
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77

About This Presentation

Cloud native applications are composed of containers, serverless functions and managed cloud services.


What is the best set of tools on your desktop to provide a rapid, iterative development experience and package applications using these three components?


This hand-on talk will explain how you ...


Slide Content

Patrick Chanezon Cloud Advocate, Microsoft @chanezon Developing Apps with Containers, Functions and Cloud Services

@chanezon 1994-2005 Software Engineer 2005-2019 Developer Relations

Developer Productivity

Microsoft’s mission “Our mission is to empower every person and every organization on the planet to achieve more.” https://www.microsoft.com/en-us/about

3 Abstractions to build cloud apps Containers Functions, triggered by Events Managed Cloud Services

Containers

Docker Enterprise 3.0 Securely build, share and run any application, anywhere ANY APPLICATION EVERY STAGE ANYWHERE Hybrid Cloud VM Bare Metal Edge Run Build Share

Platform built on infrastructure, built on standards. Docker

Deploy your applications quickly and predictably Scale your applications on the fly Roll out new features seamlessly Limit hardware usage to required resources only Portable Public, private, hybrid, multi-cloud Extensible Modular, pluggable, hookable, composable Self-healing Auto-placement, auto-restart, auto-replication, auto-scaling Kubernetes

Docker Desktop

Containers in Azure Choice of developer tools and clients Azure Container Registry Docker Hub App Service Deploy web apps or APIs using containers in a PaaS environment Service Fabric Modernize .NET applications to microservices using Windows Server containers Kubernetes Service Container Instance Scale and orchestrate Linux containers using Kubernetes Ecosystem Bring your Partner solutions that run great on Azure Elastically burst from your Azure Kubernetes Service (AKS) cluster

VM Pods VM Pods VM Pods VM Pods Kubernetes control pane Azure Container Instances (ACI) Pods ACI Connector Application Architect Infrastructure Architect Deployment/tasks Bursting with the ACI Connector/ Virtual Kubelet

Virtual Kubelet

Functions

*Supporting services, like storage and networking, may be charged separately. Pay-per-use Only pay for what you use: billing is typically calculated on the number of function calls, code execution time, and memory used.* Instant, event-driven scalability Application components react to events and triggers in near real-time with virtually unlimited scalability; compute resources are used as needed. Full abstraction of servers Developers can just focus on their code—there are no distractions around server management, capacity planning, or availability. What is serverless?

FaaS is at the center of serverless Functions-as-a-Service programming model use functions to achieve true serverless compute Single responsibility Functions are single-purposed, reusable pieces of code that process an input and return a result Short lived Functions don’t stick around when finished executing, freeing up resources for further executions Event driven & scalable Functions respond to predefined events, and are instantly replicated as many times as needed Stateless Functions don’t hold any persistent state and don’t rely on the state of any other processes

What is Azure Functions? An event-based, serverless compute experience that accelerates app development Azure Functions = FaaS++ Integrated programming model Use built-in triggers and bindings to define when a function is invoked and to what data it connects Enhanced development experience Code, test and debug locally using your preferred editor or the easy-to-use web based interface including monitoring Hosting options flexibility Choose the deployment model that better fits your business needs without compromising development experience

Boost development efficiency Integrate with Azure Application Insights Get near real-time details about function apps See metrics around failures, executions, etc. Monitoring Save time with built-in DevOps Deploy functions using App Service for CI Leverage Microsoft, partner services for CD CI/CD Use triggers to define how functions are invoked Avoid hardcoding with preconfigured JSON files Build serverless APIs using HTTP triggers Triggers Connect to data with input and output bindings Bind to Azure solutions and third-party services Use HTTP bindings in tandem with HTTP triggers Bindings Define one API surface for multiple function apps Create endpoints as reverse proxies to other APIs Condition proxies to use variables Proxies Debug C# and JavaScript functions locally Use debugging tools in Azure portal, VS, and VS Code Local debugging

Gain flexibility and develop your way Write code in C#, JavaScript, F#, and Java Continuous investment in new, experimental languages Multiple languages Simplify coding for new users with native Azure portal Select from popular editors, like VS, VS Code, CLI, Maven* Dev options Choose from six consumption plans to run Functions Run your first million function executions for free Hosting options *VS and VS Code only support C#; Maven only supports Java Write stateful functions in a serverless environment Simplify complex, stateful coordination problems Add the extension to enable advanced scenarios Durable Functions

Azure Functions is an open-source project Functions runtime and all extensions are fully open source https://github.com/Azure/Azure-Functions

Serverless Apps on Azure

Portable Serverless Platforms Fn Nuclio OpenFaaS Galactic Fog OpenWhisk Diagrams from https://github.com/cncf/wg-serverless/tree/master/whitepaper

KNative & Friends

Managed Cloud Services

Use Azure Managed Data Platform Services AZURE SEARCH AZURE DATA CATALOG AZURE STORAGE BLOBS AZURE DATA LAKE STORE AZURE SQL DATA WAREHOUSE AZURE SQL DB AZURE COSMOS DB AZURE ANALYSIS SERVICES POWER BI AZURE DATA LAKE ANALYTICS AZURE HDINSIGHT AZURE DATABRICKS AZURE STREAM ANALYTICS AZURE ML ML SERVER AZURE MySQL DB AZURE PostgreSQL DB REDIS CACHE

Open Service Broker for Azure (OSBA) Open Service Broker for Azure (OSBA) SQL Database Event Hubs Redis Cache MySQL Database Cosmos DB PosgreSQL Database Service Bus Azure Storage Cloud Foundry Kubernetes Service Fabric OpenShift Easily access to SLA-backed Azure Services such as Azure Database for MySQL

Open Source Tooling

Microsoft drives community-led innovations for Kubernetes Microsoft also maintains… Cloud Native Application Bundles (CNAB) Virtual Kubelet Helm Brigade Draft 68% of Kubernetes users * prefer Helm as their package manager Visual Studio Code Kubernetes Extensions has 11K monthly active users *August 2018 bi-annual CNCF survey

Find, share, and use software built for k8s Manage complexity Easy updates Simple sharing Rollbacks

Simple app development and deployment – into any Kubernetes cluster Simplified development Using two simple commands, developers can now begin working on container-based applications without requiring Docker or even installing Kubernetes themselves Language support Draft detects which language your app is written in, and then uses packs to generate a Dockerfile and Helm Chart with the best practices for that language

Developer Workflows

3 Abstractions Containers Functions, triggered by Events Managed Cloud Services

Developer Workflows Local Cloud Container Functions Services Code

Docker Desktop

Docker Desktop

Docker Compose docker-compose for local dev docker-compose Kubernetes Extension (API aggregation)

Developer Workflows Local Cloud Container Functions Services docker-compose Azure Functions Runtime mysql, mongo images CosmosDB Code code mounted in local containers inotify to restart if needed

Enterprise management & security, developer productivity, local Kubernetes runtime Native local Docker and certified Kubernetes runtimes for container-first application development for Windows 10 and Mac Automated, template-driven generation of IT-approved Dockerfiles, Docker Compose files, and CI pipelines boosts developer productivity Match desktop and server environments to avoid “works on my machine” friction Centrally manage and secure DDE deployment, upgrades, and configurations Commercial enterprise support Docker Desktop Enterprise

Accelerate “Time-to-Docker” for Developers While Lowering App Pipeline Friction Fastest & easiest way to onboard developers to new Docker projects Supports developer choice of programming languages and application frameworks Accelerates developer productivity with Docker while delivering secure and compliant applications Provides options between CLI and GUI to meet the needs of developers with varying Docker expertise Docker Application Templates

Azure Dev Spaces

Capabilities Use Azure Dev Spaces to iteratively develop, test, and debug microservices targeted for AKS clusters. ͏ Azure DevOps has native integration with Helm and helps simplifying continuous integration/continuous delivery (CI/CD) ͏ Virtual node —a Virtual Kubelet implementation—allows fast scaling of services for unpredictable traffic. ͏ Azure Monitor provides a single pane of glass for monitoring over app telemetry, cluster-to-container level health analytics. https://github.com/Microsoft/SmartHotel360-AKS-DevSpaces-Demo Source code control Inner loop Azure Container Registry Azure Pipeline/ DevOps Project Auto-build Azure Monitor CI/CD Test Debug Azure DevSpaces AKS dev cluster AKS production cluster Pods Container instances Pods 1 2 3 4 Integrated end-to-end Kubernetes experience

Azure Dev Spaces

Azure Dev Spaces

Azure Dev Spaces

Azure Dev Spaces

Azure Dev Spaces

Developer Workflows Local Cloud Container Functions Services Azure Code code synced to cloud AKS Azure Functions code built, started

VS Code Live Share

VS Code Live Share You just need VS Code locally Code and all setup on your collaborator’s machine Code together without setting anything up Access services on remote machine from localhost Works with Azure Dev Spaces on machine sharing the session: double jump to AKS

VS Code Live Share with Luca Snoey Github: @tess1254 Twitter: @Snowy_Turtle Medium: https://medium.com/@Snowy_Turtle LinkedIn:   https://www.linkedin.com/in/luca-snoey-41911417a/ MS Learn:  https://techprofile.microsoft.com/en-us/lucasandbox

Gloo

SOLO GLOO, THE NEXT GENERATION API GATEWAY www.solo.io/glooe

The problem: disparate ecosystems, hard transition Monolithic Apps Microservices Serverless Ansible Kubernetes Azure Functions APM Splunk SOA Prometheus OpenTracing microservices Azure Monitor App Insight Event-driven Enterprise faces 4 main problems in adopting innovative architectures: Insolation between brown and green field Transition is lengthy and diverts essential personnel from core mission Duplicate redundant tools Requires silo teams

Let Gloo build your hybrid apps Microservices Proprietary Serverless calc.com/add calc.com/sub calc.com/mul + - ÷ calc.com/div × Hybrid app + × - ÷ Portable Serverless Monolithic Apps

Developer Workflows Local Cloud Container Functions Services Azure Code debugger attach to container in cloud AKS Azure Functions

Telepresence

Telepresence

Developer Workflows Local Cloud Container Functions Services Azure Code local code AKS Azure Functions local process proxied inside aks

Ksync

Tilt

Tilt https://medium.com/windmill-engineering/how-tilt-updates-kubernetes-in-seconds-not-minutes-28ddffe2d79f

Tilt https://github.com/windmilleng/tilt-frontend-demo

Developer Workflows Local Cloud Container Functions Services Azure Code local changes synced to aks AKS Azure Functions

CNAB

Spec for packaging distributed apps CNAB: package distributed apps CNABs facilitate the bundling, installing and managing of container-native apps — and their coupled services Cloud Native Application Bundle

Install and manage distributed app bundles Duffle: install & manage distributed app bundles Simple CLI to interact with CNAB, for use with your clouds and services of choice Duffle

A friendlier cloud installer Install your app and its baggage Bundle up not just the app, but everything it needs to run in the cloud Build bundles smarter, not harder Use mixins for common tools and clouds, and depend on existing bundles. Surprise! It does package management too Package and version your bundle, then distribute it for others to use.

Simplify Application Delivery “Container of containers” defines an application that can be comprised of multiple services Removes the need to manage “mountains of YAML” and eliminates configuration overhead Supports Docker Compose, Kubernetes YAML, Helm Charts, others Implements the new open standard, CNAB, announced by Docker and Microsoft Parameterized fields allow for flexible deployment across different environments, delivering on “code once, deploy anywhere” my-app.yml Docker App APP DESCRIPTION name-version-maintainer APP COMPONENTS ENVIRONMENT VARIABLES default-settings.yml Build, share and run multi-service apps in a single package deployable to any infrastructure Docker Applications

Docker app Docker app available today in CLI beta with CLI plugin Implements CNAB spec: install, upgrade, uninstall - bundle to create invocation image & bundle.json Sharing compose based app definitions in Docker Hub

Developing Cloud Native Applications with Docker Desktop and Cloud Services Black belt: 30 April, 4:40 pm, Room 3016 Patrick Chanezon Porter: an Opinionated CNAB Authoring Experience Open source: 1 May, 4:40 pm, Room 2002 Jeremy Rickard CNAB panel OSS summit: 2 May, 1:30 pm, Room 2006 Michelle Noorali, Darren Pulsipher, Simon Ferquel CNAB at DockerCon

Developing New Applications with Docker App Package Workshop Compose and Docker App OSS summit: 2 May, 10:00 am, Room 2006 Docker App at DockerCon

Rate & Share Rate this session in the DockerCon App Follow me @chanezon Tweet #DockerCon

Create a free Azure Account: https://aka.ms/pat/account Containers docs: https://aka.ms/pat/container learn: https://aka.ms/pat/learn/container Functions docs: https://aka.ms/pat/functions learn: https://aka.ms/pat/learn/functions We’re hiring: https://aka.ms/awesomejobs Resources

@bridgetkromhout and @brendandburns for some of the slides Thank you

@ chanezon https://aka.ms/pat/account