14
Building a Sample DevOps Environment on Oracle Cloud Infrastructure Ravello Service ORACLE WHITE PAPER | MAY 2018

Building a Sample DevOps Environment on Oracle Cloud ... · 3 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE Introduction Enterprise customers

Embed Size (px)

Citation preview

Building a Sample DevOps Environment on Oracle Cloud Infrastructure Ravello Service O R A C L E W H I T E P A P E R | M A Y 2 0 1 8

2 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Table of Contents

Introduction 3

Oracle Cloud Infrastructure Ravello Service 3

DevOps Overview 3

DevOps Components 4

Pipeline 4

Automation 5

DevOps Example on Ravello 5

Why Run DevOps on Ravello? 6

Building a Sample DevOps Environment on Ravello 7

Choose DevOps Tools 7

Set Up the Environment 7

Make a Blueprint of the Deployment Server 8

Build and Launch a New Environment from a Blueprint 9

Access the Application After Deployment 12

Summary 12

Learn more 13

3 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Introduction

Enterprise customers move to the cloud for many reasons: to improve operational efficiency,

optimize resource use, and reduce costs, just to name a few. Enterprise customers, as well as

independent software vendors (ISVs), are also challenged to fulfill the on-demand nature of

hardware infrastructure requirements, and IT managers are challenged to manage and maintain

numerous hardware infrastructure configurations. This white paper describes the benefits of

building a sample DevOps environment on Oracle Cloud Infrastructure Ravello Service. It also

describes how quickly an enterprise customer or ISV can build a number of DevOps deployment

environments by using the Ravello REST API.

Oracle Cloud Infrastructure Ravello Service

Oracle Cloud Infrastructure Ravello Service (Ravello) is an overlay cloud service that enables

enterprises to run their VMware and KVM applications with data-center-like (Layer 2) networking

“as-is” on public clouds without making any modifications. Because enterprises don’t need to

convert their VMs or change their networking, they can rapidly develop and deploy existing data-

center applications on the public cloud without the associated infrastructure and migration costs or

the overhead for a variety of use cases such as proofs of concept, development, testing, staging,

user acceptance testing, production, and training.

DevOps Overview

DevOps is a software engineering practice that unifies the functions of software development and

operations. DevOps advocates for automation and monitoring at every stage of building software,

from integration, to testing, deployment, and managing infrastructure. The concept of DevOps is

founded on building a culture of collaboration between teams that have historically functioned in

relative siloes. The promised benefits of this collaboration include increased trust, faster software

releases, the ability to solve critical issues quickly, better management of unplanned work, and

alignment with business objectives.

4 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Figure 1: DevOps

DevOps Components

DevOps has many components, but the two most relevant to the subject of this paper are the

delivery pipeline and automation. The section that follows this one provides an example of how

these components are used in the DevOps process on Ravello.

Pipeline

The delivery pipeline is the process that defines the flow of work, starting with pushing new code to

source control and ending publishing that in production. The following steps outline a pipeline

process that encompasses three deployment environments:

1. A developer pushes code to source control (for example, a GitHub repository).

2. An automated build compiles the code and runs tests.

3. An artifact with a unique version number is created and published it to a repository.

4. The artifact is deployed to the development environment, according to a defined

schedule.

5. The artifact that was deployed to the development environment is deployed to the test

environment, according to a defined schedule.

6. The artifact that was deployed to the system integration environment is deployed to the

production environment, according to a defined schedule.

DEV QA/UAT OPS

Ø BUILD

Ø UNITTESTØ DEVELOPMENT

Ø DEPLOY

Ø FUNCTIONALTESTØ PERFORMANCETEST

Ø DEPLOY

Ø STAGINGØ PRODUCTION

BUILD DEV/TEST SYSTEM UAT SIGNOFF STAGING PROD

5 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Automation

A key aspect of the delivery pipeline is automation. Except for the first step of the process, the

steps in the delivery pipeline are automatically triggered and executed. Following are some

requirements for automation:

• Store source code in a version control system like Git/GitHub.

• Assign new artifacts unique version numbers.

• Employ automatic triggers and scheduling by using a continuous integration server, such

as Jenkins.

