SlideShare ist ein Scribd-Unternehmen logo
1 von 245
Downloaden Sie, um offline zu lesen
IBM Bluemix – Hands On Workshop
10.1
IBM Bluemix
Hands On Workshop
Nguyen Tai Dzung (Dũng)
Cloud Solution Architect + Bluemix Evangelist
IBM Clouds and Ecosystem Development
Email:
dzungnt@vn.ibm.com
ntaidung@gmail.com
Please register:
https://bluemix.net
https://hub.jazz.net
IBM Bluemix – Hands On Workshop
Contents
1. Module 1 – IBM Bluemix Overview
2. Module 2 – Tour of IBM Bluemix
3. Module 3 – First Deploy
 Exercise – First Deploy Exercises (Bluemix UI, CF CLI and Eclipse)
4. Module 4 – DevOps Services
 Exercise – Bluemix integration with DevOps Services
5. Module 5 – Create your application
 Exercise – Your first Node.js application
6. Module 6 – Services
 Exercise – Adding a service to an application
7. Module 7 – How it works
 Exercise – Specifying a buildpack when deploying an application
8. Module 8: Containers
IBM Bluemix – Hands On Workshop
Contents
9. MobileFirst on Bluemix
10. Big Data on Bluemix
11. Internet of Things (IoT)
IBM Bluemix – Hands On Workshop
Course overview
Welcome to Getting Started with IBM Bluemix
5 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Prerequisite skills and software
•To complete this course successfully, you should understand:
 Basics of application development
 How to use the command line to do basic programming tasks
•You’ll need the following software and accounts:
 IBM Bluemix registration: A 30-day trial is available
 Eclipse: We’ll show you how to do that
 Cloud Foundry Command Line Interface
 Node.js runtime
 An IBM Bluemix account
 An IBM Bluemix DevOps Services account
6 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Course learning objectives
• Understand the basics of the IBM Bluemix platform
• Understand the basics of cloud computing and how to maximize the value of cloud
development
• Learn how to integrate Bluemix into your own development process
• Learn the importance of designing an application to run on a cloud platform, such as IBM
Bluemix
• Understand the different runtime options for deploying an application
7 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 1: IBM Bluemix overview
Basics of the IBM cloud platform as a service
© Copyright IBM Corporation 20158
IBM Bluemix – Hands On Workshop
IBM® Bluemix™: IBM’s cloud platform
9 © Copyright IBM Corporation 2015
Bluemix service categories
Developer experience
•Rapidly deploy and scale
applications in any language.
•Compose applications quickly with
useful APIs and services and avoid
tedious backend configuration.
•Realize fast time-to-value with
simplicity, flexibility, and clear
documentation.
Enterprise capability
•Securely integrate with existing
on-premises data and systems.
•Choose from flexible deployment
models.
•Manage the full application
lifecycle with DevOps.
•Develop and deploy on a
platform built on a foundation of
open technology.
Built on a foundation of open technology
Build, run, scale, manage, integrate, and secure applications in the cloud.
•DevOps
•Big data
•Mobile
•Watson
•Business analytics
•Database
•Web and application
•Security
•Internet of Things
•Cloud integration
•API management and
integration
IBM Bluemix – Hands On Workshop
So what is Bluemix?
10
Bluemix is an open-standards, cloud-based platform for
building, running, and managing applications.
Build your apps, your way
Use the most prominent
compute technologies to
power your app: Cloud
Foundry, Docker, OpenStack.
Extend apps with services
A catalog of IBM, third party,
and open source services
allow the developer to stitch
an application together
quickly.
Scale more than just
instances
Development, monitoring,
deployment, and logging tools
allow the developer to run
and manage the entire
application.
Layered Security
IBM secures the platform and
infrastructure and provides you
with the tools to secure your
apps.
Deploy and manage hybrid
apps seamlessly
Get a seamless dev and
management experience across
a number of hybrid
implementations options.
Flexible Pricing
Try compute options and
services for free and, when
you’re ready, pay only for what
you use. Pay as you go and
subscription models offer
choice and flexibility.
Coming Summer 2015
IBM Bluemix – Hands On Workshop
Addressing many types of use cases
•Extend existing applications
- Add user experience such as mobile, social
- Add new capabilities integrating other services and APIs
- Do rapid experimentation for new capabilities
•API-enable applications
- Scalable API layer on top of existing services
- Simplify how composite service capabilities are exposed
through APIs
•New applications
- Systems of Engagement
- Different state management models
- Twelve-factor applications
Backend Systems and
Integration
API Creation and
Management New Channels and
Opportunities
© Copyright IBM Corporation 201511
IBM Bluemix – Hands On Workshop
Bluemix structure
© Copyright IBM Corporation 201512
IBM Bluemix – Hands On Workshop
How does Bluemix work?
Bluemix is underlined by three key open compute technologies: Cloud Foundry, Docker, and
OpenStack.
It extends each of these with a growing number of services, robust DevOps tooling,
integration capabilities, and a seamless developer experience.
13
Flexible Compute Options to Run Apps / Services
Instant Runtimes Containers Virtual Machines
Platform Deployment Options that Meet Your Workload Requirements
Bluemix
Public
Bluemix
Dedicated
Bluemix
Local*
DevOps
Tooling Your Own Hosted Apps / Services
Integration
and API
Mgmt
Powered by IBM SoftLayer In Your Data Center
+ + +
+ +
+ Always focused on what’s next
Catalog of Services that Extend Apps’ Functionality
Web Data Mobile AnalyticsCognitive IoT Security Yours
+
*Bluemix Local coming Summer
IBM Bluemix – Hands On Workshop
More openness and choice than ever before
14
Bluemix is anything but locked down. You choose how you build, deploy, and
manage your apps. Bluemix takes care of the rest.
Compute
Choose the level of
infrastructure
abstraction based on
your app’s
architectural needs.
Dev Tooling
From editors to source
code management to
continuous delivery, you
can use Bluemix’
powerful tooling or
easily bring your own.
Location
Deploy apps to Bluemix
Public (in a growing
number of geos), your
own dedicated cloud
Bluemix, or one that runs
within your data center
(Local*).
Services
Pick from a catalog of
IBM, third party, open
source, or your own
services to extend your
apps.
IBM
Third Party
Open Source
Yours
*Bluemix Local coming Summer 2
IBM Bluemix – Hands On Workshop
Bluemix offers different compute models to “run your
code”
© Copyright IBM Corporation 2015
Cloud Foundry
application
Docker container Virtual machine
Consistent experience:
• Common service binding and consumption model
• Common user ID and permissions model
• Ability to hook into common routing layer
expanding
Level of
abstraction
Flexibility
15
Reference: Bluemix Instant Runtimes, Containers or Virtual Machines?
IBM Bluemix – Hands On Workshop
A PaaS helps developers focus on what’s most
important to them: The application
• Bluemix eliminates and
dramatically simplifies
various tasks:
• OS patching
• OS security hardening
• Deployment
• Load-balancing
• Scaling
• Health management
16 © Copyright IBM Corporation 2015
Networking
Storage
Servers
Virtualization
O/S
Middleware
Runtime
Data
Applications
Traditional
On-Premises
Networking
Storage
Servers
Virtualization
O/S
Middleware
Runtime
Data
Applications
Platform
as a Service
Networking
Storage
Servers
Virtualization
O/S
Middleware
Runtime
Data
Applications
Software
as a Service
Networking
Storage
Servers
Virtualization
Middleware
Runtime
Data
Applications
Infrastructure
as a Service
O/S
Vendor Manages in CloudClient Manages
Standardization; OPEX savings; faster time to value
Customization; higher costs; slower time to value
IBM Bluemix – Hands On Workshop
Bluemix: foundational concepts
Account – Anchor point for billing
UserUserUser
Organizations
•Enables team collaboration
Organizations
•Enables team collaboration
Organizations – enables team collaboration
Spaces
• Logical grouping of apps and service instances
• per-user permissions
Spaces
• Logical grouping of apps and service instances
• per-user permissions
Spaces
• Logical grouping of apps and service instances
• Per-user permissions
Space
Apps Space
VMs
Space
Containers
SpaceService
instances
17 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
So what’s a Region ?
us-south
https://console.ng.bluemix.
net
https://api.ng.bluemix.net
eu-gb
https://console.eu-
gb.bluemix.net
https://api.eu-gb.bluemix.net
- Dedicated cloud Foundry Installation & services
- Maximum isolation from entities in other regions
18 Hands on Workshop - © Copyright IBM Corporation 2015
au-syd
https://console.au-
syd.bluemix.net
https://api.au-
syd.bluemix.net
IBM Bluemix – Hands On Workshop
Building increasingly flexible deployment models
Public Dedicated On-premises
© Copyright IBM Corporation 201519
IBM Bluemix – Hands On Workshop
Module 2: The Bluemix tour
Demo of the Bluemix interface
20 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Bluemis Tours…
21 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 3: Boilerplate applications
Deploying your first application
22 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Boilerplates
•Provide a fast way to get an application stated
•Package of sample application code and services
23 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 3a: Deploy your first application
24 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Accessing sample code
•Sample code for the application is available to download after a runtime or
boilerplate has been deployed.
25 © Copyright IBM Corporation 2015
1.Click
2.Click
IBM Bluemix – Hands On Workshop
Command-line interface
• Bluemix uses the Cloud Foundry command-line interface (CLI): cf
•cf help provides help page showing all the commands
•cf help <command> provides help for specific command
26 © Copyright IBM Corporation 2015
cf l login cf ds delete service
cf t target space or organization cf bs bind service to application
cf a list apps in current space cf st start app
cf app
display status for specific app
in current space
cf sp stop app
cf p push (deploy or update) app cf d delete app
cf s show service info cf scale scale app
cf cs
create service cf logs tail or show logs for app
IBM Bluemix – Hands On Workshop
Sample cf commands
To log in to Bluemix:
cf l –a https://api.ng.bluemix.net -u <email> -p <password> -o <email> -s dev
cf l –a https://api.eu-gb.bluemix.net -u <email> -p <password> -o <email> -s
dev
This command will log in to Bluemix, set the organization to the user’s own organization, and
the space to dev
To check what space you are logged into or to change the space:
cf t
cf t -s test
The first option prints the current target organization and space.
The second option switches to the test space.
To check what spaces exist in an organization:
cf spaces
Displays the spaces available in the current organization.
cf space dev
Displays information about the dev space in the current organization.
27 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 3b: Deploy then update an
application using the Command Line
Interface
28 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Eclipse plug-in for Bluemix
• Available in the Eclipse marketplace
• Enables developers to develop in Eclipse and then deploy to Bluemix
 Java and JavaScript are supported
29 © Copyright IBM Corporation 2015
Servers view Right click Bluemix
Select Add and
Remove …
Select available app
Click Add to deploy
to Bluemix
IBM Bluemix – Hands On Workshop
Define your Bluemix server connection in Eclipse
• In Eclipse preferences, select Server then Runtime Environments.
• Add a server definition for each Bluemix space that you want to deploy
to.
30 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Adding additional Bluemix regions to Eclipse
31 © Copyright IBM Corporation 2015
1. Click Manage Cloud from the Add Bluemix Account dialog box.
2. Click Add to add an additional Bluemix cloud
3. Enter the details of the Bluemix region by providing the name and endpoint URL
4. Click Finish.
For more information about region endpoint URLs, see:
https://www.ng.bluemix.net/docs/#overview/overview.html#ov_intro__reg
IBM Bluemix – Hands On Workshop
Environment Variables
•Bluemix sets environment variables when deploying an application to
inform the application about the environment it is running in.
 Application may need to use this information to set configuration – such as
the hostname and port to listen for incoming requests.
 VCAP_APP_HOST – specifies the hostname on which your application should
listen
 VCAP_APP_PORT – specifies the port number on which your application
should listen
•You can also define custom environment variables to provide configuration
to your application
32 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Manifest file
• Allows you to specify the parameters for an application deployment
• manifest.yml file is used at deploy time if found in directory application
is being pushed from
---
applications:
- name: Myphpmyadmin
memory: 128M
instances: 1
host: Myphpmyadmin
path: .
buildpack: https://github.com/dmikusa-pivotal/cf-php-build-pack.git
services:
- mysql_BlueMixLab
---
applications:
- name: bluemix-todo-node
host: bluemix-todo-node-${random-word}
command: node app.js
memory: 128M
services:
- todo-db
http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
33 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
.cfignore
•When you push an application all content of the current directory and all
sub directories are pushed to the server – this is not the behavior you
always want
•.cfignore allows control of what is sent to the server by listing the files and
directories you do not want to send to the server
•Sample .cfignore file:
.git
node_modules
tmp
lib-src
34 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 3c: Working with Eclipse and
Bluemix
35 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Summary
• Bluemix provides a number of options for developing applications
giving you the ability to integrate Bluemix into the developer tools of
your choice
• Bluemix provides starter packs to get you up and running quickly
• Start applications from scratch
36 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 4: DevOps and Bluemix
Overview of DevOps services and app development
37 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
IBM Bluemix DevOps services
An 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 autodeploy
 Complementary mobile quality and
application performance monitoring
 Use your favorite tools or work from the web
IDE
 Free public and fee-based private projects
• Scalable, secure, enterprise-ready
 Runs on SoftLayer infrastructure
38 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
DevOps Services available today
39 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 4a: IBM Bluemix integration
with DevOps services
40 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Get productive with Bluemix DevOps services in
minutes
• Register at www.jazzhub.com
• Answer a few questions
 Which Source Code Management
(SCM) - Git, GitHub, Jazz SCM?
 Do you want your project to be
public or private?
 Do you want to practice agile
software development?
 Do you want to deploy on IBM
Bluemix?
• Start coding
41 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Collaborate seamlessly on public or private
projects
• Easily invite team members
• Access from anywhere
• Built for collaboration from the ground up
• Choose who sees your project and how you engage with broader
communities
42 © Copyright IBM Corporation 2015
Invite other people to
your project
Enter a comma
separated list of
email addresses
IBM Bluemix – Hands On Workshop
43
Agile development in the cloud is easy with
Bluemix DevOps services
• Built-in agile process support
• Work items to track and plan project activities
• Agile tools for the product backlog, releases, and sprints
• Dashboard charts for project status
43 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Choose how you code with Bluemix DevOps
services
• Browser-based integrated
development environment
• Full support for local
development with Eclipse
or Visual Studio
• Built-in support for Jazz
Source Control
• Hosted Git repository
• Got GitHub? No problem
44 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Live Sync for Node.js
• Enables Node.JS code changes
to be pushed live without the
need to redeploy the application
• Available in IBM Bluemix
DevOps services as the Live Edit
feature
(Chrome browser only for debug)
• Available on Microsoft Windows
and Applied OS X platforms from
the command line using the Live
Sync CLI
45 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 4b: Working in DevOps Services
46 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Leverage the power of social coding
47 © Copyright IBM Corporation 2015
Public Private
With public projects, it’s easy to learn and share work with a broader
audience.
IBM Bluemix – Hands On Workshop
Summary
• IBM Bluemix DevOps Services:
 Provides an online set of tooling to plan, manage, develop, and deploy
your application
 Can use the build in code repository or choose to use Git Hub
 Allows developers to collaborate on a project
 Allows developers to work online or locally on the same project
