Select Page

Last week I posted about having OBIEE running in Docker. It works fine and easy to do but the database wasn’t included, so it was up to you to provide one (could be one already running somewhere on your LAN, a new VM or also a docker container as well). Not a real problem in the end as we are used to have to setup one when doing an OBIEE install, but still not the great automation we can get when user Docker.

Well, guess what? Here is the solution !

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application’s services. Then, using a single command, you create and start all the services from your configuration.
Docker Compose documentation

Thanks to Docker Compose it’s possible to define the “OBIEE application” as being a two container setup: one for the database, one for the OBIEE. Compose will take care of the dependencies (most of them at least), so when starting OBIEE it will start the database container first and when it’s running it will then start the OBIEE container.

Let’s see directly how it works…

First you need to make sure you have Docker and Docker Compose, actually Compose is just a file to download and make it executable (the documentation cover all the steps).

Download the required files

You can find the OBIEE Docker Compose files on my GitHub: https://github.com/gianniceresa/docker-images/tree/master/Compose%20OBIEE-DB
Like with the OBIEE docker image it’s up to you to download the Oracle Database binaries (12.1.0.2) and OBIEE binaries (12.2.1.0.0 or 12.2.1.1.0 + Oracle JDK) and to accept and review the various licensing agreements when doing the download. When done you simply copy the binaries into the folders of the components versions.

Deploy the full OBIEE setup in 1 command

When you have all the files in place it’s time the magic happen …

Get a coffee and look all the hard work Docker Compose is doing…

Actually you don’t see a lot because of the ” -d ” flag running the container in the background.

The first time you run this command Docker Compose try to find the docker images in your system, if you never run it before there is no such images available and so the system build them automatically. That’s the output you are going to see.

If Compose can't find an existing image it will automatically build it.

If Compose can’t find an existing image it will automatically build it.

This part is going to take some time, around 10 minutes for the database and 15 for OBIEE, but it’s done only once (you can force it if you change something in the Dockerfile building the images with the ” –build ” parameter).

Compose tell you why it had to build the image and how to force a rebuild if needed.

Compose tell you why it had to build the image and how to force a rebuild if needed.

Once the building process is over Docker Compose is going to actually start your containers.

When the build process is done the containers are started.

When the build process is done the containers are started.

Container’s logs

At this point you don’t see anything anymore: how to know what’s going on?

Using this two commands in different windows / sessions tell you what the containers are doing.

At the first execution of the database container the system must setup the database before to make it available.

At the first execution of the database container the system must setup the database before to make it available.

Once the DB is ready to accept connection the "DATABASE IS READY TO USE!" message is visible in the logs.

Once the DB is ready to accept connection the “DATABASE IS READY TO USE!” message is visible in the logs.

OBIEE can't be started or configured without a working database connection. This script does the check and wait for 5 seconds if the test end with an error.

OBIEE can’t be started or configured without a working database connection. This script does the check and wait for 5 seconds if the test end with an error.

Wait a second? What’s that message with a “ORA-12514, TNS:listener does not currently know of service request in connect descriptor” error in the OBIEE container?
This isn’t really part of OBIEE, it’s a little java code performing a check if it can connect to the database or not.

An Oracle Database doesn’t start in 1 second, mainly at the first execution of the container when the database is created. In the meantime OBIEE must wait or it will fail with an error, so there is a script in the container performing exactly that. It try to connect to the database (using the JDBC driver provided by OBIEE), if connection fails it waits 5 seconds and try again (infinite loop), if the connection is successful it execute the normal script managing OBIEE.

The OBIEE container is able to connect to the database, so time to run the configure or start script.

The OBIEE container is able to connect to the database, so time to run the configure or start script.

The log output tell you when OBIEE is fully started.

The log output tell you when OBIEE is fully started.

Docker Compose did his job, now it’s up to you to enjoy your fully configured and working OBIEE environment!

Stop the running containers

To stop the containers again is a unique command, Docker Compose will take care of everything else.

The ” -t 120 ” parameter is to give OBIEE and the database the time to perform a clean shutdown, by default Docker Compose gives them 10 seconds before to fill the containers, it’s a bit optimistic for this kind of tools, so let’s do things in a clean way.

Start the containers again

Next time you want to start these containers again just use the same command you used at the beginning:

The “up” command in Docker Compose actually check if containers exists: if they are there it starts the container obiee_12.2.1.1.0 and the dependencies (the oracledb container). If the containers doesn’t exist it create them, if the images for the containers don’t exist it builds them first.

As you see it takes 1 single command to have a fully working OBIEE setup!

You can find all the code needed on https://github.com/gianniceresa/docker-images/tree/master/Compose%20OBIEE-DB , the binaries you must download them from Oracle directly accepting the various licensing agreements.

 

Share This