• Automate code compilation and unit testing by using a build tool, such as Maven.

• Schedule the deployment of artifacts to each necessary environment. Most build

systems, such as Jenkins, support setting a cron schedule.

• Treat the database scripts like source code and store them in version control. Automate

the execution of the database scripts as part of the deployment process.

DevOps Example on Ravello

Figure 2: A Sample DevOps Architecture on Ravello

Figure 2 illustrates the following steps as an example of the DevOps process on Ravello:

1. Developers write code using their local computer or laptop with the help of Eclipse.

2. Developers commit the code to the GitHub central cloud repository.

3. A Jenkins server running on Ravello initiates the build.

Commit AppServer

CreateEnvironment

CentralRepository(GitHub,Git)

JenkinMaster

DeployCode RunTests ShutdownEnvironment

TriggerJob

MavenServer

Ravello

6 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

4. During the build process, the updated code is initially copied to the Jenkins server from

the GitHub repository.

5. The build process copies the updated code from the Jenkins server to the Maven server.

6. The Maven server builds the code and runs the unit tests to validate the code.

7. After the build is successful, the Maven server packages the build and copies the

packaged build to the Jenkins server.

8. The Jenkins server initiates the deployment process and deploys the build in the

application server with the help of Apache Tomcat.

9. The end-user/QA/UAT team validates the latest build before pushing it to production.

By using the Ravello REST API or Python SDK, you can automate the process of building an

additional deployment environment that is a copy of the primary deployment environment. You can

publish the new deployment environment to the nearest cloud region of the end-user/QA/UAT

team to feel like a local user experience. You can also deploy the latest build and run the QA/UAT

testing. You can also use the Ravello REST API or Python SDK to automate the shutdown of the

environment that is running in the Ravello cloud after the QA/UAT team finishes their job.

Why Run DevOps on Ravello?

More commits are usually done closer to the end of a development cycle or sprint, or right before a

product release. Typically, there is a huge demand for test resources to meet the product release

timeline, but on-premises data centers do not have the necessary capacity to meet those peaked

demands. Not having these resources leads to releases slipping or poor software quality.

ISVs find it challenging to fulfill the on-demand requirement for resources that are essentially

needed for short periods. IT managers also find it challenging to manage different versions of the

environment, like production and a developer’s version, each of which require a different

specifically configured set of servers.

Ravello, with its infinite resources, enables ISVs to start the full setup quickly, use the

environment, and shut down when done. And unlike most public clouds, Ravello offers data-

center-like capabilities such as the ability to run VMware VMs and layer 2 networking, which

enables you to fulfill the on-demand nature of resources, is easy to deploy, scales as you grow,

and reduces total cost of ownership (TCO).

By using the Ravello UI portal or just a few REST API calls, you can replicate your existing

environment running on Ravello, and then publish and run the replicated environment on any

7 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

cloud region. The new replicated environment has the same VM configuration, the same network

(IP addresses, DNS names, and so on), and the same storage as your production environment,

and appliances work exactly as if they were on your private data center.

Building a Sample DevOps Environment on Ravello

This section describes the tools and steps for building a sample DevOps environment on Ravello.

Choose DevOps Tools

Several DevOps tools are available today for building a DevOps environment. ISVs need to

choose the appropriate tools, depending on the type of pipeline and the programming language

used to develop the code, before building the DevOps environment.

For this exercise, we chose Jenkins, Apache Maven, and Apache Tomcat to build the DevOps

environment on Ravello. We also use Eclipse for writing the code and GitHub as a central code

repository.

• Jenkins is an open-source automation server that supports practically every tool as part

of your delivery pipelines. Jenkins can help to automate continuous integration and

continuous delivery.

• Maven is a powerful project-management tool that is based on a project object model

(POM). It is used for project build, dependency, and documentation. It simplifies the build

process like Apache Ant does, but it is more advanced than Ant.

• Tomcat is an open-source implementation of the Java Servlet, JavaServer Pages, Java

Expression Language, and Java WebSocket technologies. The specifications for these

technologies are developed under the Java Community Process.

• GitHub is a web-based version control system that uses Git. In addition to providing the

distributed version control and source code management functionality of Git, it also provides

