Upload
michael-osullivan
View
338
Download
0
Embed Size (px)
Citation preview
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
PaaS and Caas: Application Deployment in
the Cloud
Lecture @ University College CorkApril 11th 2016
Sanjay NayakMichael O’Sullivan
CLOUDACADEMY
© 2016 IBM Corporation2
http://bluemix.net
CLOUDACADEMY
© 2016 IBM Corporation3
Cloud Service Models
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
What is Bluemix?
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
How does Bluemix work?Bluemix embraces Cloud Foundry as an open source Platform as a Service and extends it with IBM, third party, and community built services.
CLOUDACADEMY
© 2016 IBM Corporation6
Bluemix Architecture
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Why are developers using Bluemix?
Go from zero to running code in a matter of minutes.
Automate the development and delivery of many applications.
To rapidly bring products and services to
market at lower cost
To continuously deliver new functionality to their
applications
To extend existing investments in IT
infrastructure
Extend existing investments by connecting securely to on-premise infrastructure.
CLOUDACADEMY
© 2016 IBM Corporation8
The IBM Cloud @ Cork Working as part of the Cloud Foundation Services project.
Responsible for deployment of services used by Bluemix Dedicated and Local.
Varying responsibilities among different squads, from topology, to operations, and delivery pipeline.
A DevOps culture is adopted by all squads.
Delivery pipeline: A DevOps practice for using a specific set of tools for automating deployment of applications/services.
CLOUDACADEMY
© 2016 IBM Corporation9
Bluemix Dedicated/Local Aside from existing public cloud model, Bluemix is now offered with
dedicated and local models.
Dedicated: A private cloud. Bluemix is deployed on cloud resources which are not shared with other customers.
Local: An on-premise private cloud. Bluemix is deployed on the hardware resources at the customer’s location.
Hybrid: Customer can use both dedicated and local models for different applications.
CLOUDACADEMY
© 2016 IBM Corporation10
Example: Bluemix Local
Taken from “The Architect’s Guide to Bluemix Local:
http://www.ibm.com/cloud-computing/bluemix/local/
CLOUDACADEMY
© 2016 IBM Corporation11
DevOps Model
Taken from free IBM eBook “DevOps for Dummies” - http://www.ibm.com/ibm/devops/us/en/resources/dummiesbooks/
CLOUDACADEMY
© 2016 IBM Corporation12
IBM BluemixTM DevOps ServicesAn Open, Integrated Rapid Development Experience that Scales A Premier DevOps Service for IBM Cloud
Platform– Promotes incremental frictionless adoption of
DevOps Services for Bluemix An Integrated Developer Experience
– End-to-end DevOps Solution in the cloud for developing applications.
– Integrated task tracking, agile planning, source control with auto deploy
– Complementary mobile quality and application performance monitoring
– Use your favorite tools or work from the Web IDE
– Free public and fee-based private projects (free for now now)
Scalable, secure, enterprise-ready – Runs on SoftLayer Infrastructure
CLOUDACADEMY
© 2016 IBM Corporation13
DevOps Services available today
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Bluemix MobileFirst Services Demo
Bluemix User Interface
Node.js (Javascript-based asynchronous web application server)
Mobile Client Access
IBM Push Notifications
Cloudant NoSQL Database
Cloud Foundry CLI (cf)
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
The ToDo item cannot be deleted from here on the app website; the RESTful HTTP DELETE call is only available to an authenticated mobile user via the Mobile app, which uses the “Mobile Client Access” service to authenticate the user using Google or Facebook.
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Tapping and holding the completed task starts the delete operation…
…but the user has not authenticated (a 403 Forbidden HTTP response was received), so the user is directed to Facebook to authenticate.
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
The user is asked for permission for the ToDo App to access their profile…
…and once granted, the user now has permission to make the DELETE call; the ToDo item is deleted successfully.
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Command Line Interface
Bluemix uses the CloudFoundry command line interface (CLI) – cf
cf help – provides help page showing all the commandscf help <command> - provides help for specific command
cf api api.ng.bluemix.netcf l - login cf ds – delete servicecf t – target space or organisation cf bs – bind service to applicationcf a – list apps in current space cf st – start appcf app - display status for specific app in current space
cf sp – stop app
cf p – push (deploy or update) app cf d – delete appcf s – show service info cf scale – scale appcf cs – create service cf logs – tail or show logs for app
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Watson Services
Watson: Enabling Cognitive Computing
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Internet of Things (IoT)
CLOUDACADEMY
© 2016 IBM Corporation21
Internet of Things – Devices
with Wi-Fi Shield
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Pre-requisite Software and Accounts
Java 7.0 SDK (Not JRE)http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Eclipse Kepler (4.3) or Luna (4.4)
Java Enterprise Editionhttp://eclipse.org
From Eclipse MarketplaceIBM Bluemix plugin
Githttp://git-scm.com/downloads
CloudFoundry Command Line Interfacehttps://github.com/cloudfoundry/cli
Create a Bluemix accounthttp://bluemix.net
Create a DevOps Services for Bluemix accounthttp://hub.jazz.net
CLOUDACADEMY
© 2016 IBM CorporationIBM Bluemix http://bluemix.net
Bluemix ReferencesIBM Bluemix, get started with your IBM ID: http://bluemix.net
Editor’s Picks: Top 15 Bluemix Tutorials: http://www.ibm.com/developerworks/cloud/library/cl-bestoflbluemix2014/
Bluemix Articles Archive: https://developer.ibm.com/bluemix/category/general/
IBM Academic Initiative: http://ibm.com/academicinitiative
Bluemix Developers community: https://developer.ibm.com/bluemix
Bluemix YouTube Channel: https://www.youtube.com/playlist?list=PLh9e82xViX4bF5LlsYUcyu26YG7GM7i3S
Watson Services: https://ace.ng.bluemix.net/#/solutions/solution=watson
Internet of Things (IoT) Foundation: www.internetofthings.ibmcloud.com
Bluemix + IoT + Node-RED demo: https://www.youtube.com/watch?v=FYrS7Ph9TT8
IoT YouTube Channel: https://www.youtube.com/channel/UCFNoGF7Ea-FfmAjfK4ReFpA
CLOUDACADEMY
© 2016 IBM Corporation24
What is Docker?
Source: http://www.slideshare.net/tuna20073882/dockerhanoi-meetup-introduction-about-docker
CLOUDACADEMY
© 2016 IBM Corporation25
What is Docker?
Light-weight packaged Linux runtimes–Primarily “one” service (can be group of processes)
Based on Linux control-groups (LXC)–Now libContainer
Build images with payload
Run images anywhere – containers–Fast startup and shutdown
CLOUDACADEMY
© 2016 IBM Corporation26
Containers vs VMs
Source: http://www.slideshare.net/tuna20073882/dockerhanoi-meetup-introduction-about-docker
CLOUDACADEMY
© 2016 IBM Corporation27
Docker Concepts
ContainersImagesRegistry
–Public: https://hub.docker.com –Private: build your own
DockerfilesClient-server
–Docker service–REST APIs–Docker client
CLOUDACADEMY
© 2016 IBM Corporation28
Docker Basics
Source: http://www.slideshare.net/tuna20073882/dockerhanoi-meetup-introduction-about-docker
CLOUDACADEMY
© 2016 IBM Corporation29
Push / Pull and Run Docker Image
On Docker image build server# docker tag name/wlp 10.0.0.1:5000/name/wlp
# docker push 10.0.0.1:5000/name/wlp
On Docker host to run containers
# docker pull 10.0.0.1:5000/name/wlp
# docker run -p 1930:9080 -d --name test1 10.0.0.1:5000/name/wlp
In browser, go to http://<docker-host>:1930/...
CLOUDACADEMY
© 2016 IBM Corporation30
Docker Demo: Node.js Personality Insights App
Bluemix offers a Watson Personality Insights Demo application built on Node.js. Here, we “Dockerize” it, by creating our own Docker image with the sample application code provided.
A Dockerfile is used to create a custom image.
Create Dockerfile:
#Start from the official node.js image on DockerhubFROM node:4-onbuild#Set the VCAP_SERVICES environment variable, containing the access credentials for the Watson Personality Insights ServiceENV VCAP_SERVICES="{\"personality_insights\": [{\"name\": \“SNIP…"}}]}“#Open port 3000 into the container for public access to web applicationEXPOSE 3000
Build the image with docker build –t node_personality .
Run a new container from the image with docker run –it –p 3000:3000 –name personality_app node_personality
CLOUDACADEMY
© 2016 IBM Corporation31
Docker Demo: Node.js Personality Insights App
The Docker container with the Personality Insights webapp is running on the local machine, while using an instance of the Watson Personality Insights service running in Bluemix.
CLOUDACADEMY
© 2016 IBM Corporation32
Docker References
Docker: https://docker.com/
Docker Hub: https://hub.docker.com/
Dockerfile Best Practices: https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
Docker Registry: https://github.com/docker/docker-registry
CLOUDACADEMY
© 2016 IBM Corporation33
Bluemix: Support for Containers as a Service (CaaS) with Docker In addition to CloudFoundry apps, Bluemix now provides the
Containers Service.
Allows the deployment of containers running applications and services.
Each user has their own private registry for storing Docker images within his/her Bluemix account.
Interacts with the containers service by using the Bluemix User Interface, or by the Cloud Foundry CLI with the IBM Containers Plugin.
Containers can bind to existing Bluemix services.
CLOUDACADEMY
© 2016 IBM Corporation34
Containers Service Architecture
Taken from Bluemix Containers Documentation - https://console.ng.bluemix.net/docs/containers/container_gettingstarted.html
CLOUDACADEMY
© 2016 IBM Corporation35
Bluemix Containers Service
CLOUDACADEMY
© 2016 IBM Corporation36
Containers Service Demo with the Personality Insights
AppBluemix User InterfaceDocker
Cloud Foundry CLI (cf)IBM Containers Plugin for CF CLI
CLOUDACADEMY
© 2016 IBM Corporation37
Containers Service Demo: Node.js Personality Insights App
This time, the Docker container with the webapp is running on Bluemix with the Containers Service, using the same instance of the Watson Personality Insights service from the first Docker demo.
CLOUDACADEMY
© 2016 IBM Corporation38
Thank You