Getting started with IBM Bluemix
This unit covers the following topics:
Understanding what you can build in IBM Bluemix
Creating and managing an IBM Bluemix application
IBM Bluemix users, spaces, and organizations
2.1 What you should be able to do
At the end of this unit, you should be able to describe:
IBM Bluemix infrastructure types
What you can build in IBM Bluemix
How to create an application in IBM Bluemix
The IBM Bluemix dashboard, catalog, and documentation features
How the application route is used to test an application from the browser
How to create services in IBM Bluemix
How to bind services to an application in IBM Bluemix
The environmental variables that are used with IBM Bluemix services
IBM Bluemix organizations, domains, spaces, and users
2.2 References
For more information about the topics that are described in this unit, see this following resources:
The IBM Bluemix documentation from the web interface provides an up-to-date reference and tutorial on building, deploying, and managing applications:
IBM Bluemix overview:
Join the IBM Bluemix developers community to view videos, tutorials, and forums:
Browse through a list of IBM Bluemix solutions and sample applications:
2.3 Getting started: Creating an IBM Bluemix account
Figure 2-1 Getting started: Creating an IBM Bluemix account
Notes:
Before you work on any of the exercises in this course, you must sign up for an IBM Bluemix account. You can register for a free IBM Bluemix trial account at this website:
2.4 IBM Bluemix infrastructure types
Figure 2-2 IBM Bluemix infrastructure types
Notes:
IBM Bluemix supports the following alternative infrastructure types:
Cloud Foundry provides the PaaS environment to run your applications. IBM Bluemix manages and maintains the infrastructure that runs the applications.
With Cloud Foundry Apps, IBM Bluemix allows basic management capability of your application and allows it to connect to prepackaged services. Cloud Foundry boilerplates and starter apps are the simplest way to get started with IBM Bluemix.
IBM Containers provide more fine-grained control over the computing infrastructure to run the application and services through Docker-like APIs. Docker packages software into standardized units that are called containers. Containers include all of the elements that an application needs to run. IBM Bluemix Container Service combines Docker and Kubernetes to deliver powerful tools, an intuitive user experience, and built-in security and isolation to automate the deployment, operation, scaling, and monitoring of containerized apps over a cluster. A Kubernetes cluster consists of one or more virtual machines.
If you want to port an image from another cloud infrastructure provider, or if you want to use a public image, consider the IBM Containers technology. Containers give you a bit more control, but still do not require you to manage an operating system or network. IBM Containers resemble the popular open source container engine Docker, but have some IBM Bluemix-specific features, such as their ability to integrate with the Cloud Foundry routers.
Virtual Servers are software implementation of hardware that runs applications, such as a computer. You can configure the operating system, server runtime environment, and application. If you want to have control over the infrastructure down to the operating system level, consider Virtual Servers.
Most developers in the enterprise will probably use some mix of these types. The exercises in this course introduce you to the Cloud Foundry infrastructure in IBM Bluemix. As such, Containers and Virtual Servers are out of scope of this course. The focus is on Cloud Foundry Apps for the remainder of this course.
2.5 What can you build in IBM Bluemix?
Figure 2-3 What can you build in IBM Bluemix?
Notes:
In IBM Bluemix you can build applications, which are the programs that developers build in the Cloud Foundry environment. You can build mobile apps that run outside the IBM Bluemix environment and use services to which the mobile apps are exposed. IBM Bluemix can also host application code that the developer would rather run on a back-end server in a container-based environment. Web apps consist of the code that is required to be run or referenced at runtime.
A service is a cloud extension that is hosted by IBM Bluemix. The service provides functionality that is ready-for-use by the app’s running code. The predefined services that are provided by IBM Bluemix include database, messaging, push notifications for mobile apps, and elastic caching for web apps. You can create your own services in IBM Bluemix. They can be simple utilities, such as the functions you might see in a runtime library, or complex business logic that you might see in a business process modeling service or a database.
2.6 Cloud Foundry Apps, Containers, and Virtual Servers
Figure 2-4 Cloud Foundry Apps, Containers, and Virtual Servers
Notes:
IBM Bluemix is an implementation of IBM Open Cloud Architecture, which is based on Cloud Foundry.
Containers and Virtual Servers are alternative ways to run and manage an application. They allow more control over the underlying infrastructure and configuration, but require more work by the developer.
This course focuses on Cloud Foundry Apps.
2.7 Containers versus Virtual Servers
Figure 2-5 Containers versus Virtual Servers
Notes:
Containers and virtual machines (VMs) have similar objectives: To isolate an application and its dependencies into a self-contained unit that can run anywhere. They both remove the need for physical hardware, which allows for more efficient use of computing resources.
Virtual Servers (or virtual machines) are created using a hypervisor. The hypervisor virtualizes the physical hardware to create a software-defined computer that runs its own operating system. Unless special software is installed for cloud management, an operating system that is running in a VM does not have any awareness that it is running in VM. As shown in Figure 2-5, the VM packages the virtual hardware, a kernel or OS, and user space for each new VM.
Unlike a VM that provides hardware virtualization, a container provides operating system-level virtualization.
A container library, such as Docker, separates different user spaces for each container. On the surface, these spaces might resemble a VM to a user.
The main difference between containers and VMs is that containers share the operating system kernel with other containers that are running on the machine, which is not the case with VMs. Therefore, you might see a VM running Linux on a Windows server, or Windows on a Linux server.
However, you do not see a container that runs Linux on anything other than a Linux server. The containers on that Linux server are separated out user spaces on that Linux server and the hardware is not virtualized.
Data storage also is managed differently in containers. In VMs, virtual disks are created and are similar to physical disks in that after you write something to the disk, it stays there until you delete it. With containers, you can make changes to the disk and then delete your changes when done.
2.8 IBM Bluemix catalog: Infrastructure
Figure 2-6 IBM Bluemix catalog: Infrastructure
Notes:
You can order infrastructure services in one of the following categories:
Compute
Storage
Network
Security
2.9 IBM Bluemix catalog: Apps
Figure 2-7 IBM Bluemix catalog: Apps
Notes:
IBM Bluemix offers many options for developing applications.
2.10 IBM Bluemix catalog: Boilerplates
Figure 2-8 IBM Bluemix catalog: Boilerplates
Notes:
In IBM Bluemix, boilerplates are packages of templates and sample applications. When you create an app by using boilerplate, IBM Bluemix configures the services for the application. IBM Bluemix also provides you with the source code and documentation for the sample application in the boilerplate.
A boilerplate contains an app and its associated runtime environment and predefined services. You can use a boilerplate to quickly get up and running. For example, you can select the Mobile Cloud boilerplate to host mobile and web apps and accelerate development time of server-side scripts by using the mobile app template and SDK.
2.11 IBM Bluemix catalog: Cloud Foundry Apps
Figure 2-9 IBM Bluemix catalog: Cloud Foundry Apps
Notes:
To create your own application, select the following server runtime environment as a starting point:
IBM packages support IBM runtime environments, such as Liberty.
Community runtimes rely on open source and third-party packages.
A runtime is the set of resources that is used to run an application. IBM Bluemix provides runtime environments as containers for different types of applications. The runtime environments are integrated as buildpacks into IBM Bluemix and are automatically configured for use.
Runtimes start with a simple templated example application that you can customize to meet your needs. These runtimes do not include any services by default, but you can add and bind your own services later.
2.12 IBM Bluemix catalog: Containers
Figure 2-10 IBM Bluemix catalog: Containers
Notes:
You can create a Kubernetes cluster that consists of one or more VMs that are called worker nodes. Every worker node represents a compute host in which you can deploy, run, and manage containerized applications. 
You can also create a container of IBM Integration Bus V10 Developer Edition, which you can use to start developing your own integration solution. Other options include IBM MQ and WebSphere eXtreme Scale Caching Server. You can also upload your container image.
2.13 IBM Bluemix catalog: OpenWhisk
Figure 2-11 IBM Bluemix catalog: OpenWhisk
Notes:
By using OpenWhisk, you can focus on writing code and building great solutions, without the hassle of setting up, configuring, or maintaining servers. You pay for only the time your code actually runs, which means no excess capacity or idle time. 
Consider the following OpenWhisk basic concepts:
Actions: A piece of code that you develop that performs one specific task. You can create the action in various runtimes, including Node.js, Python, and Swift 3.
Triggers: Triggering the actions can be through REST APIs, or based on certain events, such as Alarm-Based Trigger, IBM Cloudant Change, and Messaging.
Sequences: You create the flow of actions to complete one function.
Rules: Rules link triggers to actions or sequences.
2.14 IBM Bluemix catalog: Mobile
Figure 2-12 IBM Bluemix catalog: Mobile
Notes:
The capabilities include rapid development of mobile application by using a web editor to create a mobile application, test the mobile application by using cloud services, and gain insights into how your mobile application is being used.
2.15 IBM Bluemix catalog: Services
Figure 2-13 IBM Bluemix catalog: Services
Notes:
Services are extensions to the cloud environment that IBM Bluemix hosts and manages. The predefined services that are provided by IBM Bluemix include NoSQL and SQL databases, the ability to send push notifications to your mobile app, and automated language translation.
You can add services to your IBM Bluemix application from the IBM Bluemix catalog. Services provide a predefined endpoint that you can access from your application to use the predefined functionality of that service.
The infrastructure for services are managed by IBM Bluemix, and your app needs to focus on the provided endpoint only. You can bind more than one app to a service to share services between your apps.
Many IBM Bluemix services are available and more are being added. Figure 2-13 shows a sample of the services that are available for IBM Watson.
2.16 Creating an IBM Bluemix application (1 of 3)
Figure 2-14 Creating an IBM Bluemix application (1 of 3)
Notes:
From the catalog, you can choose one of the following options for the application type:
Boilerplates
Cloud Foundry Apps
Containers
OpenWhisk
Mobile
2.17 Creating an IBM Bluemix application (2 of 3)
Figure 2-15 Creating an IBM Bluemix application (2 of 3)
Notes:
Enter your application name, hostname, and select the pricing plan for this application.
2.18 IBM Bluemix app name must be unique across domain
Figure 2-16 IBM Bluemix application name must be unique across domain
Notes:
By default, IBM Bluemix hosts your application on the mybluemix.net domain. You do not share your memory and application instances with other IBM Bluemix accounts. You must choose a host name that is unique across all applications from all IBM Bluemix users. You cannot create an IBM Bluemix application with the same host name that is used by another application. The exercises in this course manage this issue by having each team use a randomly-generated key.
Your app’s name is different than its host name and must be unique only within your organization. You can have the same name as another user if you do not have the same host name as another user.
By default, IBM Bluemix sets your hostname and your app name to be the same. The app name is for your reference to use only in scripts, commands to the CLI, and to find your app within the IBM Bluemix UI. The application’s host name becomes part of the application’s route, which is how users access your app over the internet.
2.19 Creating an IBM Bluemix application (3 of 3)
Figure 2-17 Creating an IBM Bluemix application (3 of 3)
Notes:
Next, select your development style. You can perform the following tasks:
Download the Eclipse Tools for Bluemix, which allows you to use the Bluemix APIs from the Eclipse integrated development environment.
Edit your app in your preferred text editor and use the Cloud Foundry command line to deploy.
Use Bluemix DevOps Services to deploy your application with a completely web-based approach.
2.20 IBM Bluemix Dashboard
Figure 2-18 IBM Bluemix Dashboard
Notes:
IBM Bluemix Dashboard shows you the amount of memory that you are using in your organization and the number of services that you are using in your space.
If you find that your organization is running low on memory, you can stop an application without deleting it and start it again later when needed. However, if you are running out of available services, you must delete some services to free up space.
2.21 IBM Bluemix Application Details page
Figure 2-19 IBM Bluemix Application Details page
Notes:
To open the application details, click the application name in the IBM Bluemix Dashboard.
2.22 Testing applications through the application route
Figure 2-20 Testing applications through the application route
Notes:
The application route is the entry point for users into your application in IBM Bluemix. You can host a REST service, web application, or web page through this route.
To view the application route, click the Open URL icon. You can access the application route for a running application only. The application route must be unique across all applications in the domain.
2.23 Adding an IBM Bluemix service
Figure 2-21 Add an IBM Bluemix service
Notes:
You can add an IBM Bluemix service to your application by clicking Create Service and then, selecting a service from the IBM Bluemix Catalog. You must then enter a name for the service and select a pricing plan for your service. Plans allow you to choose different “sizes” for the service, such as how much power you put behind it. For example, with some services you can choose if you share hardware or use dedicated hardware.
You can bind the service to your application from this page, or leave the service unbound. If you leave the service unbound, IBM Bluemix creates and provides credentials for accessing the service, which you can access from within the service dashboard. If you bind the service to an application, the credentials are in the application’s environment variables.
2.24 Binding a service to an application
Figure 2-22 Bind a service to an application
Notes:
To bind the service to your application, go to your application details page and select Connect new or Connect existing:
By using the Connect new option, you can create an instance of the service from the Bluemix Catalog, then bind it.
The Connect Existing option allows you to choose one of the services that was created earlier to bind it to your application. IBM Bluemix lists the services that you created in your space that are compatible with your service and runtime environment. Some services are specific to certain runtimes, such as a Java Runtime monitor, and might not be applicable or indeed usable from your application.
When you bind a service to an application, IBM Bluemix creates a set of credentials to access the service and places the connection information for this service in the application environment variable, which is called VCAP_SERVICES.
2.25 IBM Bluemix environment variables
Figure 2-23 IBM Bluemix environment variables
Notes:
Environment variables contain the environment information of a deployed application on IBM Bluemix, which automatically populates the environment variable VCAP_SERVICES with the services that you bound to your IBM Bluemix application.
With the User Defined environment variables, you can set configuration settings without hard-coding the values in your application. For example, you can save the web service endpoint, user name, and password for a cloud-based database as a “user-defined” environment variable.
You can access the Environment Variables of the application from the Application Details page by clicking Runtime in the left navigation bar.
2.26 IBM Bluemix organizations and users (team members)
Figure 2-24 IBM Bluemix organizations and users (team members)
Notes:
Organizations, users, and spaces are the building blocks for organizing resources in the IBM Bluemix environment. The organization is the main organizational unit for IBM Bluemix.
Organizations are defined by the following items:
Users or team members
Domains
Quota
In IBM Bluemix, you can use organizations to enable collaboration among team members and to facilitate the logical grouping of project resources.
A user or team member has a role with basic permissions in organizations and spaces. All users must belong to at least one organization. Users can belong to more than one organization, which is how you can share control over applications and service instances.
2.27 IBM Bluemix domains and quota
Figure 2-25 IBM Bluemix domains and quota
Notes:
Domains provide the route on the internet that is allocated to the organization. Consider the following points:
A route has a sub-domain and a domain.
A sub-domain is the hostname, which is typically the application name.
A domain might be a system domain or a custom domain that you registered for your application.
The default domain name is mybluemix.net.
The domain and the route determine how users interact with your IBM Bluemix applications over the network.
Quota represents the resource limits for the organization, including the number of services and the amount of memory that can be allocated for use by the organization. Consider the following points:
Quotas are assigned when organizations are created.
Any application or service in a space of the organization contributes to the use of the quota.
With the Pay-As-You-Go or subscription plans, you can adjust your quota for Cloud Foundry applications and containers as the needs of your organization change.
2.28 IBM Bluemix organizations: Spaces
Figure 2-26 IBM Bluemix organizations: Spaces
Notes:
Spaces in IBM Bluemix are the next level down from organizations. Consider the following points:
A space is a mechanism to group a set of applications, services, and team members within an organization.
An organization can have multiple spaces, but these spaces must have unique names within an organization.
Two organizations can have their own spaces with the same name, but two organizations cannot share the same space.
You must belong to an organization to belong to one of its spaces.
You must be a developer in the space in which an application or service exists to interact with that application or service as a IBM Bluemix user.
IBM Bluemix users typically use spaces to delineate different types of deployment environments, such as development, testing, staging and production.
2.29 IBM Bluemix organizations: User roles
Figure 2-27 IBM Bluemix organizations: User roles
Notes:
Users have the following roles in spaces and organizations:
The organization manager controls who has access to the organization.
The billing manager can view usage information for the organization.
The auditor can view application and service content in the organization.
Space manager can control who has access to the space.
Space developer can create, delete, and manage apps and services within the space.
Space auditors have read only access to settings, logs, apps, and services.
2.30 Managing IBM Bluemix organizations
Figure 2-28 Managing IBM Bluemix organizations
Notes:
Organization mangers control who has which type of access to the organization (Manager, Billing Manager, or Auditor).
The organization’s managers can invite users to the organization and assign them the various roles.
2.31 Inviting users to an organization
Figure 2-29 Inviting users to an organization
Notes:
The organization’s managers can invite users to their organization by clicking Manage in the top toolbar and then, clicking Account  Users  Invite users.
2.32 Unit summary
Figure 2-30 Unit summary
 
2.33 Checkpoint questions
Figure 2-31 Checkpoint questions
 
2.34 Checkpoint answers
Figure 2-32 Checkpoint answers
 
 
 
 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.71.21