Generation of VM image for Oracle Event Processor and Stream Explorer using Vagrant and Puppet

0
Share this on .. Tweet about this on TwitterShare on LinkedIn6Share on Facebook0Share on Google+0Email this to someoneShare on Tumblr0Buffer this page

In this article, I will introduce a set of Vagrant and Puppet configuration files that automate the creation of a Linux Virtual Box VM with Oracle Event Processor and Stream Explorer installed in it. The installation process that is automated in this article is described in all its manual glory in my earlier article: Oracle StreamExplorer and Oracle Event Processor – installation instructions to quickly get going, that describes which files to download, which Linux command lines steps to go through and which wizards to run. The article you are reading is also a sequel to my article Quickly produce a Linux 64 bit Ubuntu 14.04 Desktop environment using Vagrant and Puppet – as starting point for Oracle installations that describes how Vagrant and Puppet can be used to generate VM images that provide a good foundation for installing [Oracle] software on.

The sources for the current article are located in a GitHub Repository: vagrant-ubuntu1404-puppet-oracle-oep-and-sx.

The steps you need to go through in order to prepare for the completely automated generation of the VM images for OEP and Stream Explorer are:

  • Install Vagrant and Virtual Box
  • Clone Git repository from GitHub
  • Download software package for OEP and Stream Explorer as well as a JDK
  • Run Vagrant (that in turn will run the Puppet provider to perform all installation tasks)
  • Restart VM and start OEP domain

Using the approach and the Git repository introduced in this article, the creation of a VM for OEP/StreamExplorer 12c becomes a breeze!

Install Vagrant and Virtual Box

To get going, you need to first install Vagrant and Oracle Virtual Box, as discussed in many places including my article: https://technology.amis.nl/2014/07/29/fastest-way-to-a-virtual-machine-with-jdeveloper-12-1-3-and-oracle-database-xe-11gr2-on-ubuntu-linux-64-bit/.

Clone Git repository from GitHub

Then clone the GitHub repository –  https://github.com/lucasjellema/vagrant-ubuntu1404-puppet-oracle-oep-and-sx – to your local machine or simply download the repository as zip-file and expand the file in a local directory. I am assuming a Windows Host, but the steps are almost the same for Linux, MacOS or other hosts.

Download software packages for OEP and Stream Explorer as well as a JDK

The download for the OEP and Stream Explorer software is described in this article: https://technology.amis.nl/2015/08/09/oracle-streamexplorer-and-oracle-event-processor-installation-instructions-to-quickly-get-going/. Move the downloaded files to the files directory under the vagrant project home.

Downloading the JDK is described in this article: https://technology.amis.nl/2015/08/09/quickly-produce-a-linux-64-bit-ubuntu-14-04-desktop-environment-using-vagrant-and-puppet-as-starting-point-for-oracle-installations/. Move the downloaded files also to the files directory under the vagrant project home.

The contents of the file directory should look like this:

image

Some of these files – such as oraInst.loc and oep_install_responsefile and the directory user_projects were cloned with the Git repository. These were created during the manual installation of OEP and SX and subsequently saved for reuse in the automated installation process.

 

Run Vagrant (that in turn will run the Puppet provider to perform all installation tasks)

Go to the directory into which you cloned the Git repository – the directory that contains the Vagrantfile. You may want to edit this file – change the name of the VM perhaps or change the folder mappings.

When done, you can run vagrant and have the Virtual Box VM created:

vagrant up

image

That is all it takes. Leave the vagrant process alone for some time – up to 30 minutes depending on internet download speed – and when you come back, the VM will be baked for you.

SNAGHTML1db9c96

Explaining what is happening (a little)

Compared to the puppet manifest base.pp used to create a fairly basic Ubuntu 14.04 machine in https://technology.amis.nl/2015/08/09/quickly-produce-a-linux-64-bit-ubuntu-14-04-desktop-environment-using-vagrant-and-puppet-as-starting-point-for-oracle-installations/ I have added class oep_installation  and class sx_installation. These use the new modules oep and opatch. Note: module opatch is created by Edwin Biemond (https://github.com/biemond/puppet/blob/master/modules/wls/manifests/opatch.pp) and reused here. Note that module opatch defines its own function opatch using resources in the lib subdirectory.image

class oep_installation first uses resources oep::install to run the Oracle Universal Installer in silent mode, feeding it the response file that was saved in an earlier manual installation (as described here ).

image

It then uses oep::domain to create domain sx_domain – basically by copying the files that we collected when this domain was manually created in an environment with exactly the same setup.

image

 

class sx_installation uses the opatch module to install Stream Explorer which is distributed as an Oracle Path with Id 20636710 in a zip-file called ofm_sx_generic_12.1.3.0.1_disk1_2of2.zip. opatch::apply can be used for the installation of any OPatch,=

 

Note: far too much specific details are in the configuration definitions, which is not the correct way in Puppet. I should read settings – using the Hiera mechanism – from a YAML or JSON file. I have not yet gotten round to adding that for this module. Use my declarations perhaps for inspiration, but certainly not as a reference!

image

Restart VM and start OEP domain

Stop the VM using vagrant halt. Then start the VM again using vagrant up.

image

This means we can login to the desktop. Login as user oracle (display name developer) with password oracle:

image

Open a terminal:

image

The OEP Domain is started using the script: /u01/app/oracle/OEP_Home/user_projects/domains/sx_domain/defaultserver/startwlevs.sh

image

 

 

When started, the Stream Explorer can be accessed in the browser at http://localhost:9002/sx :

image

.

.

Bonus: Install JDeveloper

Not yet automated is the installation of JDeveloper – the IDE for OEP. You may want to follow the instructions for manual installation of JDeveloper as provided in this article: https://technology.amis.nl/2015/08/09/oracle-streamexplorer-and-oracle-event-processor-installation-instructions-to-quickly-get-going/ .

 

Resources

Important resources for this article were – as always when talking about Vagrant or Puppet – the articles and sources from Edwin Biemond. I have heavily leaned on his Puppet modules: https://github.com/biemond/puppet/tree/master/modules.

Very useful was Guido Schmutz’s article on automating the installation of OEP and SX on Docker containers (https://guidoschmutz.wordpress.com/2015/03/29/installing-oracle-stream-explorer-in-a-docker-image/) – something I want to investigate as well, using Puppet as the configurator for the container – rather than the Docker file all by itself.

I have also used many articles and documents on Puppet (and Vagrant) as it is so easy to make mistakes. Some relevant documents:

Share this on .. Tweet about this on TwitterShare on LinkedIn6Share on Facebook0Share on Google+0Email this to someoneShare on Tumblr0Buffer this page

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press books: Oracle SOA Suite 11g Handbook and Oracle SOA Suite 12c Handbook. Frequent presenter on community events and conferences such as JavaOne, Oracle Code and Oracle OpenWorld.

Leave a Reply