48 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 5: Cloud development and the
new IT
Maximizing the value of Bluemix
49 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Challenges and expectations
• Time to market for new applications is
to long
• Speed and innovation are needed to
capture new business opportunities
• Remove blockage from IT deployment
• Competitive threat from new ”on the
web born” companies
• Clients want to enter the API economy.
Need environment to share or sell
software assets they build/own
• Reduce operational cost and limit capital
investments and remove the need to
manage and procure assets and services
50 © Copyright IBM Corporation 2015
Developers’ expectations:Client business challenges:
IBM Bluemix – Hands On Workshop
Bluemix can fit into a software development
process, but will it deliver the promised value?
51 © Copyright IBM Corporation 2015
Initiation
Planning
Requirements
Analysis
Design
Development
Integration
System Test
Deployment
Operation and
Maintenance
IBM Bluemix – Hands On Workshop
What does it take to deliver the promised value?
52 © Copyright IBM Corporation 2015
• User-centered design
• Agile methodology
• DevOps processes and tooling
• Architect for cloud
Microservices
Architecture
IBM Bluemix – Hands On Workshop
User-centered design
53 © Copyright IBM Corporation 2015
Hills: who, what,WOW
Sponsored users: design for
real users, not for imagined
needs
Playbacks: collaborate to tell
a great story
IBM Bluemix – Hands On Workshop
Agile methodology
54 © Copyright IBM Corporation 2015
Agile principles
The Agile Manifesto is based on 12 principles:
•Customer satisfaction by rapid delivery of useful software
•Welcome changing requirements, even late in development
•Working software is delivered frequently
•Close, daily cooperation between business people and
developers
•Projects are built around motivated individuals, who should
be trusted
•Face-to-face conversation is the best form of
communication (co-location)
•Working software is the principal measure of progress
•Sustainable development, able to maintain a constant pace
•Continuous attention to technical excellence and good
design
•Simplicity—the art of maximizing the amount of work not
done—is essential
•Self-organizing teams
•Regular adaptation to changing circumstance
Agile practices
Agile development is supported by several concrete
practices, covering areas such as requirements, design,
modeling, coding, testing, project management, process,
and quality. Some notable agile practices include:
• Acceptance test-driven development (ATDD)
• Agile modeling
• Backlogs (product and sprint)
• Behavior-driven development (BDD)
• Cross-functional team
• Continuous integration (CI)
• Domain-driven design (DDD)
• Information radiators (scrum board, task board, visual
management board, burndown chart)
• Iterative and incremental development (IID)
• Pair programming
• Planning poker
• Refactoring
• Scrum events (sprint planning, daily scrum, sprint review, and
retrospective)
• Test-driven development (TDD)
• Agile testing
• Timeboxing
• Use case
• User story
• Story-driven modeling
• Retrospective
• Velocity tracking
From Wikipedia:
IBM Bluemix – Hands On Workshop
DevOps
55 © Copyright IBM Corporation 2015
Goals
The specific goals of a DevOps approach span the entire delivery
pipeline.They include improved deployment frequency, which can lead to
faster time to market, lower failure rate of new releases, shortened lead
time between fixes, and faster mean time to recovery in the event of a
new release crashing or otherwise disabling the current system.
Simple processes become increasingly programmable and dynamic, using
a DevOps approach,which aims to maximize the predictability, efficiency,
security, and maintainability of operational processes.Very often,
automation supports this objective.
Adoption
The adoption of DevOps is being driven by factors such as:
• Use of agile and other development processes and methodologies
• Demand for an increased rate of production releases from application and business
unit stakeholders
• Wide availability of virtualized and cloud infrastructure from internal and external
providers
• Increased usage of data center automation and configuration management tools
FromWikipedia:
IBM Bluemix – Hands On Workshop
Bluemix unified DevOps experience (roadmap)
56 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Application architecture
57 © Copyright IBM Corporation 2015
Feeds
Pub/sub
Task
Task
Backend Cache
Backend
Web
Web
Web
IBM Bluemix – Hands On Workshop
Twelve-Factor app
(http://12factor.net)
In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service.
The twelve-factor app is a methodology for building software-as-a-service apps that:
• Use declarative formats for setup automation to minimize time and cost for new developers joining the project
• Have a clean contract with the underlying operating system, which offers maximum portability between
execution environments
• Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems
administration
• Minimize divergence between development and production, enabling continuous deployment for maximum
agility
• Can scale up without significant changes to tooling, architecture, or development practices
The twelve-factor methodology can be applied to apps written in any programming language, and which use any
combination of backing services (database, queue, memory cache, etc).
I. Codebase
One codebase tracked in revision control, many deploys
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing Services
Treat backing services as attached resources
V. Build, release, run
Strictly separate build and run stages
VI. Processes
Execute the app as one or more stateless processes
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and graceful shutdown
X. Dev/prod parity
Keep development, staging, and production as similar as possible
XI. Logs
Treat logs as event streams
XII. Admin processes
Run admin/management tasks as one-off processes
© Copyright IBM Corporation 201558
IBM Bluemix – Hands On Workshop
Exercise 5a: Creating a new project and
code repository
59 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Best tools for the job
• Importance of having a good developer setup
• Lint tooling (static analysis is useful for code quality)
• Syntax highlighting, autocomplete, etc.
• Quality Assurance needs to be part of the development process
 Continuous testing during development
 Test tools such as Mocha, Chai, Sinon for JavaScript
60 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 5b: Setting up for static analysis
and test-driven development
61 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Test-driven development
•No code is written unless it is to pass a test.
•When one function calls another function, ensure that unit tests are not
duplicating tests done by the tests for the called function.
 Test frameworks provide spy functionality to verify functions are called
correctly rather than testing what the called function returns.
•Wherever possible, ensure tests cover problematic areas of the
implementation language.
 For example, with a JavaScript string vs number comparison,
“5” > “11” but 5 < 11 type coercion sometimes delivers the wrong comparison
62 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 5c: Test-driven development
63 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
DevOps pipeline in Bluemix
IBM Bluemix DevOps Services can be configured to automatically run
tests and if the tests pass, the code is deployed to Bluemix.
64 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 5d: Adding a REST API,
deploying to Bluemix, and setting up the
DevOps pipeline
65 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Summary
• A modern cloud platform alone does not deliver the agility and speed
businesses require today.
• A modern approach to application creation is needed, which delivers:
 Innovation
 Agility
 Quality
 Best user experience
• This approach requires an appropriate design, methodology, set of
processes, tooling, and architecture to enable developers to deliver.
• Many companies are adopting a bimodal approach to manage existing
applications and enable innovative new applications to be created.
66 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 6: Services
Using and adding services in IBM Bluemix
67 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Using services in Bluemix
• Bluemix provides services that can be used by applications without
requiring you to manage the setup and operation of those services.
• Available services are listed in the catalog in the web UI and can also
be obtained by using the command cf marketplace.
• To use the service, you must bind the service to your application by
using web UI or the command cf bs.
68 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Accessing a service
• When you bind a service to your application, Bluemix adds details
about the service to an environment variable VCAP_SERVICES.
• You can view the VCAP_SERVICES variable in the web UI.
• Applications should be able to parse the VCAP_SERVICES variable.
69 © Copyright IBM Corporation 2015
Click
IBM Bluemix – Hands On Workshop
Parsing VCAP_SERVICES
•Node
if (process.env.VCAP_SERVICES) {
var env = JSON.parse(process.env.VCAP_SERVICES);
var credentials = env['mysql-5.5'][0].credentials;
…
}
•Ruby
mysql_dbs = JSON.parse(ENV['VCAP_SERVICES'])["mysql-5.5"]
credentials = mysql_dbs.first["credentials"]
•Java
String vcap_services = System.getenv("VCAP_SERVICES");
if (vcap_services != null && vcap_services.length() > 0) {
JsonRootNode root = new JdomParser().parse(vcap_services);
JsonNode mysqlNode = root.getNode(”mysql-5.5");
JsonNode credentials = mysqlNode.getNode(0).getNode("credentials");
…
}
The Java buildpack parses the VCAP_SERVICES variable and can auto-configure bound
services. See the Bluemix Liberty for Java documentation.
70 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Unit testing when services are used
• Do not include calls to remote systems in unit tests.
• Service APIs provide a contract between the service consumer and
service provider.
• Unit tests can ensure the code being tested is using the API correctly
according to the contract.
 We should assume that the service provider has also tested the service
and ensures it implements the contract that is defined by the API.
• Test frameworks provide capabilities to stub and mock external calls,
but ensure that the API is being called correctly when you run unit tests.
 These facilities are often called test doubles.
71 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 6a: Adding a service to an
application
72 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Become a service provider
•In additional to consuming services, you can create new services on
Bluemix
 Private services are available only to your organization
− cf cups biTestService -p "host, port, username, password”
− Specify the ‘properties’ you want to make available to applications binding to the
service
− You can update the properties if requires
 Public services, that can become an additional revenue stream, can only be
added through the IBM Cloud Marketplace
73 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 6b
Creating a user-provided service
74 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Summary
• The VCAP_SERVICES environment variable allows your application
to discover bound services and provides the information required to
access the service.
• Bluemix allows new services to be added through the IBM Cloud
Market Place.
• SoftLayer can be used to host services.
• User-provided services (private to an organization) can be created or
accessed the same way as a Bluemix provided service.
75 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 7: How Cloud Foundry works
Cloud Foundry internals
76 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
An open platform as a service (PaaS). The system supports multiple
frameworks, multiple application infrastructure services, and deployment
to multiple clouds.
Cloud Foundry
77 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Lots of languages, frameworks, and services
78 © Copyright IBM Corporation 2015
Multiple languages
• Ruby, Java, Scala, Node.js, Erlang, Python, PHP, etc.
Multiple frameworks
• Rails, Sinatra, Spring, Grails, Express, Lift, etc.
Multiple services
• MySQL, Postgres, MongoDB, Redis, RabbitMQ, etc.
Multiple clouds, Multiple IaaS environments
• Public cloud, microcloud, private cloud
IBM Bluemix – Hands On Workshop
Bluemix architecture
79 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Cloud Foundry kernel internals
80 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Design of a virtual machine (VM)
81 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Cloud Foundry: application staging
82 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Choosing the runtime for an application
•If you don’t specify a runtime when you deploy an application, Bluemix will
try to find a suitable runtime as follows:
1. Each predefined runtime has a position set and runtimes are tried in
ascending position order.
2. Bluemix asks each runtime, starting with runtime at position 1, if it can run
the application.
3. The first runtime that responds that it can run the application is used.
4. If no runtime can run the application, an error is returned.
•At deploy time, you can also specify the runtime to use.
83 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Buildpacks
•Buildpacks provide the framework and runtime support for your
application.
•The buildpack determines whether they can run your application as part
of the auto detect mechanism that Bluemix uses when you push an
application.
•You can control which platform-provided buildpack your application
should use or specify an external buildpack to be used to run your
application: “Bring your own Buildpack.”
84 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Specifying a buildpack
• Use the cf CLI to specify which buildpack to use when deploying your
application.
 Use the -b option with the command cf push
• You can specify the name of an internal buildpack or provide the URL
for an external buildpack.
•cf buildpacks shows the installed internal buildpacks that are
available:
• cf push myApp -b nodejs_buildpack
• cf push myApp -b https://github.com/dmikusa-pivotal/cf-php-build-pack.git
85 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Exercise 7a: Specifying a buildpack when
deploying an application
86 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Cloud Foundry: services
87 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 8: Containers
Docker, virtual machines, and Dockerfiles
88 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Docker containers and virtual machines (VMs)
Server Server
Host OS Host OS
Hypervisor Docker Engine
Guest
OS
Guest
OS
Guest
OS
Binaries
Libraries
Binaries
Libraries
Binaries
Libraries
Binaries
Libraries
Binaries Libraries
Appl
A
Appl
A
Appl
B
ApplB
ApplB
ApplB
ApplB
ApplB
ApplB
ApplA
ApplA
VM
Docker = Linux namespaces + cgroups + overlay file system + image format
Docker
© Copyright IBM Corporation 201589
IBM Bluemix – Hands On Workshop
Advantages to using containers
• High density: Because containers share the same operating system (OS) image and
middleware (when applicable), you can run more applications on a server.
 For example, if the full stack image required to run an application requires 1 GB, if you wanted to use a full VM, you’d 1
GB times the number of VMs. With LXC containers and AuFS, you can share the bulk of the 1 GB, and you can have
hundreds of containers and still use a little over 1 GB (assuming they are all running the same OS image).
• Fast start-up: Because containers might have several layers in common, only the new layers
need to be copied, dramatically reducing build/transfer/boot/load times.
 A full virtualized system usually takes about 10 minutes to start; LXC containers take seconds, and sometimes even less
than a second.
• Portability across environments: Deploying a consistent production environment is hard.
Even if you use tools like Chef and Puppet, there are always OS and library updates that
change between hosts and environments.
 Docker gives you the ability to snapshot the OS into a common image, and when combined with IBM’s patterns
technology, Docker makes it easy to deploy a collection of images comprising a given workload in another collection of
Docker hosts.
© Copyright IBM Corporation 2015
•Cloudy operations with Docker LXC outperform VM
• 48x server reboot, 1.5x server boot, 1.62x server
snapshot, etc.
•Docker LXC density potential compared to VMs
• 3x memory savings
• 26x CPU savings
• 3.22x smaller images in this test (note – image sizes can
vary based on required packages)
Manual VM Docker
Provision Time
Days
Minutes
Seconds / ms
Significant threat to virtualization
market
90
IBM Bluemix – Hands On Workshop
Docker’s components and functions
Container
Image
Repository
Dockerfile for
Container N
ImageN
Container Build
Engine
Server
Host OS
Linux Container + Docker Engine
ContainerA
ContainerB
ContainerN
Push new
Image to
Repository
Describes steps to build
the container
automatically from
source
Get N
…
Run N
Build N
Source Code
Repository
Build Store Run
© Copyright IBM Corporation 201591
IBM Bluemix – Hands On Workshop
Sample Dockerfile
• Dockerfile for WebSphere Liberty Profile:
FROM ubuntu:12.04
# add the files we require, jar + WLP files
ADD wlp-developers-extended-8.5.5.2.jar /root/
ADD wlp-developers-runtime-8.5.5.2.jar /root/
ADD JAXWSEJBSample.jar /root/
# install WLP
RUN apt-get update
RUN apt-get install -y default-jre
RUN java -jar /root/wlp-developers-runtime-8.5.5.2.jar --acceptLicense /root/
RUN java -jar /root/wlp-developers-extended-8.5.5.2.jar --acceptLicense /root/
RUN cd /root/wlp && java -jar ../JAXWSEJBSample.jar /root/wlp
EXPOSE 9080
CMD /root/wlp/bin/server run JAXWSEJBSample
92 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Summary
• The advantages of containers:
 Containers and VMs allow you to easily bring applications to Bluemix.
 They provide a way to virtualize and partition physical infrastructure.
 They allow IaaS and PaaS to converge and be co-located.
 They support a large scale deployment with low latency.
 Containers provide portability across environments.
93 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Module 9: Beyond the 30-day free trial
Freemium level of service
94 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
After the 30-day Bluemix trial
•After your 30-day trial ends, you will be asked to enter a credit card to
continue using Bluemix.
•You are still able to use Bluemix for free after you enter your credit card
details because there is a freemium level of service available:
 375 GB-hours are free every month—wow!
 Services have a free plan.
•Use the Pricing Sheet and price calculator to verify what you can run for
free each month.
•Use your account summary to check your monthly usage.
•Set notifications to advise when cost thresholds are being reached.
95 © Copyright IBM Corporation 2015
IBM Bluemix – Hands On Workshop
Use the Bluemix UI to manage your Freemium
usage
Dashboard
Pricing Calculator
Account Summary
and Notifications
© Copyright IBM Corporation 201596
© 2015 IBM Corporation
IBM Bluemix and Mobile
Redefining Mobile Platform for Developers
Nguyễn Tài Dũng
Cloud Solution Architect + Bluemix Evangelist
IBM Clouds and Ecosystem Development
Email: dzungnt@vn.ibm.com
© 2014 IBM Corporation98
Building Mobile Apps with Cloud
Services
99
IBM MobileFirst reduces your mobile
back-end effort so that you can focus on creating value
where it matters most – your customers’ experiences
Today, most organizations have no choice but to focus
mobile efforts
“under the surface”
Development
Engagement
Security
Operations
Development
Engagement
Security
Operations
The right mobile technologies enable you to deliver great apps
100
IBM MobileFirst Platform Foundation 7.1 – Component Overview
101
b
The MobileFirst platform provides flexibility for you to consume and
compose the capabilities you need – on premise or in the cloud
Quality Assurance
Application Scanning
On Premise or Private Cloud Modules
Application Scanning
Detect code security vulnerabilities at the time of
development
Quality Assurance
Collect beta test feedback, crashes and analyze
user sentiment
Foundation
Development environment, continuous delivery,
operations, security and integration
As Services in Bluemix
Cloud APIs
Cloudant NoSQL DB, Workflow, Business Analytics,
more
Foundation
Services in IBM Bluemix
102
The MobileFirst Platform is integrated into IBM Bluemix Cloud Services
Mobile
Application
Security
Mobile Quality
Assurance
Embeddable
Reporting
Cloudant
NoSQL DB
Cloud
Integration
Workflow
Business
Rules
Cloud
Storage for
mobile data
management
Security
to prevent
unauthorized
access to data
Integration
Connect with
APIs & Systems
of Record
Workflow
to automate
next actions
Analytics
for reporting
and insight
© 2014 IBM Corporation103
Mobile Cloud
104
Offline Mobile Cloud Application
Fat Clients with presentation and business logic processed
locally.
Data downloaded from backend when on WIFI /
Occasionally
Advantages: Well Integrated and can be Optimized for
Performance
Availability: even without network connectivity.
Disadvantages: No Portability, Complex Code.
105
All processing done online presentation layer at the client.
Many times assumes constant connectivity with backend
Advantages: Multiplatform, Direct and Instantaneous
Accessibility to better services.
Disadvantages: Excessive latency for real time responsiveness, no
access to device features, sometimes difficult to maintain sessions
for a long time.
Online Mobile Cloud Application
106
WHAT IS MOBILE CLOUD ?
• MC refers to an infrastructure where both the data storage and
data processing happen outside of the mobile device.
• Mobile cloud applications move the computing power and
data storage away from the mobile devices and into powerful
and centralized computing platforms located in clouds, which
are then accessed over the wireless connection based on a thin
native client.
• MOBILE CLOUD = MOBILE COMPUTING + CLOUD
COMPUTING
107
WHY DO WE NEED MOBILE CLOUD?
–Mobile devices face many resource challenges (battery
life, storage, bandwidth etc.)
–Cloud computing offers advantages to users by allowing
them to use infrastructure, platforms and software by
cloud providers at low cost and elastically in an on-
demand fashion.
–Mobile cloud computing provides mobile users with data
storage and processing services in clouds, obviating the
need to have a powerful device configuration (e.g. CPU
speed, memory capacity etc), as all resource-intensive
computing can be performed in the cloud.
108
Mobile Cloud: Enabling New Applications
Idea: Offload Computation to Cloud
109
IBM Mobile Offerings in Data and Push Services
Persistent cloud with ability to Notify on
Events or completion of processing
01010
10101
0101
110101
010001
01
0101
0
000111
000101
01
∆
© 2014 IBM Corporation110
Bluemix Mobile Backend
as a Service
111
© 2014 IBM Corporation112
Mobile and Bluemix MBaaS
© 2014 IBM Corporation113
Mobile and Push Notification
© 2014 IBM Corporation114
Push Notification
© 2014 IBM Corporation115
Bluemix Mobile Quality Assurance
© 2014 IBM Corporation116
Bluemix Mobile Quality Extensions
© 2014 IBM Corporation117
Deploying the
MobileFirst Server
© 2014 IBM Corporation118
MobileFirst
Platform
Server
Bluemix
Softlayer bare
metal
Linux instance
Bluemix
app
Bluemix
Services
MobileFirst
app
MobileFirst, Softlayer and Bluemix
Shared
Identity
Token
Adapters
© 2014 IBM Corporation119
Spectrum of mobile app development approaches
Web-Native Continuum
 HTML5, JS, and
CSS3 (full site or
m.site)
 Quicker and
cheaper way to
mobile
 Sub-optimal
experience
 HTML5, JS, and
CSS
 Usually
leverages
Cordova
 Downloadable,
app store
presence, push
capabilities
 Can use native
APIs
 As previous
 + more
responsive,
available offline
 Web + native
code
 Optimized user
experience with
native screens,
controls, and
navigation
 App fully
adjusted to OS
 Some screens
are multi-
platform when
makes sense
 App fully
adjusted to OS
 Best attainable
user experience
 Unique
development
effort per OS,
costly to maintain
HybridPure web Pure native
Mobile
web site
(browser
access)
Native
shell
enclosing
external
m.site
Pre-
packaged
HTML5
resources
HTML5 +
native UI
Mostly
native,
some
HTML5
screens
Pure
native
© 2014 IBM Corporation120
Studio provides authoring, visual design, simulation, and runtime
skins for hybrid apps
© 2015 IBM Corporation
The Path to New Value with IBM Big Data & Analytics
Presenter: Nguyen Tai Dzung
Technical Consultant + Solution Architect
EcoD Team, IBM Vietnam
dzungnt@vn.ibm.com
© 2015 IBM Corporation122
© 2015 IBM Corporation123
The World of Big Data & Analytics Is Rapidly Expanding…
© 2015 IBM Corporation
Mức lương trung bình mỗi năm: 116.414 USD (khoảng 2 tỷ 515 triệu đồng) …
Thực tế, “big data” đang là cụm từ “hot” nhất trong toàn bộ thế giới công nghệ hiện nay. Ý nghĩa của
“Big Data” (“Dữ liệu Lớn”) là khá rộng: thu thập những khối lượng dữ liệu khổng lồ (email, văn bản,
video, status Facebook…), xử lý các khối lượng dữ liệu này để tìm ra các thông tin có nghĩa giúp các
công ty, tổ chức có thể đưa ra các quyết định kinh doanh phù hợp hơn trong tương lai.
Với sự vươn lên mạnh mẽ của các mạng xã hội trong những năm qua cũng như của Internet of Thing
trong tương lai gần, “Big Data” chắc chắn sẽ còn tiếp tục “hot” trong vòng nhiều năm nữa.
Các công việc liên quan tới Big Data bao gồm cả các tác vụ phân tích, các loại cơ sở dữ liệu NoSQL
(không đi theo mô hình bảng quan hệ như thông thường do quá nhiều dữ liệu), Hadoop v…v…
Rất nhiều doanh nghiệp đang chạy theo trào lưu này: từ các công ty khởi nghiệp, các công ty dịch vụ
phần mềm cho đến các công ty thông thường. Bởi vậy mà Dice hiện đang có tới 35.000 đầu việc cho
Big Data, và thu nhập cho các công việc liên quan tới công nghệ này tăng tới 9,3% trong năm qua.
Nguồn bài viết: http://vieccntt.com/30-cong-nghe-lap-trinh-thu-nhap-25-ty-dong-moi-nam-p1.html
124
Big Data
© 2015 IBM Corporation
Dữ liệu lớn (Big data) là thuật ngữ dùng để mô tả các bộ dữ liệu có kích thước rất lớn, khả năng phát
triển nhanh, và rất khó thu thập, lưu trữ, quản lý và phân tích với các công cụ thống kê hay ứng
dụng cơ sở dữ liệu truyền thống. Một số đặc trưng của Big Data bao gồm:
1. Volume (Dung lượng): Dung lượng của Big Data đang tăng lên mạnh mẽ
từng ngày từ các nguồn như thiết bị di động bao gồm video, hình ảnh,
con người tương tác trên các hệ thống(mạng xã hội, transaction từ bán lẻ …)
 Cứ mỗi 11 giây, một petabyte (~ một triệu GB) dữ liệu được tạo ra trên toàn
thế giới, tương đương với một đoạn video HD dài 13 năm.
 Facebook phải xử lý khoảng 500 TB dữ liệu mỗi ngày (forum, chat, hình ảnh)
 Wallmart – dữ liệu của họ đến từ các transactions
 Lợi ích thu được từ việc xử lý một khối lượng lớn dữ liệu chính là điểm thu hút chủ yếu của Big
Data, tuy nhiên cũng đặt ra nhiều khó khăn trong việc tìm ra những phương pháp, kỹ thuật để
xử lý khối lượng dữ liệu này.
2. Velocity (Tốc độ): với sự ra đời của các kỹ thuật, công cụ, ứng dụng lưu trữ,
nguồn dữ liệu liên tục được bổ sung với tốc độ nhanh chóng.
Tổ chức McKinsey Global ước tính lượng dữ liệu đang tăng trưởng với
tốc độ 40%/năm, và sẽ tăng 44 lần từ năm 2009 đến 2020.
125
Big Data Is All Data (1/2)
Data at Scale
Volume
Data in Motion
Velocity
© 2015 IBM Corporation126
Big Data Is All Data (2/2)
Data in Many
Forms
Variety
Data
Uncertainty
Veracity
3. Tính đa dạng (variety): Dữ liệu được thu thập từ nhiều nguồn
khác nhau, từ các thiết bị cảm biến, thiết bị di động, qua mạng xã hội
.v.v…
Các kiểu dữ liệu có cấu trúc, bán cấu trúc và không có cấu trúc tồn tại
dưới nhiều hình thức bao gồm hình ảnh, âm thanh, video, văn bản,
v.v…
4. Veracity (Độ chính xác): một trong những tính chất phức tạp
nhất của BigData là độ chính xác của dữ liệu.
Sự gia tăng mạnh mẽ tính tương tác và chia sẻ của người dùng Mobile
làm cho bức tranh xác định về độ tin cậy và độ chính xác của dữ liệu
ngày một khó khăn hơn.
 Bài toán phân tích và loại bỏ dữ liệu thiếu chính xác và nhiễu đang là
tính chất quan trọng của BigData. [2]
5. Giá trị (value): đây là đặc trưng quan trọng nhất của Big Data, đề
cập đến quá trình trích xuất các giá trị to lớn đang tiềm ẩn trong các
bộ dữ liệu khổng lồ.
© 2015 IBM Corporation127
Two types of big data
1. Data in Movement – Streams
Data following constantly through a network or other data transport
mechanism. Data persisted in memory on a temporary basis is also
persisted to be “in motion”.
 Twitter / Facebook comments
 Stock market data
 Sensors: Vital signs of a newly-born
2. Data at Rest – Oceans
Data is persisted in a physical medium and is considered
relatively static
 Collection of what has streamed
 Web logs, emails, social media
 Unstructured documents: forms, claims
 Structured data from disparate systems
© 2015 IBM Corporation128
Tools to address practical challenges managing Big Data
InfoSphere BigInsights for Hadoop
For data at rest
100% standard Hadoop
IBM Big SQL, BigSheets
Developer tools, Accelerators
Ease of use for all roles
InfoSphere Streams
For data in motion
Agile development environment
Sub-millisecond response
Live graph, streams debugger
Packaged adapters and toolkits
Geospatial Toolkit
© 2015 IBM Corporation129
Big Data & Analytics on Bluemix
https://ace.ng.bluemix.net/#/home
You can launch Big Data services and build applications in
minutes on Bluemix. Use only what you need.
© 2015 IBM Corporation
IBM Cloudant
Innovator of “Database as a Service” (DBaaS)
JSON document database
For mobile, Web, & IoT apps that need:
Elastic scalability
High availability
Data model flexibility
Data mobility
Available as:
Fully managed DBaaS
On-premises private cloud
Hybrid architecture
Build More. Grow More.
Sleep More.
© 2015 IBM Corporation131
Hadoop là gì?
 Tóm tắt ngắn gọn về Hadoop:
1. Framework cho phép phát triển ứng dụng phân tán
2. Viết bằng Java, nhưng hỗ trỡ được C++, Python, Perl
3. Linux-based
4. Làm việc với khối lượng dữ liệu khổng lồ (tính bằng Petabyte).
5. Xử lý trong môi trường phân tán, dữ liệu lữu trữ ở nhiều phần cứng khác nhau,
yêu cầu xử lý đồng bộ.
 Hadoop có 2 thành phần:
1. Hadoop Distributed File System: lưu trữ phân tán
2. MapReduce: xử lý phân tán
 Hadoop có thể xử lý các ứng dụng có khối lượng dữ liệu lớn một cách nhanh chóng,
chính xác, hiệu quả cao bằng cách lưu và tính toán dữ liệu trên nhiều node một cách
độc lập. Cụ thể:
Dữ liệu được chia ra thành blocks lưu trữ trên rất nhiều DataNode, mỗi block có
nhiều bản sao lưu trên nhiều DataNode khác nhau, phòng khi một DataNode nào đó
có sự cố thì hệ thống vẫn hoạt động bình thường.
© 2015 IBM Corporation132
Hướng giải quyết của Hadoop...
 Quản lý file phân tán: Hadoop Distributed File System (HDFS) sẽ chia nhỏ dữ
liệu ra thành nhiều phần. Dữ liệu được quản lý một cách có hệ thống. Ý tưởng
được sử dụng ở đây là “di chuyển tính toán vào trong dữ liệu” thay vì “di
chuyển dữ liệu để tính toán” như cách thông thường.
 Các tiến trình hoạt động độc lập: MapReduce là mô hình tổ chức của Hadoop,
theo đó các node hoạt động một cách độc lập cao. Mặc dù giữa các node vẫn
có giao tiếp nhưng bị giới hạn một cách tối đa, do đó giảm thiểu rủi ro khi một
node bị lỗi.
 Khả năng mở rộng tự nhiên: nhiều chương trình được viết triên các hệ thống
phân tán khác ngoài Hadoop, mỗi lần mở rộng hệ thống từ 10 máy lên 100 hay
1000 máy thì đòi hỏi phải sửa đổi cấu trúc chương trình rất là nhiều. Cách thiết
kế của Hadoop giúp mở rộng chương trình một cách tự nhiên mà không cần
phải thay đổi nhiều hoặc thay đổi rất ít trong một vài trường hợp đặc biệt.
© 2015 IBM Corporation133
Hướng giải quyết của Hadoop...
IBM Internet of
Things
More and more of the world’s activity is being expressed
digitally by billions of interconnected devices…
135
Smarter
cities
Smarter
vehicles
Smarter
home
Smarter
health
Smarter
factories
Smarter
transportatio
n
…providing businesses with the ability to learn more about their
operating environment, and identify and act with the potential to
create new value.
DATA
Unlocked from billions of connected devices
CLOUD
Standards based connectivity from anywhere
ENGAGEMENT
New revenue opportunities created from insights
Today 3 technology forces are converging
that are accelerating IoT
SilverHook Powerboats – develops app 40%
faster, enhancing racer and fan experience
“It changes the paradigm in a lot of different areas if we can develop this type
of technology at this speed. It gives other projects a benchmark to live up to.”
—Nigel Hook, president of SilverHook Powerboats
Solution components
Software
•IBM® Bluemix™
•IBM Internet of Things Foundation
The transformation: Powerboat racers and fans both needed real-
time insight into what was happening during races. With IBM®
Bluemix™ and IBM Internet of Things Foundation, the SilverHook
Powerboat team developed an application 40% faster, streaming
sensor data to the cloud and using analytics to deliver information
and alerts to racers. Partner company Virtual Eye also used the
data to create a rich 3-D visualization for fans.
Improves
decision-making and safety during the
race by providing critical data to
drivers
Enhances
fan experience of races with real-
time 3D data visualization
40% faster
application development process
MSP03109-USEN-00
Video:- https://www.youtube.com/watch?v=rpsjxnoNc-U
Module 2
Intel Edison
138
Intel® Edison Board
Small, Powerful & Adaptable Hardware
Dual-core Intel® Atom™ processor 500MHz
Integrated Wi-Fi*, Bluetooth® Low-Energy (LE)
• 32-bit Intel® Quark™ microcontroller at 100 MHz
• 1 GB of RAM, 4 GB of Storage
• 40 multiplexed GPIO interfaces with expansion board options for total
project design and flexibility
• Yocto Project* Linux*
Module 2 –The Intel Edison board
Expansion options
Module 2 –The Intel Edison board
Partner
Expansion
Boards
Intel
Expansion Boards
Built to Order
Expansion
Boards
Intel® Edison
•70 pin connector
•Hirose DF40 Series
•Easy to build your own board
Intel currently offers 2 boards
•Breakout Board
•Arduino* expansion board
Module 2 –The Intel Edison board
Intel extension Boards
Intel® Edison
Development
Board with Arduino*
•20 digital input/output pins including
•4 pins as PWM outputs
•6 analog inputs
•1 UART (RX/TX)
•1 I2C input connector
•1 ICSP 6-pin header (SPI)
Module 2 –The Intel Edison board
Connect to your Edison
board
what are connectors/cables for ?
Module 2 –The Intel Edison board
Device mode micro USB for :
• 5V power
• Arduino IDE
• Ethernet over USB
• Flash memory
Host / device mode switch
Micro USB for Serial
commands
to Edison via terminal/putty to :
• Flash firmware
• Configure Edison
• IP address
Standard size USB – Host mode for
•Mouse
•Keyboard
•webcam
Barrel (7V-15V) DC power
connector
Intel® Edison
Breakout Board
•I/O: array of through-hole solder points
•USB OTG with USB Micro (AB)
•Battery charger
•USB micro (B) [UART]
•DC power supply jack (7 to 15 VDC)
Module 2 –The Intel Edison board
Partner Expansion
Boards
Module 2 –The Intel Edison board
Collaborate.
Learn. Share.
Succeed.•Intel® Developer Zone is where developers are tapping
into everything they need to successfully bring their
connected ideas to life.
Software tools and testing equipment —
Code samples and how to guides —
Dev Kits, hardware, sensors and more —
Forums, online events and meet-ups —
Peer review and expert insights —
A global community —
Module 2 –The Intel Edison board
software.intel.com/
iot
Module 3
Internet of Things
Foundation
147
IBM Internet of Things Foundation Service
Connect
Collect
Manage
Assemble
• Secure Device Registration
• Scalable Device Connectivity
• Device Management new!
• PAYG SaaS pricing
• Sandbox QuickStart service
• Powered by IBM MessageSight technology
Platform
IoT Zone on Bluemix an intro to
IoTF
IoT Zone in Bluemix https://bluemix.net/solutions/iot
IoT Foundation model
IBM IoT
Foundation
Connectivity Summary
IBM Internet of
Things
Foundation
10.1
Thank you!
Getting Started with IBM Bluemix
Hands-On Workshop
Module 3: First Deploy Exercises
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
2
Table of Contents
Workshop overview..................................................................................................................................... 3	
  
Exercise 3a: Deploy your first application................................................................................................... 3	
  
Exercise 3b: Deploy and then update the application by using the CLI...................................................... 5	
  
Exercise 3c: Working with Eclipse and Bluemix ....................................................................................... 13	
  
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
3
Workshop overview
In this workshop, you will:
• Deploy a simple application from the Bluemix web interface.
• Use the cf command line to modify and deploy the application.
• Configure Eclipse so that you can create IBM Bluemix as a runtime in Eclipse
Exercise 3a: Deploy your first application
This exercise will show you how to deploy a simple application from the IBM Bluemix web
interface.
1. In a browser, navigate to one of the following regions:
• https://bluemix.net: This link should take you to your default location.
o https://console.ng.bluemix.net (Region: US South)
o https://console.eu-gb.bluemix.net (Region: United Kingdom)
o https://console.au-syd.bluemix.net (Region: Sydney)
2. Click LOG IN and then enter your login information on the IBM id page and click Sign in.
You should see your dashboard view:
3. Click CATALOG.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
4
4. Select the Node.js Cloudant DB Web Starter from the Boilerplates section.
5. Enter a name for your application as shown above. The host name information is
automatically entered. The host name must be unique on Bluemix, so enter a name with
your company name or initials to make the name unique.
6. Click CREATE.
After a short while your application should be running. You can launch the application by clicking
on the route.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
5
Exercise 3b: Deploy and then update the application by using the
CLI
In this exercise, you use the cf command-line interface (CLI) to work with Bluemix. You use this
tool in a terminal or command window on your workstation.
Use the same sample application that was used in exercise 3a.
1. Click Start Coding and then click Download Starter Code.
2. After the starter package is downloaded, move it to a directory on your workstation where
you want to work, such as the Bluemix directory in your Documents folder.
3. Extract the package by double-clicking or right-clicking and click Extract or Unarchive.
Do not delete the .zip file: you will need it in Exercise 3c.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
6
4. Delete the deployed application so that you can deploy it from the command line. Click
the Overview page for the application, click the gear wheel in the application, and then
click Delete App.
5. Delete the service and the route with the application by selecting the checkbox in the
Services tab and the Routes tab:
6. Click OK to delete the application.
7. Open a command or terminal window and change the directory to the location where you
extracted the downloaded sample application. (The file package.json should be in your
current directory.)
8. Log in to Bluemix by issuing one of the following commands. Use the same region that
you used in the Bluemix web UI:
cf l -a https://api.ng.bluemix.net (Region: US South)
cf l -a https://api.eu-gb.bluemix.net (Region: United Kingdom)
cf l -a https://api.au-syd.bluemix.net (Region: Sydney)
9. Enter the email and password that you used to log in to the Bluemix web UI. If prompted,
select the organization and space that you want to work in.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
7
10.Before you deploy the application, deploy a Cloudant database. View the available
services by running this command:
cf marketplace
11.In the list of services, find the cloudantNoSQLDB service.
12.Create the service by running this command:
cf cs cloudantNoSQLDB Shared BICloudant
• CloudantNoSQLDB is the name of the service from the cf marketplace command.
• Shared is the name of the service plan that you want to use from the cf
marketplace command.
• BICloudant is the name of the service instance that you want to use. Enter your
own name rather than BICloudant. You will use this new name when connecting
(binding) the service to the application.
13.Refresh your web UI to you see the deployed service.
14.Deploy the application.
Push the application to Bluemix by entering the following command. Change the application
name to your unique name:
cf push BI-MyFirstDeploy-3 -c "node app.js" -m 128M --no-manifest --no-start
• BI-myFirstDeploy-3 is the application name and host name.
• -c specifies the command to start the application.
• -m specifies the amount of memory to allocate to each application instance. The
default is 1 GB.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
8
• --no-manifest instructs to CLI tool to ignore the supplied manifest, which will be
explained later.
• --no-start instructs to CLI tool not to automatically start the application.
Don’t want to allow the application to automatically start because it needs a database to run.
You must link the Cloudant database instance to the application before you start the
application.
15.Link the database and application by using the following command. Substitute the
application name and service instance names that you used previously:
cf bs BI-MyFirstDeploy-3 BICloudant
• BI-myFirstDeploy-3 is the application name used when the application is
deployed.
• BICloudant is the service instance name used when the service is deployed.
If you refresh the web UI, you see that the application and service are linked, but the
application is still stopped.
16.Start an application by running the following command. Substitute the name of your
application:
cf start BI-MyFirstDeploy-3
• BI-myFirstDeploy-3 is the application that you want to start.
If you refresh the web UI, you should see the application running. If not, you can start the
application from the Dashboard.
17.Launch the application by clicking on the route in the web UI
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
9
18.In a text editor, open the file app.js and modify the name of the file, the file description,
and the value (lines 306, 307 and 310):
• Line 306: Change the docName from 'sample_doc' to 'test_doc'
• Line 307: Change the docDesc from 'A sample Document' to 'A test Document'
• Line 310: Change the value from 'A sample Document' to 'A test Document'
Save the file when you’re finished editing.
When the application starts for the first time, it creates the sample document in the database.
We have just modified the code that creates the sample document in the database. The
document must be deleted from the database before you restart the application to allow the
database to be populated again.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
10
19.In the Bluemix web UI, select the Cloudant Service instance and then start the Cloudant
Dashboard.
20.Launch the Cloudant console.
You should see a single database. Select the database:
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
11
21.Edit the database document.
22.Delete the document.
23.Confirm the deletion when prompted.
24.Redeploy the updated application with the push command. This time, you don’t need to
include the --no-start or memory parameter.
cf push BI-MyFirstDeploy-3 -c "node app.js" --no-manifest
25.After the application has restarted, test it to ensure that your changes are now running.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
12
After the application is tested to confirm that the modified code is running, the application can be
deleted to release resources for the next exercise.
26.Delete the application and service and confirm the deletion when prompted by running
the following two commands:
Delete the application:
cf d BI-MyFirstDeploy-3 –r
• BI-myFirstDeploy-3 is the application name to be deleted.
• -r instructs Bluemix to also delete the routes attached to the application.
Delete the service:
cf ds BICloudant
• BICloudant is the name of the service instance to be deleted.
Confirm the deletion of the application and service.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
13
Exercise 3c: Working with Eclipse and Bluemix
This exercise shows you how to work with Eclipse and Bluemix.
1. Launch Eclipse and switch to the JavaScript perspective. You should use a new
workspace, but this is not essential.
2. Configure Eclipse to use Bluemix as a server by opening Eclipse Preferences and
clicking Server > Runtime Environments.
3. Click Add. Then, select IBM Bluemix Runtime and select the Create a new local
server checkbox.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
14
4. Click Next.
5. Select the appropriate URL to match the region that you have been using.
6. Enter your email and password, which are the credentials that you used to log into
Bluemix. Click Validate Account to ensure that all details are valid and then click Next.
7. Select the organization and space that you want to use and then click Finish. Click OK to
close the Preferences page.
If you want to work with multiple spaces in Eclipse, you must create multiple server
configurations.
8. Open the Servers view in Eclipse. If it’s not showing, click Window > Show View >
Servers.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
15
Use the same application that you used in the last session. You should have the archive file
that you downloaded in the last exercise on your workstation. If not, deploy the Node.js
Cloudant Web Starter application from the Bluemix web UI, click View Guide, and then
download the starter application.
9. Import the starter application package to Eclipse by clicking File > Import.
10.In the Import dialog, click General > Existing Projects into Workspace.
11.Click Next. Then, select the downloaded Zip file and click Finish.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
16
The project will be created.
Before JavaScript applications can be deployed to Bluemix by the plug-in, those applications
must be identified as a project suitable for Bluemix deployment by assigning a facet to the
project.
12.Right-click the project in the Project Explorer view and click Properties.
13.Click Project Facets > Convert to faceted form.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
17
14.When you see the facets, select the Node.js Application facet. Click OK to close the
dialog.
15.Delete the manifest.yml file by right-clicking it and clicking Delete.
16.Deploy the application. Right-click IBM Bluemix. If you have multiple definitions in the
Servers view, select the server definition for the space that you want to deploy the
application to.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
18
17.Click Add and Remove.
18.Select the cloudant_boilerplate_nodejs in the Available column and click Add to move
it to the Configured column.
19.Click Finish.
20.In the Deploy dialog, change the application name to something unique. Click Next.
Ensure that the URL contains a string that will be unique and then click Next.
21.On the Services selection window, click the Add a Service ( ) icon to add a service.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
19
22.When the list of available services is shown, select the CloudantNoSQLDB service.
23.Click Finish and Finish again to close the application Deploy dialog.
The application is now being deployed to Bluemix. Eclipse should automatically switch to the
Console view where you see details of the deployment.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
20
24.After the application is running, switch to the Server view and expand the Bluemix
server. You should see the application in the list. Start the application from Eclipse by
right-clicking the application in the Servers view and clicking Open Home Page.
Tip: In Eclipse, you can change the browser that’s used to start applications by clicking
Window > Web Browser and selecting your preferred browser.
25.Remove the sample document from the database to allow the application to create it
when the database launches. In the Bluemix web UI, select the Cloudant Service
instance and then launch the Cloudant Dashboard.
You should see a single database:
26.Select the database and then delete the document. Confirm the deletion.
27.In a text editor, open the file app.js:
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
21
28.Modify the name of the file, the file description and value (lines 306, 307, and 310) to
replace sample with test:
29.Save the changes by clicking File > Save.
Notice in the Server view that the state of the Bluemix server has changed to republish,
which means that an application has changed. However, the application has not yet been
published to Bluemix.
30.Select the cloudant_boilerplate_nodejs application in the Server view and right-click
and click Update and Restart.
31.After the application is restarted, test the application to ensure that the change is now
live.
After the project has been tested, the application can be deleted to release resources for
future exercises.
Exercise 3: First Deploy Getting Started with IBM Bluemix
Copyright IBM Corporation 2013-2015. All rights reserved.
22
32.Right-click the project in the Explorer view and click Delete to delete the project. Delete
project contents on disk and then click OK.
You are asked whether you want to delete the cloudantNoSQLDB service. Select the
checkbox to delete the service. In the Bluemix web UI, confirm that the application and
server have been deleted.
Important: Deleting a project that is deployed through Eclipse also deletes it from Bluemix.
Getting Started with IBM Bluemix
Hands-On Workshop
Module 4: Bluemix DevOps Services
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
2
Table of Contents
Bluemix Hands-On Workshop.....................................................Error! Bookmark not defined.	
  
Section 4- DevOps Services ....................................... Error! Bookmark not defined.	
  
Exercise 4.a - Bluemix integration with DevOps Services ...............................................................3	
  
Exercise 4.b – working in DevOps Services....................................................................................5	
  
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
3
Exercise 4.a - Bluemix integration with DevOps Services
This exercise looks at how Bluemix and DevOps Services work together
Log into Bluemix http://bluemix.net, https://console.eu-gb.bluemix.net or
https://console/au-syd.bluemix.net and deploy the Node.js Cloudant DB Web Starter
boilerplate from the Catalog.
Once the application is running, select the Overview page then select ‘ADD GIT’ on the
Application Overview page
if prompted, add your DevOps Service details and select ‘Sign In’. Ensure you leave the
option to populate the repository selected then select ‘CONTINUE’
In the overview page you will now see the option to ‘EDIT CODE’
select ‘EDIT CODE’ – you should be taken into DevOps Services with the sample
application code imported and ready to work with.
Select ‘BUILD & DEPLOY’. The project has automatically been set up to deploy code
changes to Bluemix when they are pushed to the Git repository.
You can now modify the code and deploy to Bluemix from DevOps Services. To test this,
select the 'run stage'icon in the Build Stage section of the pipeline. You will see the
Build 'Queued', then 'Running' and finally 'Succeeded'. Once the build has complete a
deploy operation should be queued, then run. You should see the deployment running
then Success – to launch the application you can click on the route:
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
4
You can view logs and history for the build and deploy by clicking the links in the Build and
Deploy stages.
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
5
Exercise 4.b – working in DevOps Services
In DevOps Services switch to the ‘EDIT CODE’ section so we can edit the code.
Open the views/index.html file and scroll to line 16 to find the string that are displayed on
the welcome page of the app :
Change the line from 'Get Started' to 'Start now'
save the changes by selecting 'File' from the menu, then 'Save'
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
6
To get the changes pushed to Bluemix we need to commit the changes to the Git
repository.
To work with the Git repository switch into the Git section
The files that have local changes are shown in the Changed Files section (Note, when a
project is first added to DevOps Services some configuration files are updated
automatically - the first 2 files in the list)
Select the html file you just modified, add a commit message and then press ‘COMMIT’
The commit was made to the local branch – the builder works from the remote branch, so
we need to push out changes back to the remote. In the left hand column, expand the
‘PUSH’ dropdown and select ‘Push All’
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
7
If you quickly jump to the BUILD & DEPLOY screen you will see a build has automatically
been started, which will then be automatically deployed to Bluemix if successful.
Once the deploy has completed test the application to verify the code changes are now
running. You can launch the application by clicking on the link in the deploy stage:
Exercise 4: DevOps Services Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
8
Note: if a build fails you can click on the build in the builder and it will take you to a detailed
screen of build history, where you can get access to the logs, files and details of changes
included in the builds. This can help determine why the build failed.
Getting Started with IBM Bluemix
Hands-On Workshop
Module 5: Maximizing the Value of Bluemix
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
2
Table of Contents
Workshop overview..................................................................................................................................... 3	
  
Exercise 5a: Creating the project source code repository .......................................................................... 4	
  
Exercise 5b: Setting up development tooling............................................................................................ 16	
  
Exercise 5c: Test-driven development...................................................................................................... 23	
  
Implement the divisibleBy function .................................................................................................... 23	
  
Implement the convertToFizzBuzz function....................................................................................... 28	
  
Implement convertRangeToFizzBuzz (introduces Sinon.JS) ............................................................ 31	
  
Exercise 5d: Adding the REST API and deploying to Bluemix ................................................................. 34	
  
Configure a DevOps pipeline to automatically test and deploy code................................................. 37	
  
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
3
Workshop overview
This workshop will demonstrate an approach for developing applications by using principles
from agile development and using DevOps processes and tooling.
You’ll develop a REST API that will calculate the FizzBuzz result for a given range.
FizzBuzz is a children's numeracy game where any number divisible by 3 is replaced by the
word Fizz, any number divisible by 5 is replaced with the word Buzz, and any number divisible
by both 3 and 5 is replaced with the word FizzBuzz.
For example, for the range 1 .. 20, the response is:
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14,
FizzBuzz, 16, 17, Fizz, 19, Buzz
You will use Node.js as the runtime and use test-driven development practices to create the
solution.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
4
Exercise 5a: Creating the project source code repository
Before you write any code, you must have the correct tooling and a source code repository. For
this exercise, you’ll use the Git service from IBM DevOps Services for Bluemix.
1. Log in to DevOps Services for Bluemix: http://hub.jazz.net.
2. From your MyProjects page, click CREATE PROJECT.
3. Create a Git repository on Bluemix:
a. Enter a project name.
b. Create a new repository.
c. Create a Git repo on Bluemix.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
5
4. Select to initialize the repository
5.
If you want to share your project and make it searchable to the public, do not select the
Private Project checkbox.
6. If you want to use the Track and Plan tool to support agile methodology, add features for
Scrum development.
7. Select the checkbox to make the project a Bluemix project. Then, provide the details of
the Bluemix space that the application will be deployed to.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
6
8. Click CREATE to create the project.
The code repository has been created, and you can create a new Eclipse project that is
based on the repository.
9. In DevOps Services console, select the Git URL link and copy the URL. Use Ctrl+C or
Cmd C.
10.Start Eclipse and then from the main menu, click File > Import.
11.From the Select dialog, click Git > Project from Git and then click Next.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
7
12.In the Git dialog, select Clone URI and then click Next.
13.In the next dialog, paste the Git repository URL into the URI Location field. This will
automatically populate the Host and Repository path.
14.Enter your DevOps services user name and password. Optionally, select to store the Git
credentials in a secure store in Eclipse. You will need to provide additional information to
initialize the secure store if this is the first time that you store credentials.
15.Click Next.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
8
Eclipse will query the Git repository and list the next branch that’s available. Because you
just created the repository, only the master branch exists.
16.Leave the master branch selected and click Next.
The local destination is then chosen. The default location is <user home
directory>/git/<project name>. Use suggested default location. If you want to
change it, you must remember the location because you will need it later in the exercise.
17.Click Next.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
9
18.Select the wizard to import as a general project and then click Next.
19.In the Import Projects dialog, enter an Eclipse project name. Use the same name as the
DevOps service project name, but you can change if needed.
20.Click Finish.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
10
You now have an Eclipse project linked to your DevOps services Git repository. To
complete the project setup, configure Eclipse to support JavaScript development.
21.Switch Eclipse to the JavaScript perspective:
a. Click Add Perspective at the top right of the Eclipse window.
b. Select JavaScript from the list.
22.Enable the NodeJS facet on the project:
a. Right-click the project name and click Properties.
b. In the Project Facet dialog, click Project Facets and then click Convert to
faceted form.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
11
c. When you see the list of facets, click Node.js Application. Click OK.
Adding the facet automatically creates a sample application in the project.
d. Remove the app.js and package.json files. Right-click each file, click Delete,
and confirm the deletion.
The project shows that there are changes to the local copy of the project. These are the
Eclipse project setting files. Don't save these as part of the source code.
23.Add a navigator view to see all the files in the project:
a. Click Window > Show View and then click Navigator.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
12
b. Right-click the project name in the Navigator view and click New > File.
c. Name the file .gitignore and then click Finish.
d. Add the following two lines to the .gitignore file:
Windows: Leave the slash as specified; do not change it to .settings:
.project
.settings/
The project still shows that there are changes. This occurs because the .gitignore file
is a new file that is not committed and pushed to the master branch on the Git server.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
13
24.Commit and push the .gitignore file:
a. Right-click the project name and click Team > Commit.
b. In the Commit Changes dialog, enter a commit message and select the
.gitignore file. Then, click Commit and Push.
c. Close the confirmation dialog by clicking OK.
The project will no longer show that there are outstanding changes.
Finally, you should add a new window to access the command line. However, this is not
necessary. Instead, you can use a command window outside Eclipse, but it’s more
convenient to have everything in Eclipse because it provides a better working
environment.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
14
25.Create a terminals view:
a. From the main menu, click Window > Show View and then click Other.
b. In the dialog, click Terminals > Terminals and then click OK.
c. In the Terminals window, drag the tab to split the bottom section of the screen to
allow concurrent viewing of the terminal and the problem views.
If a command prompt isn’t shown, click the Open Terminal icon to start a new
terminal. Use the default setting. On some platforms, this happens automatically.
Drag and release
when window
outlines show 2
windows
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
15
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
16
Exercise 5b: Setting up development tooling
Using appropriate developer tooling with features to automatically check for errors, provide code
assist, and so on can make you more productive and help identify possible problems.
You’ll use the new project that you created in the previous section.
The first step is to ensure the JavaScript tooling is enabled and the test framework is created.
1. Create the JavaScript project:
a. In the Terminals view, change to the directory that contains the project:
• Mac & Linux default: cd <user home>/git/<project name>
• Windows default: cd <user home>git<project name>
If you want to verify where your project is located, right-click the project name in the
Project Explorer view and then click Properties.
Note the project location on the Resources tab:
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
17
b. In the Terminals window, run the npm init command and answer the prompts:
• Name - provide a unique name for your project
• Version - 0.0.0
• Description - REST API to calculate FizzBuzz value for a given range
• Entry point - server.js
• Test command - node_modules/.bin/mocha
• Git repository - hit enter to accept the default value
• Keywords - can leave blank
• Author - enter your name
• License - hit enter to accept the default value
Windows: Use the forward slash (/) when specifying the test command.
If the Terminals window is too small, double-click the tab to enlarge it to a full screen.
Double-clicking again will return it to its original size and location.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
18
c. To move the created files into Eclipse, right-click the project name in the Project
Explorer view and click Refresh or press F5.
d. If the wizard truncated the test script to mocha, open the package.json file in the
Eclipse editor and change it back to node_modules/.bin/mocha.
e. Tests are expected to be in a directory named test, so create a test directory:
i. Right-click the project name in the Project Explorer view and click New > Folder.
ii. Name the folder test and then click Finish.
f. To be able to run tests, install the Mocha framework:
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
19
i. In the Terminals view, enter npm install mocha --save-dev
ii. Select the project name in the Project Explorer and click Refresh the project in
Eclipse to display the new files.
g. Test that everything works as expected by running a test:
i. In the Terminals view, enter npm test
Note that the test framework ran even though there are no tests defined.
JSHint is a lint program for JavaScript. It provides static analysis of code. It’s a good
practice to have this running in your tooling. Many development teams also include it as
part of their automated test suite.
h. Run JSHint from Mocha:
i. In the Terminals view, enter the following command:
npm install mocha-jshint --save-dev
ii. Select the test directory of the project in the Project Explorer view and then right-
click and click New > File. Name the file jshint.test.js.
iii. In the file, enter the following content and then save the file by clicking File >
Save or use these commands:
Windows and Linux: Ctrl+S
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
20
Mac: Cmd+S:
require('mocha-jshint')();
iv. Rerun the tests by entering the following command in the Terminals view:
npm test
There are many errors from the imported modules in the node_modules directory. You
do not control this is code, so it should be excluded from tests.
i. Configure JSHint to ignore the files by using a .jshintignore file:
i. Create a .jshintignore file by right-clicking the project name in the Project
Explorer view and clicking New > File.
ii. Add the following content to the file:
node_modules
test
iii. In the Terminals view, rerun the tests: npm test
JSHint is now enabled in the test suite, but ideally the code editor should provide
feedback from the problems.
JSHint is included in Eclipse, but you must configure it.
j. Enable JSHint in Eclipse:
i. Right-click the project name in the Project Explorer view and click Properties.
ii. In the dialog, click JSHint.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
21
iii. Click Add next to the Enable JSHint for these files and folders box.
iv. Accept the defaults as shown above and click OK.
v. Click Add next to the But exclude these files and folders from validation box.
vi. Click All files and then select in folder and add the node_modules folder. Select
the include all subfolders checkbox.
vii. Repeat the previous step to exclude the content of the test folder.
viii. Click OK to make the changes and close the dialog.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
22
The project is now ready to implement the REST API, so now is a good time to commit
changes to the Git repository (repo).
There is some debate about whether dependencies should be checked in or re-fetched at
build time. To reduce the amount of traffic that you need to push to the Git repo for this
exercise, you will exclude the dependencies in node_modules.
k. Update the Git configuration and then commit and push changes to the Git repo:
I. Switch to the Navigator view to see files that start with a period ( . )
II. Double-click the .gitignore file to edit it and add the node_modules directory
to the file. Then, save the file: Ctrl+S or Cmd+S.
III. Right-click the project name and click Team > Commit. Click the link at the bottom
right of the dialog to open the Git Staging view.
IV. Drag the 4 files from the Unstaged Changes window to the Staged Changes
window. Then, enter a commit message.
V. Click Commit and Push.
VI. Verify that the commit completed successfully and then close the confirmation
dialog.
Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix
Copyright IBM Corporation 2015. All rights reserved.
23
Exercise 5c: Test-driven development
Implement the divisibleBy function
To implement the divisibleBy funtion, you generate the first test that the implementation must
pass. Solving the problem requires a function to discover whether one number is divisible by
another number, so the first test will check whether 3 is divisible by 3.
Before you write the test, you’ll add another test framework: Chai. Chai is a behavior-driven
development (BDD) and test-driven development (TDD) assertion library for Node.js and a
browser that can be paired with any JavaScript testing framework. Chai provides the test
capability to say "I expect this to be true" or "this should be true."
Before you write a test, install Chai and then configure Mocha to use Chai:
1. Install and configure Chai:
a. In the Terminals view, enter the following command:
npm install chai --save-dev
b. Select the project name in Project Explorer and press F5 to refresh the Eclipse
project content.
c. Create a new file in the test folder named support.js and add the following
content:
var chai = require("chai");
global.expect = chai.expect;
d. Create a new file in the test folder named mocha.opts and add the following
content:
--require test/support
e. Save both files.
The files configure Mocha to use the expect functionality from Chai.
2. Create the first test:
a. Create a new file in the test folder named fizzbuzz.test.js by right-clicking
the test folder in the Project Explorer view and then click New > File.
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3
IBM Bluemix Workshop version 3

Weitere ähnliche Inhalte

Was ist angesagt?

Bluemix overview v1.4
Bluemix overview v1.4Bluemix overview v1.4
Bluemix overview v1.4Jose Pena
 
IBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub EnterpriseIBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub EnterpriseIBM DevOps
 
IBM Bluemix Garage in London
IBM Bluemix Garage in LondonIBM Bluemix Garage in London
IBM Bluemix Garage in LondonSonia Cyrus
 
IBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix MarketplaceIBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix MarketplaceSimon Baker
 
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...Romeo Kienzler
 
Bluemix Technical Overview
Bluemix Technical OverviewBluemix Technical Overview
Bluemix Technical Overviewrogerp67
 
IBM Bluemix cloudfoundry platform
IBM Bluemix cloudfoundry platformIBM Bluemix cloudfoundry platform
IBM Bluemix cloudfoundry platformDaniela Zuppini
 
IBM SmartCloud and ISVs September 2013 (Softlayer)
IBM SmartCloud and ISVs September 2013 (Softlayer)IBM SmartCloud and ISVs September 2013 (Softlayer)
IBM SmartCloud and ISVs September 2013 (Softlayer)Simon Baker
 
Introduction to IBM Bluemix for Java Developers
Introduction to IBM Bluemix for Java DevelopersIntroduction to IBM Bluemix for Java Developers
Introduction to IBM Bluemix for Java DevelopersNiklas Heidloff
 
Cloud adoption patterns
Cloud adoption patternsCloud adoption patterns
Cloud adoption patternsKyle Brown
 
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...Michael Elder
 
Deploy apps on ibm bluemix docker day vietnam 2015
Deploy apps on ibm bluemix   docker day vietnam 2015Deploy apps on ibm bluemix   docker day vietnam 2015
Deploy apps on ibm bluemix docker day vietnam 2015hai260288
 
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...Michael Elder
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to MicroservicesKyle Brown
 
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM CloudDevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM CloudMichael Elder
 
How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?Michael Elder
 

Was ist angesagt? (20)

Bluemix overview v1.4
Bluemix overview v1.4Bluemix overview v1.4
Bluemix overview v1.4
 
IBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub EnterpriseIBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub Enterprise
 
IBM Bluemix Overview
IBM Bluemix OverviewIBM Bluemix Overview
IBM Bluemix Overview
 
IBM Bluemix Garage in London
IBM Bluemix Garage in LondonIBM Bluemix Garage in London
IBM Bluemix Garage in London
 
IBM Bluemix
IBM BluemixIBM Bluemix
IBM Bluemix
 
IBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix MarketplaceIBM Softlayer Bluemix Marketplace
IBM Softlayer Bluemix Marketplace
 
IBM Containers- Bluemix
IBM Containers- BluemixIBM Containers- Bluemix
IBM Containers- Bluemix
 
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...
IBM Codename: Bluemix - Cloudfoundry, PaaS development and deployment trainin...
 
Bluemix Technical Overview
Bluemix Technical OverviewBluemix Technical Overview
Bluemix Technical Overview
 
IBM Bluemix cloudfoundry platform
IBM Bluemix cloudfoundry platformIBM Bluemix cloudfoundry platform
IBM Bluemix cloudfoundry platform
 
IBM SmartCloud and ISVs September 2013 (Softlayer)
IBM SmartCloud and ISVs September 2013 (Softlayer)IBM SmartCloud and ISVs September 2013 (Softlayer)
IBM SmartCloud and ISVs September 2013 (Softlayer)
 
Introduction to IBM Bluemix for Java Developers
Introduction to IBM Bluemix for Java DevelopersIntroduction to IBM Bluemix for Java Developers
Introduction to IBM Bluemix for Java Developers
 
Cloud adoption patterns
Cloud adoption patternsCloud adoption patterns
Cloud adoption patterns
 
Bluemix Overview
Bluemix OverviewBluemix Overview
Bluemix Overview
 
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
Hybrid Cloud: How to Get a Return from an Investment Made Three Decades Ago (...
 
Deploy apps on ibm bluemix docker day vietnam 2015
Deploy apps on ibm bluemix   docker day vietnam 2015Deploy apps on ibm bluemix   docker day vietnam 2015
Deploy apps on ibm bluemix docker day vietnam 2015
 
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
Continuous Delivery on IBM Bluemix: Manage Cloud Native Services with Cloud N...
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
 
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM CloudDevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
DevOps within the Hybrid Cloud Deploying to the VMware Platform on the IBM Cloud
 
How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?
 

Andere mochten auch

IBM Bluemix Infrastructure (SoftLayer) introduction
IBM Bluemix Infrastructure (SoftLayer) introductionIBM Bluemix Infrastructure (SoftLayer) introduction
IBM Bluemix Infrastructure (SoftLayer) introductionYuichi Tamagawa
 
Design - Exploring Hybrid Cloud Infrastructure Choices
Design - Exploring Hybrid Cloud Infrastructure ChoicesDesign - Exploring Hybrid Cloud Infrastructure Choices
Design - Exploring Hybrid Cloud Infrastructure ChoicesLaurenWendler
 
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePH
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePHIBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePH
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePHDEVCON
 
Ibm bluemix handson the weather company api
Ibm bluemix handson the weather company apiIbm bluemix handson the weather company api
Ibm bluemix handson the weather company apiMasaya Fujita
 
Achieving Scalability and speed with IBM Solutions - IaaS Softlayer
Achieving Scalability and speed with IBM Solutions -  IaaS SoftlayerAchieving Scalability and speed with IBM Solutions -  IaaS Softlayer
Achieving Scalability and speed with IBM Solutions - IaaS SoftlayerAna Alves Sequeira
 
Netflix Case Study - AWS
Netflix Case Study - AWSNetflix Case Study - AWS
Netflix Case Study - AWSHeath Dorn
 
Rakuten and Microsoft talk DevOps in Real World
Rakuten and Microsoft talk DevOps in Real WorldRakuten and Microsoft talk DevOps in Real World
Rakuten and Microsoft talk DevOps in Real WorldTsuyoshi Ushio
 
Cloud IBM IaaS - SoftLayer e PaaS - BlueMix
Cloud IBM IaaS - SoftLayer e PaaS - BlueMixCloud IBM IaaS - SoftLayer e PaaS - BlueMix
Cloud IBM IaaS - SoftLayer e PaaS - BlueMixThiago Viola
 
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...DevDay Dresden
 
Cloudfoundry / Bluemix tutorials, compressed in 4 Hours
Cloudfoundry / Bluemix tutorials, compressed in 4 HoursCloudfoundry / Bluemix tutorials, compressed in 4 Hours
Cloudfoundry / Bluemix tutorials, compressed in 4 HoursRomeo Kienzler
 
Transforming Software Development
Transforming Software Development Transforming Software Development
Transforming Software Development Amazon Web Services
 
SoftLayer Cloud Services
SoftLayer Cloud ServicesSoftLayer Cloud Services
SoftLayer Cloud ServicesAnna Landolfi
 
It transformation - DevOps Day - 02/02/2017
It transformation - DevOps Day - 02/02/2017It transformation - DevOps Day - 02/02/2017
It transformation - DevOps Day - 02/02/2017Clara Feuillet
 
IBM Design Thinking & the Bluemix Garage Method
IBM Design Thinking & the Bluemix Garage Method IBM Design Thinking & the Bluemix Garage Method
IBM Design Thinking & the Bluemix Garage Method Dev_Events
 
设计思维、敏捷、Dev ops —— 助力创新交付
设计思维、敏捷、Dev ops —— 助力创新交付设计思维、敏捷、Dev ops —— 助力创新交付
设计思维、敏捷、Dev ops —— 助力创新交付Yi Xu
 

Andere mochten auch (17)

IBM Bluemix Infrastructure (SoftLayer) introduction
IBM Bluemix Infrastructure (SoftLayer) introductionIBM Bluemix Infrastructure (SoftLayer) introduction
IBM Bluemix Infrastructure (SoftLayer) introduction
 
Bluemix101 hackaton meetup
Bluemix101 hackaton meetupBluemix101 hackaton meetup
Bluemix101 hackaton meetup
 
Design - Exploring Hybrid Cloud Infrastructure Choices
Design - Exploring Hybrid Cloud Infrastructure ChoicesDesign - Exploring Hybrid Cloud Infrastructure Choices
Design - Exploring Hybrid Cloud Infrastructure Choices
 
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePH
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePHIBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePH
IBM Bluemix by Alexis Patola | DevCon Summit 2015 #GoOpenSourcePH
 
Ibm bluemix handson the weather company api
Ibm bluemix handson the weather company apiIbm bluemix handson the weather company api
Ibm bluemix handson the weather company api
 
Achieving Scalability and speed with IBM Solutions - IaaS Softlayer
Achieving Scalability and speed with IBM Solutions -  IaaS SoftlayerAchieving Scalability and speed with IBM Solutions -  IaaS Softlayer
Achieving Scalability and speed with IBM Solutions - IaaS Softlayer
 
Netflix Case Study - AWS
Netflix Case Study - AWSNetflix Case Study - AWS
Netflix Case Study - AWS
 
Rakuten and Microsoft talk DevOps in Real World
Rakuten and Microsoft talk DevOps in Real WorldRakuten and Microsoft talk DevOps in Real World
Rakuten and Microsoft talk DevOps in Real World
 
Cloud IBM IaaS - SoftLayer e PaaS - BlueMix
Cloud IBM IaaS - SoftLayer e PaaS - BlueMixCloud IBM IaaS - SoftLayer e PaaS - BlueMix
Cloud IBM IaaS - SoftLayer e PaaS - BlueMix
 
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...
DevDay 2016: Artur Speth - DevOps - Microsoft Developer Divisions Weg ins näc...
 
Cloudfoundry / Bluemix tutorials, compressed in 4 Hours
Cloudfoundry / Bluemix tutorials, compressed in 4 HoursCloudfoundry / Bluemix tutorials, compressed in 4 Hours
Cloudfoundry / Bluemix tutorials, compressed in 4 Hours
 
Transforming Software Development
Transforming Software Development Transforming Software Development
Transforming Software Development
 
Cloud IBM 2017
Cloud IBM 2017Cloud IBM 2017
Cloud IBM 2017
 
SoftLayer Cloud Services
SoftLayer Cloud ServicesSoftLayer Cloud Services
SoftLayer Cloud Services
 
It transformation - DevOps Day - 02/02/2017
It transformation - DevOps Day - 02/02/2017It transformation - DevOps Day - 02/02/2017
It transformation - DevOps Day - 02/02/2017
 
IBM Design Thinking & the Bluemix Garage Method
IBM Design Thinking & the Bluemix Garage Method IBM Design Thinking & the Bluemix Garage Method
IBM Design Thinking & the Bluemix Garage Method
 
设计思维、敏捷、Dev ops —— 助力创新交付
设计思维、敏捷、Dev ops —— 助力创新交付设计思维、敏捷、Dev ops —— 助力创新交付
设计思维、敏捷、Dev ops —— 助力创新交付
 

Ähnlich wie IBM Bluemix Workshop version 3

Paris Meetup Bluemix du 15/10/2104
Paris Meetup Bluemix du 15/10/2104Paris Meetup Bluemix du 15/10/2104
Paris Meetup Bluemix du 15/10/2104IBM France Lab
 
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...GeneXus
 
Bluemix Overview
Bluemix OverviewBluemix Overview
Bluemix OverviewAGILLY
 
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...Yves LE CLEACH
 
DockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM BluemixDockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM BluemixDocker-Hanoi
 
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014IBM France Lab
 
IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)Sanjay Nayak
 
Bluemix Overview & Demo
Bluemix Overview & DemoBluemix Overview & Demo
Bluemix Overview & DemoIBM
 
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficace
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficaceApplicazioni per mobile e cloud sviluppate in maniera rapida ed efficace
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficaceJürgen Ambrosi
 
Bluemix digital innovation_platform
Bluemix digital innovation_platformBluemix digital innovation_platform
Bluemix digital innovation_platformNitin Gaur
 
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...GRUC
 
IBM Bluemix Presentation.pptx
IBM Bluemix Presentation.pptxIBM Bluemix Presentation.pptx
IBM Bluemix Presentation.pptxvishal choudhary
 
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloudWhat is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloudPatrick Bouillaud
 
Bluemix overview - UK WebSphere Integration User Group
Bluemix overview - UK WebSphere Integration User GroupBluemix overview - UK WebSphere Integration User Group
Bluemix overview - UK WebSphere Integration User GroupJon Marshall
 
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...IBM France Lab
 

Ähnlich wie IBM Bluemix Workshop version 3 (20)

Paris Meetup Bluemix du 15/10/2104
Paris Meetup Bluemix du 15/10/2104Paris Meetup Bluemix du 15/10/2104
Paris Meetup Bluemix du 15/10/2104
 
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
 
Bluemix Overview
Bluemix OverviewBluemix Overview
Bluemix Overview
 
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
 
DockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM BluemixDockerDay2015: Deploy Apps on IBM Bluemix
DockerDay2015: Deploy Apps on IBM Bluemix
 
Bluemix summary
Bluemix summaryBluemix summary
Bluemix summary
 
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014
IBM BlueMix Presentation - Paris Meetup 17th Sept. 2014
 
IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)
 
Bluemix Overview & Demo
Bluemix Overview & DemoBluemix Overview & Demo
Bluemix Overview & Demo
 
IBM Bluemix
IBM Bluemix IBM Bluemix
IBM Bluemix
 
Akhil518
Akhil518Akhil518
Akhil518
 
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficace
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficaceApplicazioni per mobile e cloud sviluppate in maniera rapida ed efficace
Applicazioni per mobile e cloud sviluppate in maniera rapida ed efficace
 
Bluemix digital innovation_platform
Bluemix digital innovation_platformBluemix digital innovation_platform
Bluemix digital innovation_platform
 
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
Webcast Presentation: Be lean. Be agile. Work together with DevOps Services (...
 
IBM Bluemix Presentation.pptx
IBM Bluemix Presentation.pptxIBM Bluemix Presentation.pptx
IBM Bluemix Presentation.pptx
 
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloudWhat is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
 
Ibm bluemix paris_techtalks 2015
Ibm bluemix paris_techtalks 2015Ibm bluemix paris_techtalks 2015
Ibm bluemix paris_techtalks 2015
 
Bluemix overview - UK WebSphere Integration User Group
Bluemix overview - UK WebSphere Integration User GroupBluemix overview - UK WebSphere Integration User Group
Bluemix overview - UK WebSphere Integration User Group
 
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...
Bluemix Paris Meetup - Session #8 - 20th may 2015 - Passer au cloud hybride a...
 
MWLUG Bluemix
MWLUG BluemixMWLUG Bluemix
MWLUG Bluemix
 

Kürzlich hochgeladen

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Kürzlich hochgeladen (20)

How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

IBM Bluemix Workshop version 3

  • 1. IBM Bluemix – Hands On Workshop
  • 2. 10.1 IBM Bluemix Hands On Workshop Nguyen Tai Dzung (Dũng) Cloud Solution Architect + Bluemix Evangelist IBM Clouds and Ecosystem Development Email: dzungnt@vn.ibm.com ntaidung@gmail.com Please register: https://bluemix.net https://hub.jazz.net
  • 3. IBM Bluemix – Hands On Workshop Contents 1. Module 1 – IBM Bluemix Overview 2. Module 2 – Tour of IBM Bluemix 3. Module 3 – First Deploy  Exercise – First Deploy Exercises (Bluemix UI, CF CLI and Eclipse) 4. Module 4 – DevOps Services  Exercise – Bluemix integration with DevOps Services 5. Module 5 – Create your application  Exercise – Your first Node.js application 6. Module 6 – Services  Exercise – Adding a service to an application 7. Module 7 – How it works  Exercise – Specifying a buildpack when deploying an application 8. Module 8: Containers
  • 4. IBM Bluemix – Hands On Workshop Contents 9. MobileFirst on Bluemix 10. Big Data on Bluemix 11. Internet of Things (IoT)
  • 5. IBM Bluemix – Hands On Workshop Course overview Welcome to Getting Started with IBM Bluemix 5 © Copyright IBM Corporation 2015
  • 6. IBM Bluemix – Hands On Workshop Prerequisite skills and software •To complete this course successfully, you should understand:  Basics of application development  How to use the command line to do basic programming tasks •You’ll need the following software and accounts:  IBM Bluemix registration: A 30-day trial is available  Eclipse: We’ll show you how to do that  Cloud Foundry Command Line Interface  Node.js runtime  An IBM Bluemix account  An IBM Bluemix DevOps Services account 6 © Copyright IBM Corporation 2015
  • 7. IBM Bluemix – Hands On Workshop Course learning objectives • Understand the basics of the IBM Bluemix platform • Understand the basics of cloud computing and how to maximize the value of cloud development • Learn how to integrate Bluemix into your own development process • Learn the importance of designing an application to run on a cloud platform, such as IBM Bluemix • Understand the different runtime options for deploying an application 7 © Copyright IBM Corporation 2015
  • 8. IBM Bluemix – Hands On Workshop Module 1: IBM Bluemix overview Basics of the IBM cloud platform as a service © Copyright IBM Corporation 20158
  • 9. IBM Bluemix – Hands On Workshop IBM® Bluemix™: IBM’s cloud platform 9 © Copyright IBM Corporation 2015 Bluemix service categories Developer experience •Rapidly deploy and scale applications in any language. •Compose applications quickly with useful APIs and services and avoid tedious backend configuration. •Realize fast time-to-value with simplicity, flexibility, and clear documentation. Enterprise capability •Securely integrate with existing on-premises data and systems. •Choose from flexible deployment models. •Manage the full application lifecycle with DevOps. •Develop and deploy on a platform built on a foundation of open technology. Built on a foundation of open technology Build, run, scale, manage, integrate, and secure applications in the cloud. •DevOps •Big data •Mobile •Watson •Business analytics •Database •Web and application •Security •Internet of Things •Cloud integration •API management and integration
  • 10. IBM Bluemix – Hands On Workshop So what is Bluemix? 10 Bluemix is an open-standards, cloud-based platform for building, running, and managing applications. Build your apps, your way Use the most prominent compute technologies to power your app: Cloud Foundry, Docker, OpenStack. Extend apps with services A catalog of IBM, third party, and open source services allow the developer to stitch an application together quickly. Scale more than just instances Development, monitoring, deployment, and logging tools allow the developer to run and manage the entire application. Layered Security IBM secures the platform and infrastructure and provides you with the tools to secure your apps. Deploy and manage hybrid apps seamlessly Get a seamless dev and management experience across a number of hybrid implementations options. Flexible Pricing Try compute options and services for free and, when you’re ready, pay only for what you use. Pay as you go and subscription models offer choice and flexibility. Coming Summer 2015
  • 11. IBM Bluemix – Hands On Workshop Addressing many types of use cases •Extend existing applications - Add user experience such as mobile, social - Add new capabilities integrating other services and APIs - Do rapid experimentation for new capabilities •API-enable applications - Scalable API layer on top of existing services - Simplify how composite service capabilities are exposed through APIs •New applications - Systems of Engagement - Different state management models - Twelve-factor applications Backend Systems and Integration API Creation and Management New Channels and Opportunities © Copyright IBM Corporation 201511
  • 12. IBM Bluemix – Hands On Workshop Bluemix structure © Copyright IBM Corporation 201512
  • 13. IBM Bluemix – Hands On Workshop How does Bluemix work? Bluemix is underlined by three key open compute technologies: Cloud Foundry, Docker, and OpenStack. It extends each of these with a growing number of services, robust DevOps tooling, integration capabilities, and a seamless developer experience. 13 Flexible Compute Options to Run Apps / Services Instant Runtimes Containers Virtual Machines Platform Deployment Options that Meet Your Workload Requirements Bluemix Public Bluemix Dedicated Bluemix Local* DevOps Tooling Your Own Hosted Apps / Services Integration and API Mgmt Powered by IBM SoftLayer In Your Data Center + + + + + + Always focused on what’s next Catalog of Services that Extend Apps’ Functionality Web Data Mobile AnalyticsCognitive IoT Security Yours + *Bluemix Local coming Summer
  • 14. IBM Bluemix – Hands On Workshop More openness and choice than ever before 14 Bluemix is anything but locked down. You choose how you build, deploy, and manage your apps. Bluemix takes care of the rest. Compute Choose the level of infrastructure abstraction based on your app’s architectural needs. Dev Tooling From editors to source code management to continuous delivery, you can use Bluemix’ powerful tooling or easily bring your own. Location Deploy apps to Bluemix Public (in a growing number of geos), your own dedicated cloud Bluemix, or one that runs within your data center (Local*). Services Pick from a catalog of IBM, third party, open source, or your own services to extend your apps. IBM Third Party Open Source Yours *Bluemix Local coming Summer 2
  • 15. IBM Bluemix – Hands On Workshop Bluemix offers different compute models to “run your code” © Copyright IBM Corporation 2015 Cloud Foundry application Docker container Virtual machine Consistent experience: • Common service binding and consumption model • Common user ID and permissions model • Ability to hook into common routing layer expanding Level of abstraction Flexibility 15 Reference: Bluemix Instant Runtimes, Containers or Virtual Machines?
  • 16. IBM Bluemix – Hands On Workshop A PaaS helps developers focus on what’s most important to them: The application • Bluemix eliminates and dramatically simplifies various tasks: • OS patching • OS security hardening • Deployment • Load-balancing • Scaling • Health management 16 © Copyright IBM Corporation 2015 Networking Storage Servers Virtualization O/S Middleware Runtime Data Applications Traditional On-Premises Networking Storage Servers Virtualization O/S Middleware Runtime Data Applications Platform as a Service Networking Storage Servers Virtualization O/S Middleware Runtime Data Applications Software as a Service Networking Storage Servers Virtualization Middleware Runtime Data Applications Infrastructure as a Service O/S Vendor Manages in CloudClient Manages Standardization; OPEX savings; faster time to value Customization; higher costs; slower time to value
  • 17. IBM Bluemix – Hands On Workshop Bluemix: foundational concepts Account – Anchor point for billing UserUserUser Organizations •Enables team collaboration Organizations •Enables team collaboration Organizations – enables team collaboration Spaces • Logical grouping of apps and service instances • per-user permissions Spaces • Logical grouping of apps and service instances • per-user permissions Spaces • Logical grouping of apps and service instances • Per-user permissions Space Apps Space VMs Space Containers SpaceService instances 17 © Copyright IBM Corporation 2015
  • 18. IBM Bluemix – Hands On Workshop So what’s a Region ? us-south https://console.ng.bluemix. net https://api.ng.bluemix.net eu-gb https://console.eu- gb.bluemix.net https://api.eu-gb.bluemix.net - Dedicated cloud Foundry Installation & services - Maximum isolation from entities in other regions 18 Hands on Workshop - © Copyright IBM Corporation 2015 au-syd https://console.au- syd.bluemix.net https://api.au- syd.bluemix.net
  • 19. IBM Bluemix – Hands On Workshop Building increasingly flexible deployment models Public Dedicated On-premises © Copyright IBM Corporation 201519
  • 20. IBM Bluemix – Hands On Workshop Module 2: The Bluemix tour Demo of the Bluemix interface 20 © Copyright IBM Corporation 2015
  • 21. IBM Bluemix – Hands On Workshop Bluemis Tours… 21 © Copyright IBM Corporation 2015
  • 22. IBM Bluemix – Hands On Workshop Module 3: Boilerplate applications Deploying your first application 22 © Copyright IBM Corporation 2015
  • 23. IBM Bluemix – Hands On Workshop Boilerplates •Provide a fast way to get an application stated •Package of sample application code and services 23 © Copyright IBM Corporation 2015
  • 24. IBM Bluemix – Hands On Workshop Exercise 3a: Deploy your first application 24 © Copyright IBM Corporation 2015
  • 25. IBM Bluemix – Hands On Workshop Accessing sample code •Sample code for the application is available to download after a runtime or boilerplate has been deployed. 25 © Copyright IBM Corporation 2015 1.Click 2.Click
  • 26. IBM Bluemix – Hands On Workshop Command-line interface • Bluemix uses the Cloud Foundry command-line interface (CLI): cf •cf help provides help page showing all the commands •cf help <command> provides help for specific command 26 © Copyright IBM Corporation 2015 cf l login cf ds delete service cf t target space or organization cf bs bind service to application cf a list apps in current space cf st start app cf app display status for specific app in current space cf sp stop app cf p push (deploy or update) app cf d delete app cf s show service info cf scale scale app cf cs create service cf logs tail or show logs for app
  • 27. IBM Bluemix – Hands On Workshop Sample cf commands To log in to Bluemix: cf l –a https://api.ng.bluemix.net -u <email> -p <password> -o <email> -s dev cf l –a https://api.eu-gb.bluemix.net -u <email> -p <password> -o <email> -s dev This command will log in to Bluemix, set the organization to the user’s own organization, and the space to dev To check what space you are logged into or to change the space: cf t cf t -s test The first option prints the current target organization and space. The second option switches to the test space. To check what spaces exist in an organization: cf spaces Displays the spaces available in the current organization. cf space dev Displays information about the dev space in the current organization. 27 © Copyright IBM Corporation 2015
  • 28. IBM Bluemix – Hands On Workshop Exercise 3b: Deploy then update an application using the Command Line Interface 28 © Copyright IBM Corporation 2015
  • 29. IBM Bluemix – Hands On Workshop Eclipse plug-in for Bluemix • Available in the Eclipse marketplace • Enables developers to develop in Eclipse and then deploy to Bluemix  Java and JavaScript are supported 29 © Copyright IBM Corporation 2015 Servers view Right click Bluemix Select Add and Remove … Select available app Click Add to deploy to Bluemix
  • 30. IBM Bluemix – Hands On Workshop Define your Bluemix server connection in Eclipse • In Eclipse preferences, select Server then Runtime Environments. • Add a server definition for each Bluemix space that you want to deploy to. 30 © Copyright IBM Corporation 2015
  • 31. IBM Bluemix – Hands On Workshop Adding additional Bluemix regions to Eclipse 31 © Copyright IBM Corporation 2015 1. Click Manage Cloud from the Add Bluemix Account dialog box. 2. Click Add to add an additional Bluemix cloud 3. Enter the details of the Bluemix region by providing the name and endpoint URL 4. Click Finish. For more information about region endpoint URLs, see: https://www.ng.bluemix.net/docs/#overview/overview.html#ov_intro__reg
  • 32. IBM Bluemix – Hands On Workshop Environment Variables •Bluemix sets environment variables when deploying an application to inform the application about the environment it is running in.  Application may need to use this information to set configuration – such as the hostname and port to listen for incoming requests.  VCAP_APP_HOST – specifies the hostname on which your application should listen  VCAP_APP_PORT – specifies the port number on which your application should listen •You can also define custom environment variables to provide configuration to your application 32 © Copyright IBM Corporation 2015
  • 33. IBM Bluemix – Hands On Workshop Manifest file • Allows you to specify the parameters for an application deployment • manifest.yml file is used at deploy time if found in directory application is being pushed from --- applications: - name: Myphpmyadmin memory: 128M instances: 1 host: Myphpmyadmin path: . buildpack: https://github.com/dmikusa-pivotal/cf-php-build-pack.git services: - mysql_BlueMixLab --- applications: - name: bluemix-todo-node host: bluemix-todo-node-${random-word} command: node app.js memory: 128M services: - todo-db http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html 33 © Copyright IBM Corporation 2015
  • 34. IBM Bluemix – Hands On Workshop .cfignore •When you push an application all content of the current directory and all sub directories are pushed to the server – this is not the behavior you always want •.cfignore allows control of what is sent to the server by listing the files and directories you do not want to send to the server •Sample .cfignore file: .git node_modules tmp lib-src 34 © Copyright IBM Corporation 2015
  • 35. IBM Bluemix – Hands On Workshop Exercise 3c: Working with Eclipse and Bluemix 35 © Copyright IBM Corporation 2015
  • 36. IBM Bluemix – Hands On Workshop Summary • Bluemix provides a number of options for developing applications giving you the ability to integrate Bluemix into the developer tools of your choice • Bluemix provides starter packs to get you up and running quickly • Start applications from scratch 36 © Copyright IBM Corporation 2015
  • 37. IBM Bluemix – Hands On Workshop Module 4: DevOps and Bluemix Overview of DevOps services and app development 37 © Copyright IBM Corporation 2015
  • 38. IBM Bluemix – Hands On Workshop IBM Bluemix DevOps services An 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 autodeploy  Complementary mobile quality and application performance monitoring  Use your favorite tools or work from the web IDE  Free public and fee-based private projects • Scalable, secure, enterprise-ready  Runs on SoftLayer infrastructure 38 © Copyright IBM Corporation 2015
  • 39. IBM Bluemix – Hands On Workshop DevOps Services available today 39 © Copyright IBM Corporation 2015
  • 40. IBM Bluemix – Hands On Workshop Exercise 4a: IBM Bluemix integration with DevOps services 40 © Copyright IBM Corporation 2015
  • 41. IBM Bluemix – Hands On Workshop Get productive with Bluemix DevOps services in minutes • Register at www.jazzhub.com • Answer a few questions  Which Source Code Management (SCM) - Git, GitHub, Jazz SCM?  Do you want your project to be public or private?  Do you want to practice agile software development?  Do you want to deploy on IBM Bluemix? • Start coding 41 © Copyright IBM Corporation 2015
  • 42. IBM Bluemix – Hands On Workshop Collaborate seamlessly on public or private projects • Easily invite team members • Access from anywhere • Built for collaboration from the ground up • Choose who sees your project and how you engage with broader communities 42 © Copyright IBM Corporation 2015 Invite other people to your project Enter a comma separated list of email addresses
  • 43. IBM Bluemix – Hands On Workshop 43 Agile development in the cloud is easy with Bluemix DevOps services • Built-in agile process support • Work items to track and plan project activities • Agile tools for the product backlog, releases, and sprints • Dashboard charts for project status 43 © Copyright IBM Corporation 2015
  • 44. IBM Bluemix – Hands On Workshop Choose how you code with Bluemix DevOps services • Browser-based integrated development environment • Full support for local development with Eclipse or Visual Studio • Built-in support for Jazz Source Control • Hosted Git repository • Got GitHub? No problem 44 © Copyright IBM Corporation 2015
  • 45. IBM Bluemix – Hands On Workshop Live Sync for Node.js • Enables Node.JS code changes to be pushed live without the need to redeploy the application • Available in IBM Bluemix DevOps services as the Live Edit feature (Chrome browser only for debug) • Available on Microsoft Windows and Applied OS X platforms from the command line using the Live Sync CLI 45 © Copyright IBM Corporation 2015
  • 46. IBM Bluemix – Hands On Workshop Exercise 4b: Working in DevOps Services 46 © Copyright IBM Corporation 2015
  • 47. IBM Bluemix – Hands On Workshop Leverage the power of social coding 47 © Copyright IBM Corporation 2015 Public Private With public projects, it’s easy to learn and share work with a broader audience.
  • 48. IBM Bluemix – Hands On Workshop Summary • IBM Bluemix DevOps Services:  Provides an online set of tooling to plan, manage, develop, and deploy your application  Can use the build in code repository or choose to use Git Hub  Allows developers to collaborate on a project  Allows developers to work online or locally on the same project 48 © Copyright IBM Corporation 2015
  • 49. IBM Bluemix – Hands On Workshop Module 5: Cloud development and the new IT Maximizing the value of Bluemix 49 © Copyright IBM Corporation 2015
  • 50. IBM Bluemix – Hands On Workshop Challenges and expectations • Time to market for new applications is to long • Speed and innovation are needed to capture new business opportunities • Remove blockage from IT deployment • Competitive threat from new ”on the web born” companies • Clients want to enter the API economy. Need environment to share or sell software assets they build/own • Reduce operational cost and limit capital investments and remove the need to manage and procure assets and services 50 © Copyright IBM Corporation 2015 Developers’ expectations:Client business challenges:
  • 51. IBM Bluemix – Hands On Workshop Bluemix can fit into a software development process, but will it deliver the promised value? 51 © Copyright IBM Corporation 2015 Initiation Planning Requirements Analysis Design Development Integration System Test Deployment Operation and Maintenance
  • 52. IBM Bluemix – Hands On Workshop What does it take to deliver the promised value? 52 © Copyright IBM Corporation 2015 • User-centered design • Agile methodology • DevOps processes and tooling • Architect for cloud Microservices Architecture
  • 53. IBM Bluemix – Hands On Workshop User-centered design 53 © Copyright IBM Corporation 2015 Hills: who, what,WOW Sponsored users: design for real users, not for imagined needs Playbacks: collaborate to tell a great story
  • 54. IBM Bluemix – Hands On Workshop Agile methodology 54 © Copyright IBM Corporation 2015 Agile principles The Agile Manifesto is based on 12 principles: •Customer satisfaction by rapid delivery of useful software •Welcome changing requirements, even late in development •Working software is delivered frequently •Close, daily cooperation between business people and developers •Projects are built around motivated individuals, who should be trusted •Face-to-face conversation is the best form of communication (co-location) •Working software is the principal measure of progress •Sustainable development, able to maintain a constant pace •Continuous attention to technical excellence and good design •Simplicity—the art of maximizing the amount of work not done—is essential •Self-organizing teams •Regular adaptation to changing circumstance Agile practices Agile development is supported by several concrete practices, covering areas such as requirements, design, modeling, coding, testing, project management, process, and quality. Some notable agile practices include: • Acceptance test-driven development (ATDD) • Agile modeling • Backlogs (product and sprint) • Behavior-driven development (BDD) • Cross-functional team • Continuous integration (CI) • Domain-driven design (DDD) • Information radiators (scrum board, task board, visual management board, burndown chart) • Iterative and incremental development (IID) • Pair programming • Planning poker • Refactoring • Scrum events (sprint planning, daily scrum, sprint review, and retrospective) • Test-driven development (TDD) • Agile testing • Timeboxing • Use case • User story • Story-driven modeling • Retrospective • Velocity tracking From Wikipedia:
  • 55. IBM Bluemix – Hands On Workshop DevOps 55 © Copyright IBM Corporation 2015 Goals The specific goals of a DevOps approach span the entire delivery pipeline.They include improved deployment frequency, which can lead to faster time to market, lower failure rate of new releases, shortened lead time between fixes, and faster mean time to recovery in the event of a new release crashing or otherwise disabling the current system. Simple processes become increasingly programmable and dynamic, using a DevOps approach,which aims to maximize the predictability, efficiency, security, and maintainability of operational processes.Very often, automation supports this objective. Adoption The adoption of DevOps is being driven by factors such as: • Use of agile and other development processes and methodologies • Demand for an increased rate of production releases from application and business unit stakeholders • Wide availability of virtualized and cloud infrastructure from internal and external providers • Increased usage of data center automation and configuration management tools FromWikipedia:
  • 56. IBM Bluemix – Hands On Workshop Bluemix unified DevOps experience (roadmap) 56 © Copyright IBM Corporation 2015
  • 57. IBM Bluemix – Hands On Workshop Application architecture 57 © Copyright IBM Corporation 2015 Feeds Pub/sub Task Task Backend Cache Backend Web Web Web
  • 58. IBM Bluemix – Hands On Workshop Twelve-Factor app (http://12factor.net) In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service. The twelve-factor app is a methodology for building software-as-a-service apps that: • Use declarative formats for setup automation to minimize time and cost for new developers joining the project • Have a clean contract with the underlying operating system, which offers maximum portability between execution environments • Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration • Minimize divergence between development and production, enabling continuous deployment for maximum agility • Can scale up without significant changes to tooling, architecture, or development practices The twelve-factor methodology can be applied to apps written in any programming language, and which use any combination of backing services (database, queue, memory cache, etc). I. Codebase One codebase tracked in revision control, many deploys II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing Services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes VII. Port binding Export services via port binding VIII. Concurrency Scale out via the process model IX. Disposability Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity Keep development, staging, and production as similar as possible XI. Logs Treat logs as event streams XII. Admin processes Run admin/management tasks as one-off processes © Copyright IBM Corporation 201558
  • 59. IBM Bluemix – Hands On Workshop Exercise 5a: Creating a new project and code repository 59 © Copyright IBM Corporation 2015
  • 60. IBM Bluemix – Hands On Workshop Best tools for the job • Importance of having a good developer setup • Lint tooling (static analysis is useful for code quality) • Syntax highlighting, autocomplete, etc. • Quality Assurance needs to be part of the development process  Continuous testing during development  Test tools such as Mocha, Chai, Sinon for JavaScript 60 © Copyright IBM Corporation 2015
  • 61. IBM Bluemix – Hands On Workshop Exercise 5b: Setting up for static analysis and test-driven development 61 © Copyright IBM Corporation 2015
  • 62. IBM Bluemix – Hands On Workshop Test-driven development •No code is written unless it is to pass a test. •When one function calls another function, ensure that unit tests are not duplicating tests done by the tests for the called function.  Test frameworks provide spy functionality to verify functions are called correctly rather than testing what the called function returns. •Wherever possible, ensure tests cover problematic areas of the implementation language.  For example, with a JavaScript string vs number comparison, “5” > “11” but 5 < 11 type coercion sometimes delivers the wrong comparison 62 © Copyright IBM Corporation 2015
  • 63. IBM Bluemix – Hands On Workshop Exercise 5c: Test-driven development 63 © Copyright IBM Corporation 2015
  • 64. IBM Bluemix – Hands On Workshop DevOps pipeline in Bluemix IBM Bluemix DevOps Services can be configured to automatically run tests and if the tests pass, the code is deployed to Bluemix. 64 © Copyright IBM Corporation 2015
  • 65. IBM Bluemix – Hands On Workshop Exercise 5d: Adding a REST API, deploying to Bluemix, and setting up the DevOps pipeline 65 © Copyright IBM Corporation 2015
  • 66. IBM Bluemix – Hands On Workshop Summary • A modern cloud platform alone does not deliver the agility and speed businesses require today. • A modern approach to application creation is needed, which delivers:  Innovation  Agility  Quality  Best user experience • This approach requires an appropriate design, methodology, set of processes, tooling, and architecture to enable developers to deliver. • Many companies are adopting a bimodal approach to manage existing applications and enable innovative new applications to be created. 66 © Copyright IBM Corporation 2015
  • 67. IBM Bluemix – Hands On Workshop Module 6: Services Using and adding services in IBM Bluemix 67 © Copyright IBM Corporation 2015
  • 68. IBM Bluemix – Hands On Workshop Using services in Bluemix • Bluemix provides services that can be used by applications without requiring you to manage the setup and operation of those services. • Available services are listed in the catalog in the web UI and can also be obtained by using the command cf marketplace. • To use the service, you must bind the service to your application by using web UI or the command cf bs. 68 © Copyright IBM Corporation 2015
  • 69. IBM Bluemix – Hands On Workshop Accessing a service • When you bind a service to your application, Bluemix adds details about the service to an environment variable VCAP_SERVICES. • You can view the VCAP_SERVICES variable in the web UI. • Applications should be able to parse the VCAP_SERVICES variable. 69 © Copyright IBM Corporation 2015 Click
  • 70. IBM Bluemix – Hands On Workshop Parsing VCAP_SERVICES •Node if (process.env.VCAP_SERVICES) { var env = JSON.parse(process.env.VCAP_SERVICES); var credentials = env['mysql-5.5'][0].credentials; … } •Ruby mysql_dbs = JSON.parse(ENV['VCAP_SERVICES'])["mysql-5.5"] credentials = mysql_dbs.first["credentials"] •Java String vcap_services = System.getenv("VCAP_SERVICES"); if (vcap_services != null && vcap_services.length() > 0) { JsonRootNode root = new JdomParser().parse(vcap_services); JsonNode mysqlNode = root.getNode(”mysql-5.5"); JsonNode credentials = mysqlNode.getNode(0).getNode("credentials"); … } The Java buildpack parses the VCAP_SERVICES variable and can auto-configure bound services. See the Bluemix Liberty for Java documentation. 70 © Copyright IBM Corporation 2015
  • 71. IBM Bluemix – Hands On Workshop Unit testing when services are used • Do not include calls to remote systems in unit tests. • Service APIs provide a contract between the service consumer and service provider. • Unit tests can ensure the code being tested is using the API correctly according to the contract.  We should assume that the service provider has also tested the service and ensures it implements the contract that is defined by the API. • Test frameworks provide capabilities to stub and mock external calls, but ensure that the API is being called correctly when you run unit tests.  These facilities are often called test doubles. 71 © Copyright IBM Corporation 2015
  • 72. IBM Bluemix – Hands On Workshop Exercise 6a: Adding a service to an application 72 © Copyright IBM Corporation 2015
  • 73. IBM Bluemix – Hands On Workshop Become a service provider •In additional to consuming services, you can create new services on Bluemix  Private services are available only to your organization − cf cups biTestService -p "host, port, username, password” − Specify the ‘properties’ you want to make available to applications binding to the service − You can update the properties if requires  Public services, that can become an additional revenue stream, can only be added through the IBM Cloud Marketplace 73 © Copyright IBM Corporation 2015
  • 74. IBM Bluemix – Hands On Workshop Exercise 6b Creating a user-provided service 74 © Copyright IBM Corporation 2015
  • 75. IBM Bluemix – Hands On Workshop Summary • The VCAP_SERVICES environment variable allows your application to discover bound services and provides the information required to access the service. • Bluemix allows new services to be added through the IBM Cloud Market Place. • SoftLayer can be used to host services. • User-provided services (private to an organization) can be created or accessed the same way as a Bluemix provided service. 75 © Copyright IBM Corporation 2015
  • 76. IBM Bluemix – Hands On Workshop Module 7: How Cloud Foundry works Cloud Foundry internals 76 © Copyright IBM Corporation 2015
  • 77. IBM Bluemix – Hands On Workshop An open platform as a service (PaaS). The system supports multiple frameworks, multiple application infrastructure services, and deployment to multiple clouds. Cloud Foundry 77 © Copyright IBM Corporation 2015
  • 78. IBM Bluemix – Hands On Workshop Lots of languages, frameworks, and services 78 © Copyright IBM Corporation 2015 Multiple languages • Ruby, Java, Scala, Node.js, Erlang, Python, PHP, etc. Multiple frameworks • Rails, Sinatra, Spring, Grails, Express, Lift, etc. Multiple services • MySQL, Postgres, MongoDB, Redis, RabbitMQ, etc. Multiple clouds, Multiple IaaS environments • Public cloud, microcloud, private cloud
  • 79. IBM Bluemix – Hands On Workshop Bluemix architecture 79 © Copyright IBM Corporation 2015
  • 80. IBM Bluemix – Hands On Workshop Cloud Foundry kernel internals 80 © Copyright IBM Corporation 2015
  • 81. IBM Bluemix – Hands On Workshop Design of a virtual machine (VM) 81 © Copyright IBM Corporation 2015
  • 82. IBM Bluemix – Hands On Workshop Cloud Foundry: application staging 82 © Copyright IBM Corporation 2015
  • 83. IBM Bluemix – Hands On Workshop Choosing the runtime for an application •If you don’t specify a runtime when you deploy an application, Bluemix will try to find a suitable runtime as follows: 1. Each predefined runtime has a position set and runtimes are tried in ascending position order. 2. Bluemix asks each runtime, starting with runtime at position 1, if it can run the application. 3. The first runtime that responds that it can run the application is used. 4. If no runtime can run the application, an error is returned. •At deploy time, you can also specify the runtime to use. 83 © Copyright IBM Corporation 2015
  • 84. IBM Bluemix – Hands On Workshop Buildpacks •Buildpacks provide the framework and runtime support for your application. •The buildpack determines whether they can run your application as part of the auto detect mechanism that Bluemix uses when you push an application. •You can control which platform-provided buildpack your application should use or specify an external buildpack to be used to run your application: “Bring your own Buildpack.” 84 © Copyright IBM Corporation 2015
  • 85. IBM Bluemix – Hands On Workshop Specifying a buildpack • Use the cf CLI to specify which buildpack to use when deploying your application.  Use the -b option with the command cf push • You can specify the name of an internal buildpack or provide the URL for an external buildpack. •cf buildpacks shows the installed internal buildpacks that are available: • cf push myApp -b nodejs_buildpack • cf push myApp -b https://github.com/dmikusa-pivotal/cf-php-build-pack.git 85 © Copyright IBM Corporation 2015
  • 86. IBM Bluemix – Hands On Workshop Exercise 7a: Specifying a buildpack when deploying an application 86 © Copyright IBM Corporation 2015
  • 87. IBM Bluemix – Hands On Workshop Cloud Foundry: services 87 © Copyright IBM Corporation 2015
  • 88. IBM Bluemix – Hands On Workshop Module 8: Containers Docker, virtual machines, and Dockerfiles 88 © Copyright IBM Corporation 2015
  • 89. IBM Bluemix – Hands On Workshop Docker containers and virtual machines (VMs) Server Server Host OS Host OS Hypervisor Docker Engine Guest OS Guest OS Guest OS Binaries Libraries Binaries Libraries Binaries Libraries Binaries Libraries Binaries Libraries Appl A Appl A Appl B ApplB ApplB ApplB ApplB ApplB ApplB ApplA ApplA VM Docker = Linux namespaces + cgroups + overlay file system + image format Docker © Copyright IBM Corporation 201589
  • 90. IBM Bluemix – Hands On Workshop Advantages to using containers • High density: Because containers share the same operating system (OS) image and middleware (when applicable), you can run more applications on a server.  For example, if the full stack image required to run an application requires 1 GB, if you wanted to use a full VM, you’d 1 GB times the number of VMs. With LXC containers and AuFS, you can share the bulk of the 1 GB, and you can have hundreds of containers and still use a little over 1 GB (assuming they are all running the same OS image). • Fast start-up: Because containers might have several layers in common, only the new layers need to be copied, dramatically reducing build/transfer/boot/load times.  A full virtualized system usually takes about 10 minutes to start; LXC containers take seconds, and sometimes even less than a second. • Portability across environments: Deploying a consistent production environment is hard. Even if you use tools like Chef and Puppet, there are always OS and library updates that change between hosts and environments.  Docker gives you the ability to snapshot the OS into a common image, and when combined with IBM’s patterns technology, Docker makes it easy to deploy a collection of images comprising a given workload in another collection of Docker hosts. © Copyright IBM Corporation 2015 •Cloudy operations with Docker LXC outperform VM • 48x server reboot, 1.5x server boot, 1.62x server snapshot, etc. •Docker LXC density potential compared to VMs • 3x memory savings • 26x CPU savings • 3.22x smaller images in this test (note – image sizes can vary based on required packages) Manual VM Docker Provision Time Days Minutes Seconds / ms Significant threat to virtualization market 90
  • 91. IBM Bluemix – Hands On Workshop Docker’s components and functions Container Image Repository Dockerfile for Container N ImageN Container Build Engine Server Host OS Linux Container + Docker Engine ContainerA ContainerB ContainerN Push new Image to Repository Describes steps to build the container automatically from source Get N … Run N Build N Source Code Repository Build Store Run © Copyright IBM Corporation 201591
  • 92. IBM Bluemix – Hands On Workshop Sample Dockerfile • Dockerfile for WebSphere Liberty Profile: FROM ubuntu:12.04 # add the files we require, jar + WLP files ADD wlp-developers-extended-8.5.5.2.jar /root/ ADD wlp-developers-runtime-8.5.5.2.jar /root/ ADD JAXWSEJBSample.jar /root/ # install WLP RUN apt-get update RUN apt-get install -y default-jre RUN java -jar /root/wlp-developers-runtime-8.5.5.2.jar --acceptLicense /root/ RUN java -jar /root/wlp-developers-extended-8.5.5.2.jar --acceptLicense /root/ RUN cd /root/wlp && java -jar ../JAXWSEJBSample.jar /root/wlp EXPOSE 9080 CMD /root/wlp/bin/server run JAXWSEJBSample 92 © Copyright IBM Corporation 2015
  • 93. IBM Bluemix – Hands On Workshop Summary • The advantages of containers:  Containers and VMs allow you to easily bring applications to Bluemix.  They provide a way to virtualize and partition physical infrastructure.  They allow IaaS and PaaS to converge and be co-located.  They support a large scale deployment with low latency.  Containers provide portability across environments. 93 © Copyright IBM Corporation 2015
  • 94. IBM Bluemix – Hands On Workshop Module 9: Beyond the 30-day free trial Freemium level of service 94 © Copyright IBM Corporation 2015
  • 95. IBM Bluemix – Hands On Workshop After the 30-day Bluemix trial •After your 30-day trial ends, you will be asked to enter a credit card to continue using Bluemix. •You are still able to use Bluemix for free after you enter your credit card details because there is a freemium level of service available:  375 GB-hours are free every month—wow!  Services have a free plan. •Use the Pricing Sheet and price calculator to verify what you can run for free each month. •Use your account summary to check your monthly usage. •Set notifications to advise when cost thresholds are being reached. 95 © Copyright IBM Corporation 2015
  • 96. IBM Bluemix – Hands On Workshop Use the Bluemix UI to manage your Freemium usage Dashboard Pricing Calculator Account Summary and Notifications © Copyright IBM Corporation 201596
  • 97. © 2015 IBM Corporation IBM Bluemix and Mobile Redefining Mobile Platform for Developers Nguyễn Tài Dũng Cloud Solution Architect + Bluemix Evangelist IBM Clouds and Ecosystem Development Email: dzungnt@vn.ibm.com
  • 98. © 2014 IBM Corporation98 Building Mobile Apps with Cloud Services
  • 99. 99 IBM MobileFirst reduces your mobile back-end effort so that you can focus on creating value where it matters most – your customers’ experiences Today, most organizations have no choice but to focus mobile efforts “under the surface” Development Engagement Security Operations Development Engagement Security Operations The right mobile technologies enable you to deliver great apps
  • 100. 100 IBM MobileFirst Platform Foundation 7.1 – Component Overview
  • 101. 101 b The MobileFirst platform provides flexibility for you to consume and compose the capabilities you need – on premise or in the cloud Quality Assurance Application Scanning On Premise or Private Cloud Modules Application Scanning Detect code security vulnerabilities at the time of development Quality Assurance Collect beta test feedback, crashes and analyze user sentiment Foundation Development environment, continuous delivery, operations, security and integration As Services in Bluemix Cloud APIs Cloudant NoSQL DB, Workflow, Business Analytics, more Foundation Services in IBM Bluemix
  • 102. 102 The MobileFirst Platform is integrated into IBM Bluemix Cloud Services Mobile Application Security Mobile Quality Assurance Embeddable Reporting Cloudant NoSQL DB Cloud Integration Workflow Business Rules Cloud Storage for mobile data management Security to prevent unauthorized access to data Integration Connect with APIs & Systems of Record Workflow to automate next actions Analytics for reporting and insight
  • 103. © 2014 IBM Corporation103 Mobile Cloud
  • 104. 104 Offline Mobile Cloud Application Fat Clients with presentation and business logic processed locally. Data downloaded from backend when on WIFI / Occasionally Advantages: Well Integrated and can be Optimized for Performance Availability: even without network connectivity. Disadvantages: No Portability, Complex Code.
  • 105. 105 All processing done online presentation layer at the client. Many times assumes constant connectivity with backend Advantages: Multiplatform, Direct and Instantaneous Accessibility to better services. Disadvantages: Excessive latency for real time responsiveness, no access to device features, sometimes difficult to maintain sessions for a long time. Online Mobile Cloud Application
  • 106. 106 WHAT IS MOBILE CLOUD ? • MC refers to an infrastructure where both the data storage and data processing happen outside of the mobile device. • Mobile cloud applications move the computing power and data storage away from the mobile devices and into powerful and centralized computing platforms located in clouds, which are then accessed over the wireless connection based on a thin native client. • MOBILE CLOUD = MOBILE COMPUTING + CLOUD COMPUTING
  • 107. 107 WHY DO WE NEED MOBILE CLOUD? –Mobile devices face many resource challenges (battery life, storage, bandwidth etc.) –Cloud computing offers advantages to users by allowing them to use infrastructure, platforms and software by cloud providers at low cost and elastically in an on- demand fashion. –Mobile cloud computing provides mobile users with data storage and processing services in clouds, obviating the need to have a powerful device configuration (e.g. CPU speed, memory capacity etc), as all resource-intensive computing can be performed in the cloud.
  • 108. 108 Mobile Cloud: Enabling New Applications Idea: Offload Computation to Cloud
  • 109. 109 IBM Mobile Offerings in Data and Push Services Persistent cloud with ability to Notify on Events or completion of processing 01010 10101 0101 110101 010001 01 0101 0 000111 000101 01 ∆
  • 110. © 2014 IBM Corporation110 Bluemix Mobile Backend as a Service
  • 111. 111
  • 112. © 2014 IBM Corporation112 Mobile and Bluemix MBaaS
  • 113. © 2014 IBM Corporation113 Mobile and Push Notification
  • 114. © 2014 IBM Corporation114 Push Notification
  • 115. © 2014 IBM Corporation115 Bluemix Mobile Quality Assurance
  • 116. © 2014 IBM Corporation116 Bluemix Mobile Quality Extensions
  • 117. © 2014 IBM Corporation117 Deploying the MobileFirst Server
  • 118. © 2014 IBM Corporation118 MobileFirst Platform Server Bluemix Softlayer bare metal Linux instance Bluemix app Bluemix Services MobileFirst app MobileFirst, Softlayer and Bluemix Shared Identity Token Adapters
  • 119. © 2014 IBM Corporation119 Spectrum of mobile app development approaches Web-Native Continuum  HTML5, JS, and CSS3 (full site or m.site)  Quicker and cheaper way to mobile  Sub-optimal experience  HTML5, JS, and CSS  Usually leverages Cordova  Downloadable, app store presence, push capabilities  Can use native APIs  As previous  + more responsive, available offline  Web + native code  Optimized user experience with native screens, controls, and navigation  App fully adjusted to OS  Some screens are multi- platform when makes sense  App fully adjusted to OS  Best attainable user experience  Unique development effort per OS, costly to maintain HybridPure web Pure native Mobile web site (browser access) Native shell enclosing external m.site Pre- packaged HTML5 resources HTML5 + native UI Mostly native, some HTML5 screens Pure native
  • 120. © 2014 IBM Corporation120 Studio provides authoring, visual design, simulation, and runtime skins for hybrid apps
  • 121. © 2015 IBM Corporation The Path to New Value with IBM Big Data & Analytics Presenter: Nguyen Tai Dzung Technical Consultant + Solution Architect EcoD Team, IBM Vietnam dzungnt@vn.ibm.com
  • 122. © 2015 IBM Corporation122
  • 123. © 2015 IBM Corporation123 The World of Big Data & Analytics Is Rapidly Expanding…
  • 124. © 2015 IBM Corporation Mức lương trung bình mỗi năm: 116.414 USD (khoảng 2 tỷ 515 triệu đồng) … Thực tế, “big data” đang là cụm từ “hot” nhất trong toàn bộ thế giới công nghệ hiện nay. Ý nghĩa của “Big Data” (“Dữ liệu Lớn”) là khá rộng: thu thập những khối lượng dữ liệu khổng lồ (email, văn bản, video, status Facebook…), xử lý các khối lượng dữ liệu này để tìm ra các thông tin có nghĩa giúp các công ty, tổ chức có thể đưa ra các quyết định kinh doanh phù hợp hơn trong tương lai. Với sự vươn lên mạnh mẽ của các mạng xã hội trong những năm qua cũng như của Internet of Thing trong tương lai gần, “Big Data” chắc chắn sẽ còn tiếp tục “hot” trong vòng nhiều năm nữa. Các công việc liên quan tới Big Data bao gồm cả các tác vụ phân tích, các loại cơ sở dữ liệu NoSQL (không đi theo mô hình bảng quan hệ như thông thường do quá nhiều dữ liệu), Hadoop v…v… Rất nhiều doanh nghiệp đang chạy theo trào lưu này: từ các công ty khởi nghiệp, các công ty dịch vụ phần mềm cho đến các công ty thông thường. Bởi vậy mà Dice hiện đang có tới 35.000 đầu việc cho Big Data, và thu nhập cho các công việc liên quan tới công nghệ này tăng tới 9,3% trong năm qua. Nguồn bài viết: http://vieccntt.com/30-cong-nghe-lap-trinh-thu-nhap-25-ty-dong-moi-nam-p1.html 124 Big Data
  • 125. © 2015 IBM Corporation Dữ liệu lớn (Big data) là thuật ngữ dùng để mô tả các bộ dữ liệu có kích thước rất lớn, khả năng phát triển nhanh, và rất khó thu thập, lưu trữ, quản lý và phân tích với các công cụ thống kê hay ứng dụng cơ sở dữ liệu truyền thống. Một số đặc trưng của Big Data bao gồm: 1. Volume (Dung lượng): Dung lượng của Big Data đang tăng lên mạnh mẽ từng ngày từ các nguồn như thiết bị di động bao gồm video, hình ảnh, con người tương tác trên các hệ thống(mạng xã hội, transaction từ bán lẻ …)  Cứ mỗi 11 giây, một petabyte (~ một triệu GB) dữ liệu được tạo ra trên toàn thế giới, tương đương với một đoạn video HD dài 13 năm.  Facebook phải xử lý khoảng 500 TB dữ liệu mỗi ngày (forum, chat, hình ảnh)  Wallmart – dữ liệu của họ đến từ các transactions  Lợi ích thu được từ việc xử lý một khối lượng lớn dữ liệu chính là điểm thu hút chủ yếu của Big Data, tuy nhiên cũng đặt ra nhiều khó khăn trong việc tìm ra những phương pháp, kỹ thuật để xử lý khối lượng dữ liệu này. 2. Velocity (Tốc độ): với sự ra đời của các kỹ thuật, công cụ, ứng dụng lưu trữ, nguồn dữ liệu liên tục được bổ sung với tốc độ nhanh chóng. Tổ chức McKinsey Global ước tính lượng dữ liệu đang tăng trưởng với tốc độ 40%/năm, và sẽ tăng 44 lần từ năm 2009 đến 2020. 125 Big Data Is All Data (1/2) Data at Scale Volume Data in Motion Velocity
  • 126. © 2015 IBM Corporation126 Big Data Is All Data (2/2) Data in Many Forms Variety Data Uncertainty Veracity 3. Tính đa dạng (variety): Dữ liệu được thu thập từ nhiều nguồn khác nhau, từ các thiết bị cảm biến, thiết bị di động, qua mạng xã hội .v.v… Các kiểu dữ liệu có cấu trúc, bán cấu trúc và không có cấu trúc tồn tại dưới nhiều hình thức bao gồm hình ảnh, âm thanh, video, văn bản, v.v… 4. Veracity (Độ chính xác): một trong những tính chất phức tạp nhất của BigData là độ chính xác của dữ liệu. Sự gia tăng mạnh mẽ tính tương tác và chia sẻ của người dùng Mobile làm cho bức tranh xác định về độ tin cậy và độ chính xác của dữ liệu ngày một khó khăn hơn.  Bài toán phân tích và loại bỏ dữ liệu thiếu chính xác và nhiễu đang là tính chất quan trọng của BigData. [2] 5. Giá trị (value): đây là đặc trưng quan trọng nhất của Big Data, đề cập đến quá trình trích xuất các giá trị to lớn đang tiềm ẩn trong các bộ dữ liệu khổng lồ.
  • 127. © 2015 IBM Corporation127 Two types of big data 1. Data in Movement – Streams Data following constantly through a network or other data transport mechanism. Data persisted in memory on a temporary basis is also persisted to be “in motion”.  Twitter / Facebook comments  Stock market data  Sensors: Vital signs of a newly-born 2. Data at Rest – Oceans Data is persisted in a physical medium and is considered relatively static  Collection of what has streamed  Web logs, emails, social media  Unstructured documents: forms, claims  Structured data from disparate systems
  • 128. © 2015 IBM Corporation128 Tools to address practical challenges managing Big Data InfoSphere BigInsights for Hadoop For data at rest 100% standard Hadoop IBM Big SQL, BigSheets Developer tools, Accelerators Ease of use for all roles InfoSphere Streams For data in motion Agile development environment Sub-millisecond response Live graph, streams debugger Packaged adapters and toolkits Geospatial Toolkit
  • 129. © 2015 IBM Corporation129 Big Data & Analytics on Bluemix https://ace.ng.bluemix.net/#/home You can launch Big Data services and build applications in minutes on Bluemix. Use only what you need.
  • 130. © 2015 IBM Corporation IBM Cloudant Innovator of “Database as a Service” (DBaaS) JSON document database For mobile, Web, & IoT apps that need: Elastic scalability High availability Data model flexibility Data mobility Available as: Fully managed DBaaS On-premises private cloud Hybrid architecture Build More. Grow More. Sleep More.
  • 131. © 2015 IBM Corporation131 Hadoop là gì?  Tóm tắt ngắn gọn về Hadoop: 1. Framework cho phép phát triển ứng dụng phân tán 2. Viết bằng Java, nhưng hỗ trỡ được C++, Python, Perl 3. Linux-based 4. Làm việc với khối lượng dữ liệu khổng lồ (tính bằng Petabyte). 5. Xử lý trong môi trường phân tán, dữ liệu lữu trữ ở nhiều phần cứng khác nhau, yêu cầu xử lý đồng bộ.  Hadoop có 2 thành phần: 1. Hadoop Distributed File System: lưu trữ phân tán 2. MapReduce: xử lý phân tán  Hadoop có thể xử lý các ứng dụng có khối lượng dữ liệu lớn một cách nhanh chóng, chính xác, hiệu quả cao bằng cách lưu và tính toán dữ liệu trên nhiều node một cách độc lập. Cụ thể: Dữ liệu được chia ra thành blocks lưu trữ trên rất nhiều DataNode, mỗi block có nhiều bản sao lưu trên nhiều DataNode khác nhau, phòng khi một DataNode nào đó có sự cố thì hệ thống vẫn hoạt động bình thường.
  • 132. © 2015 IBM Corporation132 Hướng giải quyết của Hadoop...  Quản lý file phân tán: Hadoop Distributed File System (HDFS) sẽ chia nhỏ dữ liệu ra thành nhiều phần. Dữ liệu được quản lý một cách có hệ thống. Ý tưởng được sử dụng ở đây là “di chuyển tính toán vào trong dữ liệu” thay vì “di chuyển dữ liệu để tính toán” như cách thông thường.  Các tiến trình hoạt động độc lập: MapReduce là mô hình tổ chức của Hadoop, theo đó các node hoạt động một cách độc lập cao. Mặc dù giữa các node vẫn có giao tiếp nhưng bị giới hạn một cách tối đa, do đó giảm thiểu rủi ro khi một node bị lỗi.  Khả năng mở rộng tự nhiên: nhiều chương trình được viết triên các hệ thống phân tán khác ngoài Hadoop, mỗi lần mở rộng hệ thống từ 10 máy lên 100 hay 1000 máy thì đòi hỏi phải sửa đổi cấu trúc chương trình rất là nhiều. Cách thiết kế của Hadoop giúp mở rộng chương trình một cách tự nhiên mà không cần phải thay đổi nhiều hoặc thay đổi rất ít trong một vài trường hợp đặc biệt.
  • 133. © 2015 IBM Corporation133 Hướng giải quyết của Hadoop...
  • 135. More and more of the world’s activity is being expressed digitally by billions of interconnected devices… 135 Smarter cities Smarter vehicles Smarter home Smarter health Smarter factories Smarter transportatio n …providing businesses with the ability to learn more about their operating environment, and identify and act with the potential to create new value.
  • 136. DATA Unlocked from billions of connected devices CLOUD Standards based connectivity from anywhere ENGAGEMENT New revenue opportunities created from insights Today 3 technology forces are converging that are accelerating IoT
  • 137. SilverHook Powerboats – develops app 40% faster, enhancing racer and fan experience “It changes the paradigm in a lot of different areas if we can develop this type of technology at this speed. It gives other projects a benchmark to live up to.” —Nigel Hook, president of SilverHook Powerboats Solution components Software •IBM® Bluemix™ •IBM Internet of Things Foundation The transformation: Powerboat racers and fans both needed real- time insight into what was happening during races. With IBM® Bluemix™ and IBM Internet of Things Foundation, the SilverHook Powerboat team developed an application 40% faster, streaming sensor data to the cloud and using analytics to deliver information and alerts to racers. Partner company Virtual Eye also used the data to create a rich 3-D visualization for fans. Improves decision-making and safety during the race by providing critical data to drivers Enhances fan experience of races with real- time 3D data visualization 40% faster application development process MSP03109-USEN-00 Video:- https://www.youtube.com/watch?v=rpsjxnoNc-U
  • 139. Intel® Edison Board Small, Powerful & Adaptable Hardware Dual-core Intel® Atom™ processor 500MHz Integrated Wi-Fi*, Bluetooth® Low-Energy (LE) • 32-bit Intel® Quark™ microcontroller at 100 MHz • 1 GB of RAM, 4 GB of Storage • 40 multiplexed GPIO interfaces with expansion board options for total project design and flexibility • Yocto Project* Linux* Module 2 –The Intel Edison board
  • 140. Expansion options Module 2 –The Intel Edison board Partner Expansion Boards Intel Expansion Boards Built to Order Expansion Boards
  • 141. Intel® Edison •70 pin connector •Hirose DF40 Series •Easy to build your own board Intel currently offers 2 boards •Breakout Board •Arduino* expansion board Module 2 –The Intel Edison board Intel extension Boards
  • 142. Intel® Edison Development Board with Arduino* •20 digital input/output pins including •4 pins as PWM outputs •6 analog inputs •1 UART (RX/TX) •1 I2C input connector •1 ICSP 6-pin header (SPI) Module 2 –The Intel Edison board
  • 143. Connect to your Edison board what are connectors/cables for ? Module 2 –The Intel Edison board Device mode micro USB for : • 5V power • Arduino IDE • Ethernet over USB • Flash memory Host / device mode switch Micro USB for Serial commands to Edison via terminal/putty to : • Flash firmware • Configure Edison • IP address Standard size USB – Host mode for •Mouse •Keyboard •webcam Barrel (7V-15V) DC power connector
  • 144. Intel® Edison Breakout Board •I/O: array of through-hole solder points •USB OTG with USB Micro (AB) •Battery charger •USB micro (B) [UART] •DC power supply jack (7 to 15 VDC) Module 2 –The Intel Edison board
  • 145. Partner Expansion Boards Module 2 –The Intel Edison board
  • 146. Collaborate. Learn. Share. Succeed.•Intel® Developer Zone is where developers are tapping into everything they need to successfully bring their connected ideas to life. Software tools and testing equipment — Code samples and how to guides — Dev Kits, hardware, sensors and more — Forums, online events and meet-ups — Peer review and expert insights — A global community — Module 2 –The Intel Edison board software.intel.com/ iot
  • 147. Module 3 Internet of Things Foundation 147
  • 148. IBM Internet of Things Foundation Service Connect Collect Manage Assemble • Secure Device Registration • Scalable Device Connectivity • Device Management new! • PAYG SaaS pricing • Sandbox QuickStart service • Powered by IBM MessageSight technology Platform
  • 149. IoT Zone on Bluemix an intro to IoTF IoT Zone in Bluemix https://bluemix.net/solutions/iot
  • 150. IoT Foundation model IBM IoT Foundation Connectivity Summary IBM Internet of Things Foundation
  • 152. Getting Started with IBM Bluemix Hands-On Workshop Module 3: First Deploy Exercises
  • 153. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 2 Table of Contents Workshop overview..................................................................................................................................... 3   Exercise 3a: Deploy your first application................................................................................................... 3   Exercise 3b: Deploy and then update the application by using the CLI...................................................... 5   Exercise 3c: Working with Eclipse and Bluemix ....................................................................................... 13  
  • 154. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 3 Workshop overview In this workshop, you will: • Deploy a simple application from the Bluemix web interface. • Use the cf command line to modify and deploy the application. • Configure Eclipse so that you can create IBM Bluemix as a runtime in Eclipse Exercise 3a: Deploy your first application This exercise will show you how to deploy a simple application from the IBM Bluemix web interface. 1. In a browser, navigate to one of the following regions: • https://bluemix.net: This link should take you to your default location. o https://console.ng.bluemix.net (Region: US South) o https://console.eu-gb.bluemix.net (Region: United Kingdom) o https://console.au-syd.bluemix.net (Region: Sydney) 2. Click LOG IN and then enter your login information on the IBM id page and click Sign in. You should see your dashboard view: 3. Click CATALOG.
  • 155. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 4 4. Select the Node.js Cloudant DB Web Starter from the Boilerplates section. 5. Enter a name for your application as shown above. The host name information is automatically entered. The host name must be unique on Bluemix, so enter a name with your company name or initials to make the name unique. 6. Click CREATE. After a short while your application should be running. You can launch the application by clicking on the route.
  • 156. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 5 Exercise 3b: Deploy and then update the application by using the CLI In this exercise, you use the cf command-line interface (CLI) to work with Bluemix. You use this tool in a terminal or command window on your workstation. Use the same sample application that was used in exercise 3a. 1. Click Start Coding and then click Download Starter Code. 2. After the starter package is downloaded, move it to a directory on your workstation where you want to work, such as the Bluemix directory in your Documents folder. 3. Extract the package by double-clicking or right-clicking and click Extract or Unarchive. Do not delete the .zip file: you will need it in Exercise 3c.
  • 157. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 6 4. Delete the deployed application so that you can deploy it from the command line. Click the Overview page for the application, click the gear wheel in the application, and then click Delete App. 5. Delete the service and the route with the application by selecting the checkbox in the Services tab and the Routes tab: 6. Click OK to delete the application. 7. Open a command or terminal window and change the directory to the location where you extracted the downloaded sample application. (The file package.json should be in your current directory.) 8. Log in to Bluemix by issuing one of the following commands. Use the same region that you used in the Bluemix web UI: cf l -a https://api.ng.bluemix.net (Region: US South) cf l -a https://api.eu-gb.bluemix.net (Region: United Kingdom) cf l -a https://api.au-syd.bluemix.net (Region: Sydney) 9. Enter the email and password that you used to log in to the Bluemix web UI. If prompted, select the organization and space that you want to work in.
  • 158. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 7 10.Before you deploy the application, deploy a Cloudant database. View the available services by running this command: cf marketplace 11.In the list of services, find the cloudantNoSQLDB service. 12.Create the service by running this command: cf cs cloudantNoSQLDB Shared BICloudant • CloudantNoSQLDB is the name of the service from the cf marketplace command. • Shared is the name of the service plan that you want to use from the cf marketplace command. • BICloudant is the name of the service instance that you want to use. Enter your own name rather than BICloudant. You will use this new name when connecting (binding) the service to the application. 13.Refresh your web UI to you see the deployed service. 14.Deploy the application. Push the application to Bluemix by entering the following command. Change the application name to your unique name: cf push BI-MyFirstDeploy-3 -c "node app.js" -m 128M --no-manifest --no-start • BI-myFirstDeploy-3 is the application name and host name. • -c specifies the command to start the application. • -m specifies the amount of memory to allocate to each application instance. The default is 1 GB.
  • 159. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 8 • --no-manifest instructs to CLI tool to ignore the supplied manifest, which will be explained later. • --no-start instructs to CLI tool not to automatically start the application. Don’t want to allow the application to automatically start because it needs a database to run. You must link the Cloudant database instance to the application before you start the application. 15.Link the database and application by using the following command. Substitute the application name and service instance names that you used previously: cf bs BI-MyFirstDeploy-3 BICloudant • BI-myFirstDeploy-3 is the application name used when the application is deployed. • BICloudant is the service instance name used when the service is deployed. If you refresh the web UI, you see that the application and service are linked, but the application is still stopped. 16.Start an application by running the following command. Substitute the name of your application: cf start BI-MyFirstDeploy-3 • BI-myFirstDeploy-3 is the application that you want to start. If you refresh the web UI, you should see the application running. If not, you can start the application from the Dashboard. 17.Launch the application by clicking on the route in the web UI
  • 160. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 9 18.In a text editor, open the file app.js and modify the name of the file, the file description, and the value (lines 306, 307 and 310): • Line 306: Change the docName from 'sample_doc' to 'test_doc' • Line 307: Change the docDesc from 'A sample Document' to 'A test Document' • Line 310: Change the value from 'A sample Document' to 'A test Document' Save the file when you’re finished editing. When the application starts for the first time, it creates the sample document in the database. We have just modified the code that creates the sample document in the database. The document must be deleted from the database before you restart the application to allow the database to be populated again.
  • 161. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 10 19.In the Bluemix web UI, select the Cloudant Service instance and then start the Cloudant Dashboard. 20.Launch the Cloudant console. You should see a single database. Select the database:
  • 162. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 11 21.Edit the database document. 22.Delete the document. 23.Confirm the deletion when prompted. 24.Redeploy the updated application with the push command. This time, you don’t need to include the --no-start or memory parameter. cf push BI-MyFirstDeploy-3 -c "node app.js" --no-manifest 25.After the application has restarted, test it to ensure that your changes are now running.
  • 163. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 12 After the application is tested to confirm that the modified code is running, the application can be deleted to release resources for the next exercise. 26.Delete the application and service and confirm the deletion when prompted by running the following two commands: Delete the application: cf d BI-MyFirstDeploy-3 –r • BI-myFirstDeploy-3 is the application name to be deleted. • -r instructs Bluemix to also delete the routes attached to the application. Delete the service: cf ds BICloudant • BICloudant is the name of the service instance to be deleted. Confirm the deletion of the application and service.
  • 164. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 13 Exercise 3c: Working with Eclipse and Bluemix This exercise shows you how to work with Eclipse and Bluemix. 1. Launch Eclipse and switch to the JavaScript perspective. You should use a new workspace, but this is not essential. 2. Configure Eclipse to use Bluemix as a server by opening Eclipse Preferences and clicking Server > Runtime Environments. 3. Click Add. Then, select IBM Bluemix Runtime and select the Create a new local server checkbox.
  • 165. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 14 4. Click Next. 5. Select the appropriate URL to match the region that you have been using. 6. Enter your email and password, which are the credentials that you used to log into Bluemix. Click Validate Account to ensure that all details are valid and then click Next. 7. Select the organization and space that you want to use and then click Finish. Click OK to close the Preferences page. If you want to work with multiple spaces in Eclipse, you must create multiple server configurations. 8. Open the Servers view in Eclipse. If it’s not showing, click Window > Show View > Servers.
  • 166. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 15 Use the same application that you used in the last session. You should have the archive file that you downloaded in the last exercise on your workstation. If not, deploy the Node.js Cloudant Web Starter application from the Bluemix web UI, click View Guide, and then download the starter application. 9. Import the starter application package to Eclipse by clicking File > Import. 10.In the Import dialog, click General > Existing Projects into Workspace. 11.Click Next. Then, select the downloaded Zip file and click Finish.
  • 167. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 16 The project will be created. Before JavaScript applications can be deployed to Bluemix by the plug-in, those applications must be identified as a project suitable for Bluemix deployment by assigning a facet to the project. 12.Right-click the project in the Project Explorer view and click Properties. 13.Click Project Facets > Convert to faceted form.
  • 168. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 17 14.When you see the facets, select the Node.js Application facet. Click OK to close the dialog. 15.Delete the manifest.yml file by right-clicking it and clicking Delete. 16.Deploy the application. Right-click IBM Bluemix. If you have multiple definitions in the Servers view, select the server definition for the space that you want to deploy the application to.
  • 169. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 18 17.Click Add and Remove. 18.Select the cloudant_boilerplate_nodejs in the Available column and click Add to move it to the Configured column. 19.Click Finish. 20.In the Deploy dialog, change the application name to something unique. Click Next. Ensure that the URL contains a string that will be unique and then click Next. 21.On the Services selection window, click the Add a Service ( ) icon to add a service.
  • 170. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 19 22.When the list of available services is shown, select the CloudantNoSQLDB service. 23.Click Finish and Finish again to close the application Deploy dialog. The application is now being deployed to Bluemix. Eclipse should automatically switch to the Console view where you see details of the deployment.
  • 171. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 20 24.After the application is running, switch to the Server view and expand the Bluemix server. You should see the application in the list. Start the application from Eclipse by right-clicking the application in the Servers view and clicking Open Home Page. Tip: In Eclipse, you can change the browser that’s used to start applications by clicking Window > Web Browser and selecting your preferred browser. 25.Remove the sample document from the database to allow the application to create it when the database launches. In the Bluemix web UI, select the Cloudant Service instance and then launch the Cloudant Dashboard. You should see a single database: 26.Select the database and then delete the document. Confirm the deletion. 27.In a text editor, open the file app.js:
  • 172. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 21 28.Modify the name of the file, the file description and value (lines 306, 307, and 310) to replace sample with test: 29.Save the changes by clicking File > Save. Notice in the Server view that the state of the Bluemix server has changed to republish, which means that an application has changed. However, the application has not yet been published to Bluemix. 30.Select the cloudant_boilerplate_nodejs application in the Server view and right-click and click Update and Restart. 31.After the application is restarted, test the application to ensure that the change is now live. After the project has been tested, the application can be deleted to release resources for future exercises.
  • 173. Exercise 3: First Deploy Getting Started with IBM Bluemix Copyright IBM Corporation 2013-2015. All rights reserved. 22 32.Right-click the project in the Explorer view and click Delete to delete the project. Delete project contents on disk and then click OK. You are asked whether you want to delete the cloudantNoSQLDB service. Select the checkbox to delete the service. In the Bluemix web UI, confirm that the application and server have been deleted. Important: Deleting a project that is deployed through Eclipse also deletes it from Bluemix.
  • 174. Getting Started with IBM Bluemix Hands-On Workshop Module 4: Bluemix DevOps Services
  • 175. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 2 Table of Contents Bluemix Hands-On Workshop.....................................................Error! Bookmark not defined.   Section 4- DevOps Services ....................................... Error! Bookmark not defined.   Exercise 4.a - Bluemix integration with DevOps Services ...............................................................3   Exercise 4.b – working in DevOps Services....................................................................................5  
  • 176. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 3 Exercise 4.a - Bluemix integration with DevOps Services This exercise looks at how Bluemix and DevOps Services work together Log into Bluemix http://bluemix.net, https://console.eu-gb.bluemix.net or https://console/au-syd.bluemix.net and deploy the Node.js Cloudant DB Web Starter boilerplate from the Catalog. Once the application is running, select the Overview page then select ‘ADD GIT’ on the Application Overview page if prompted, add your DevOps Service details and select ‘Sign In’. Ensure you leave the option to populate the repository selected then select ‘CONTINUE’ In the overview page you will now see the option to ‘EDIT CODE’ select ‘EDIT CODE’ – you should be taken into DevOps Services with the sample application code imported and ready to work with. Select ‘BUILD & DEPLOY’. The project has automatically been set up to deploy code changes to Bluemix when they are pushed to the Git repository. You can now modify the code and deploy to Bluemix from DevOps Services. To test this, select the 'run stage'icon in the Build Stage section of the pipeline. You will see the Build 'Queued', then 'Running' and finally 'Succeeded'. Once the build has complete a deploy operation should be queued, then run. You should see the deployment running then Success – to launch the application you can click on the route:
  • 177. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 4 You can view logs and history for the build and deploy by clicking the links in the Build and Deploy stages.
  • 178. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 5 Exercise 4.b – working in DevOps Services In DevOps Services switch to the ‘EDIT CODE’ section so we can edit the code. Open the views/index.html file and scroll to line 16 to find the string that are displayed on the welcome page of the app : Change the line from 'Get Started' to 'Start now' save the changes by selecting 'File' from the menu, then 'Save'
  • 179. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 6 To get the changes pushed to Bluemix we need to commit the changes to the Git repository. To work with the Git repository switch into the Git section The files that have local changes are shown in the Changed Files section (Note, when a project is first added to DevOps Services some configuration files are updated automatically - the first 2 files in the list) Select the html file you just modified, add a commit message and then press ‘COMMIT’ The commit was made to the local branch – the builder works from the remote branch, so we need to push out changes back to the remote. In the left hand column, expand the ‘PUSH’ dropdown and select ‘Push All’
  • 180. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 7 If you quickly jump to the BUILD & DEPLOY screen you will see a build has automatically been started, which will then be automatically deployed to Bluemix if successful. Once the deploy has completed test the application to verify the code changes are now running. You can launch the application by clicking on the link in the deploy stage:
  • 181. Exercise 4: DevOps Services Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 8 Note: if a build fails you can click on the build in the builder and it will take you to a detailed screen of build history, where you can get access to the logs, files and details of changes included in the builds. This can help determine why the build failed.
  • 182. Getting Started with IBM Bluemix Hands-On Workshop Module 5: Maximizing the Value of Bluemix
  • 183. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 2 Table of Contents Workshop overview..................................................................................................................................... 3   Exercise 5a: Creating the project source code repository .......................................................................... 4   Exercise 5b: Setting up development tooling............................................................................................ 16   Exercise 5c: Test-driven development...................................................................................................... 23   Implement the divisibleBy function .................................................................................................... 23   Implement the convertToFizzBuzz function....................................................................................... 28   Implement convertRangeToFizzBuzz (introduces Sinon.JS) ............................................................ 31   Exercise 5d: Adding the REST API and deploying to Bluemix ................................................................. 34   Configure a DevOps pipeline to automatically test and deploy code................................................. 37  
  • 184. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 3 Workshop overview This workshop will demonstrate an approach for developing applications by using principles from agile development and using DevOps processes and tooling. You’ll develop a REST API that will calculate the FizzBuzz result for a given range. FizzBuzz is a children's numeracy game where any number divisible by 3 is replaced by the word Fizz, any number divisible by 5 is replaced with the word Buzz, and any number divisible by both 3 and 5 is replaced with the word FizzBuzz. For example, for the range 1 .. 20, the response is: 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, 17, Fizz, 19, Buzz You will use Node.js as the runtime and use test-driven development practices to create the solution.
  • 185. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 4 Exercise 5a: Creating the project source code repository Before you write any code, you must have the correct tooling and a source code repository. For this exercise, you’ll use the Git service from IBM DevOps Services for Bluemix. 1. Log in to DevOps Services for Bluemix: http://hub.jazz.net. 2. From your MyProjects page, click CREATE PROJECT. 3. Create a Git repository on Bluemix: a. Enter a project name. b. Create a new repository. c. Create a Git repo on Bluemix.
  • 186. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 5 4. Select to initialize the repository 5. If you want to share your project and make it searchable to the public, do not select the Private Project checkbox. 6. If you want to use the Track and Plan tool to support agile methodology, add features for Scrum development. 7. Select the checkbox to make the project a Bluemix project. Then, provide the details of the Bluemix space that the application will be deployed to.
  • 187. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 6 8. Click CREATE to create the project. The code repository has been created, and you can create a new Eclipse project that is based on the repository. 9. In DevOps Services console, select the Git URL link and copy the URL. Use Ctrl+C or Cmd C. 10.Start Eclipse and then from the main menu, click File > Import. 11.From the Select dialog, click Git > Project from Git and then click Next.
  • 188. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 7 12.In the Git dialog, select Clone URI and then click Next. 13.In the next dialog, paste the Git repository URL into the URI Location field. This will automatically populate the Host and Repository path. 14.Enter your DevOps services user name and password. Optionally, select to store the Git credentials in a secure store in Eclipse. You will need to provide additional information to initialize the secure store if this is the first time that you store credentials. 15.Click Next.
  • 189. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 8 Eclipse will query the Git repository and list the next branch that’s available. Because you just created the repository, only the master branch exists. 16.Leave the master branch selected and click Next. The local destination is then chosen. The default location is <user home directory>/git/<project name>. Use suggested default location. If you want to change it, you must remember the location because you will need it later in the exercise. 17.Click Next.
  • 190. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 9 18.Select the wizard to import as a general project and then click Next. 19.In the Import Projects dialog, enter an Eclipse project name. Use the same name as the DevOps service project name, but you can change if needed. 20.Click Finish.
  • 191. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 10 You now have an Eclipse project linked to your DevOps services Git repository. To complete the project setup, configure Eclipse to support JavaScript development. 21.Switch Eclipse to the JavaScript perspective: a. Click Add Perspective at the top right of the Eclipse window. b. Select JavaScript from the list. 22.Enable the NodeJS facet on the project: a. Right-click the project name and click Properties. b. In the Project Facet dialog, click Project Facets and then click Convert to faceted form.
  • 192. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 11 c. When you see the list of facets, click Node.js Application. Click OK. Adding the facet automatically creates a sample application in the project. d. Remove the app.js and package.json files. Right-click each file, click Delete, and confirm the deletion. The project shows that there are changes to the local copy of the project. These are the Eclipse project setting files. Don't save these as part of the source code. 23.Add a navigator view to see all the files in the project: a. Click Window > Show View and then click Navigator.
  • 193. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 12 b. Right-click the project name in the Navigator view and click New > File. c. Name the file .gitignore and then click Finish. d. Add the following two lines to the .gitignore file: Windows: Leave the slash as specified; do not change it to .settings: .project .settings/ The project still shows that there are changes. This occurs because the .gitignore file is a new file that is not committed and pushed to the master branch on the Git server.
  • 194. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 13 24.Commit and push the .gitignore file: a. Right-click the project name and click Team > Commit. b. In the Commit Changes dialog, enter a commit message and select the .gitignore file. Then, click Commit and Push. c. Close the confirmation dialog by clicking OK. The project will no longer show that there are outstanding changes. Finally, you should add a new window to access the command line. However, this is not necessary. Instead, you can use a command window outside Eclipse, but it’s more convenient to have everything in Eclipse because it provides a better working environment.
  • 195. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 14 25.Create a terminals view: a. From the main menu, click Window > Show View and then click Other. b. In the dialog, click Terminals > Terminals and then click OK. c. In the Terminals window, drag the tab to split the bottom section of the screen to allow concurrent viewing of the terminal and the problem views. If a command prompt isn’t shown, click the Open Terminal icon to start a new terminal. Use the default setting. On some platforms, this happens automatically. Drag and release when window outlines show 2 windows
  • 196. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 15
  • 197. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 16 Exercise 5b: Setting up development tooling Using appropriate developer tooling with features to automatically check for errors, provide code assist, and so on can make you more productive and help identify possible problems. You’ll use the new project that you created in the previous section. The first step is to ensure the JavaScript tooling is enabled and the test framework is created. 1. Create the JavaScript project: a. In the Terminals view, change to the directory that contains the project: • Mac & Linux default: cd <user home>/git/<project name> • Windows default: cd <user home>git<project name> If you want to verify where your project is located, right-click the project name in the Project Explorer view and then click Properties. Note the project location on the Resources tab:
  • 198. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 17 b. In the Terminals window, run the npm init command and answer the prompts: • Name - provide a unique name for your project • Version - 0.0.0 • Description - REST API to calculate FizzBuzz value for a given range • Entry point - server.js • Test command - node_modules/.bin/mocha • Git repository - hit enter to accept the default value • Keywords - can leave blank • Author - enter your name • License - hit enter to accept the default value Windows: Use the forward slash (/) when specifying the test command. If the Terminals window is too small, double-click the tab to enlarge it to a full screen. Double-clicking again will return it to its original size and location.
  • 199. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 18 c. To move the created files into Eclipse, right-click the project name in the Project Explorer view and click Refresh or press F5. d. If the wizard truncated the test script to mocha, open the package.json file in the Eclipse editor and change it back to node_modules/.bin/mocha. e. Tests are expected to be in a directory named test, so create a test directory: i. Right-click the project name in the Project Explorer view and click New > Folder. ii. Name the folder test and then click Finish. f. To be able to run tests, install the Mocha framework:
  • 200. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 19 i. In the Terminals view, enter npm install mocha --save-dev ii. Select the project name in the Project Explorer and click Refresh the project in Eclipse to display the new files. g. Test that everything works as expected by running a test: i. In the Terminals view, enter npm test Note that the test framework ran even though there are no tests defined. JSHint is a lint program for JavaScript. It provides static analysis of code. It’s a good practice to have this running in your tooling. Many development teams also include it as part of their automated test suite. h. Run JSHint from Mocha: i. In the Terminals view, enter the following command: npm install mocha-jshint --save-dev ii. Select the test directory of the project in the Project Explorer view and then right- click and click New > File. Name the file jshint.test.js. iii. In the file, enter the following content and then save the file by clicking File > Save or use these commands: Windows and Linux: Ctrl+S
  • 201. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 20 Mac: Cmd+S: require('mocha-jshint')(); iv. Rerun the tests by entering the following command in the Terminals view: npm test There are many errors from the imported modules in the node_modules directory. You do not control this is code, so it should be excluded from tests. i. Configure JSHint to ignore the files by using a .jshintignore file: i. Create a .jshintignore file by right-clicking the project name in the Project Explorer view and clicking New > File. ii. Add the following content to the file: node_modules test iii. In the Terminals view, rerun the tests: npm test JSHint is now enabled in the test suite, but ideally the code editor should provide feedback from the problems. JSHint is included in Eclipse, but you must configure it. j. Enable JSHint in Eclipse: i. Right-click the project name in the Project Explorer view and click Properties. ii. In the dialog, click JSHint.
  • 202. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 21 iii. Click Add next to the Enable JSHint for these files and folders box. iv. Accept the defaults as shown above and click OK. v. Click Add next to the But exclude these files and folders from validation box. vi. Click All files and then select in folder and add the node_modules folder. Select the include all subfolders checkbox. vii. Repeat the previous step to exclude the content of the test folder. viii. Click OK to make the changes and close the dialog.
  • 203. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 22 The project is now ready to implement the REST API, so now is a good time to commit changes to the Git repository (repo). There is some debate about whether dependencies should be checked in or re-fetched at build time. To reduce the amount of traffic that you need to push to the Git repo for this exercise, you will exclude the dependencies in node_modules. k. Update the Git configuration and then commit and push changes to the Git repo: I. Switch to the Navigator view to see files that start with a period ( . ) II. Double-click the .gitignore file to edit it and add the node_modules directory to the file. Then, save the file: Ctrl+S or Cmd+S. III. Right-click the project name and click Team > Commit. Click the link at the bottom right of the dialog to open the Git Staging view. IV. Drag the 4 files from the Unstaged Changes window to the Staged Changes window. Then, enter a commit message. V. Click Commit and Push. VI. Verify that the commit completed successfully and then close the confirmation dialog.
  • 204. Exercise 5: Maximizing the Value of Bluemix Getting Started with IBM Bluemix Copyright IBM Corporation 2015. All rights reserved. 23 Exercise 5c: Test-driven development Implement the divisibleBy function To implement the divisibleBy funtion, you generate the first test that the implementation must pass. Solving the problem requires a function to discover whether one number is divisible by another number, so the first test will check whether 3 is divisible by 3. Before you write the test, you’ll add another test framework: Chai. Chai is a behavior-driven development (BDD) and test-driven development (TDD) assertion library for Node.js and a browser that can be paired with any JavaScript testing framework. Chai provides the test capability to say "I expect this to be true" or "this should be true." Before you write a test, install Chai and then configure Mocha to use Chai: 1. Install and configure Chai: a. In the Terminals view, enter the following command: npm install chai --save-dev b. Select the project name in Project Explorer and press F5 to refresh the Eclipse project content. c. Create a new file in the test folder named support.js and add the following content: var chai = require("chai"); global.expect = chai.expect; d. Create a new file in the test folder named mocha.opts and add the following content: --require test/support e. Save both files. The files configure Mocha to use the expect functionality from Chai. 2. Create the first test: a. Create a new file in the test folder named fizzbuzz.test.js by right-clicking the test folder in the Project Explorer view and then click New > File.