access control, bug tracking, feature requests, and task management.

• Eclipse is a Java integrated development environment (IDE) that includes a CVS client,

a Git client, an XML editor, Mylyn, Maven integration, and WindowBuilder.

Set Up the Environment

Our sample DevOps environment has three VMs created on Ravello and installed with the Oracle

Linux operating system. One VM is running Jenkins and is configured as an automation server,

another VM is running Maven and is configured as a build server, and the other VM is running

Tomcat and is configured as a deployment server.

8 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

All three VMs are connected using a Ravello-provided L2 network on a public cloud. The Jenkins

VM is configured with external access and is connected to internet.

Figure 3: DevOps Deployment on Ravello

Make a Blueprint of the Deployment Server

To create multiple environments for the deployment server, you make a blueprint of the

deployment/application server and store it in a Ravello library. Using a saved blueprint, you can

launch multiple isolated environments in the cloud for additional testing of applications, and you

can publish these new applications to the nearest cloud region.

Figure 4: Deployment Server Blueprint in Ravello Library

9 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Build and Launch a New Environment from a Blueprint

You can use the Ravello REST API to create an application from a saved blueprint and publish the

application in a different cloud region. You can also use the Ravello REST API to start and stop

the application whenever needed.

In this section, we create a Python script that uses the Ravello REST API to build the additional

deployment environment with the saved blueprint. The script also integrates the Ravello API to

start and stop the newly built application.

To automate launching the additional application server environment for continuous deployment,

we use customized Python scripts that use the Ravello REST API, and we use that script for post-

build actions after the successful build.

1. On the Jenkins server console, click Configure.

Figure 5: Jenkins Configuration

10 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

2. Click the Post Steps tab and copy the successful build from the Maven server to the

Jenkins server.

Figure 6: Post-Build Actions

3. Create a script that creates an additional deployment environment, copies the latest build

to the new deployment environment, and starts the application. Following is a sample

script:

Figure 7: A Sample Script to Create a New Environment

11 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

4. Include the script on the Post Steps tab to create the new application server environment

and deploy the latest build from the Jenkins server to the new application server.

Figure 8: Post-Build Steps Creating a New Environment

5. After you populate the Post Steps tab with the appropriate script, save the configuration

and run the build. This process runs the build, creates the new application server

environment, and deploys the build in the new application server environment.

Figure 9: Run the Build

12 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Access the Application After Deployment

After the successful build, you can access the application from the newly built application server.

To access the application, open a web browser and type the local IP address of the application

server with port number 8080. After you log in to the Tomcat server, the application is visible.

Figure 10: Access Application from Newly Built Deployment Server

Although we used the script to build just one additional app server, it can be customized to build

any number of additional application servers by using the Ravello Python script.

Summary

With the help of a Ravello blueprint, enterprise customers and ISVs can quickly build an additional

deployment environment that is the same as the primary deployment environment and publish the

new deployment environment in any cloud region. By using the Ravello REST API and integrating

it with the Jenkins server configuration, the entire process can automated.

The Oracle Cloud Infrastructure Ravello Service also helps enterprise customers and ISVs to

reduce their infrastructure cost, increase agility, increase operational efficiency, and optimize

resource use. Enterprise customers and ISVs pay only for the amount of time that they use the

DevOps environment. This also helps them fulfill their on-demand requirement of the resources.

13 | BUILDING A SAMPLE DEVOPS ENVIRONMENT ON ORACLE CLOUD INFRASTRUCTURE RAVELLO SERVICE

Learn more

If you are interested in building your own DevOps environment on Ravello, sign up for a free trial at

https://cloud.oracle.com/ravello.

Figure 11: Sign Up for a Free Trial

Oracle Corporation, World Headquarters Worldwide Inquiries

500 Oracle Parkway Phone: +1.650.506.7000

Redwood Shores, CA 94065, USA Fax: +1.650.506.7200

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0518 Building a Sample DevOps Environment on Oracle Cloud Infrastructure Ravello Service May 2018 Author: Niranjan Mohapatra

C O N N E C T W I T H U S

blogs.oracle.com/oracle

facebook.com/oracle

twitter.com/oracle

oracle.com