Docker & Essbase Session ID - OATUG

56
Session ID: Prepared by: Remember to complete your evaluation for this session within the app! 10928 Docker & Essbase Bring the Cloud To You Jason Jones Senior Solutions Architect Applied OLAP

Transcript of Docker & Essbase Session ID - OATUG

Page 1: Docker & Essbase Session ID - OATUG

Session ID:

Prepared by:

Remember to complete your evaluation for this session within the app!

10928Docker & Essbase

Bring the Cloud To YouJason JonesSenior Solutions ArchitectApplied OLAP

Page 2: Docker & Essbase Session ID - OATUG

About the Speaker

• Essbase/Hyperion• Java• Drillbridge• Oracle ACE• Applied OLAP• Blogging

Page 3: Docker & Essbase Session ID - OATUG

Agenda/Goals

• Introduce Docker• Docker Concepts• View simple Docker example• Apply Docker to Essbase• Q & A• Back of this slide deck contains brief overview of Essbase Dockerfile usage

Page 4: Docker & Essbase Session ID - OATUG

What is Docker?

• Containerization technology• Think of a container as a portable VM for a single application• Build up a machine image based on layers• Thinner than a VM

Page 5: Docker & Essbase Session ID - OATUG

Traditional Web App Installation

• Consider an application such as Dodeca that has:– database (MySQL)– web server (Apache Tomcat)– servlet files (dodeca.war)– requires Java

• Sequence:– Install/verify Java– Install Tomcat– Setup database schema– Deploy WAR– Misc (open ports, config files, etc.)

Page 6: Docker & Essbase Session ID - OATUG

Containerized Web Application

• Just pull/run the Dodeca image that was built from a Dockerfile• Additional config:

– Map ports such as 80 -> 8080– Set environment variables/parameters

• Integrate the Docker image build process into continuous integration• Don’t need to worry about installing prerequisites

Page 7: Docker & Essbase Session ID - OATUG

Virtual Machine vs. Docker Containers

Page 8: Docker & Essbase Session ID - OATUG

Docker Container vs. Virtual Machine

• Layered filesystem vs. monolithic• Inherit from parent containers, e.g.:

– Linux base OS• Install Java

– Copy program files

• VM– Needs full OS– Consumes more space (OS files, etc.)– Startup time

Page 9: Docker & Essbase Session ID - OATUG

Getting Started with Docker

• Downloads available for Linux, Mac, Windows• Runs natively on Linux• Mac/Windows will use a very small Linux VM (VirtualBox)

Page 10: Docker & Essbase Session ID - OATUG

Docker “Hello World” Example

• Assume with me, for a moment, that the following is true:– There are various organizations that have publicly available Docker images– These images are located in a central, public repository– The Docker software/client is installed on my local machine

• Let’s run a Docker test/”Hello World” image that is simply a web server that shows a single web page

• This will result in my machine running a fully configured webserver• NGINX

– Web server– Has publicly available Docker images

Page 11: Docker & Essbase Session ID - OATUG

Run It

docker run -p 8000:80 -d nginxdemos/hello

Program Command Map host port to container port

Detached Image

Page 12: Docker & Essbase Session ID - OATUG

Docker Web Server Example

Jasons-MBP:jasonwjones$ docker run –p 8000:80 -d nginxdemos/helloUnable to find image 'nginxdemos/hello:latest' locallylatest: Pulling from nginxdemos/hello550fe1bea624: Pull completed421ba34525b: Pull completefdcbcb327323: Pull completebfbcec2fc4d5: Pull complete0497d4d5654f: Pull completef9518aaa159c: Pull completea70e975849d8: Pull completeDigest: sha256:f5a0b2a5fe9af497c4a7c186ef6412bb91ff19d39d6ac24a4997eaed2b0bb334Status: Downloaded newer image for nginxdemos/hello:latest1bfa522e41617570f7ed0c1648075818ac6383e671c00bfc14297ef2ca3845aaJasons-MBP:jasonwjones$

File system layers being pulled/cached

Page 13: Docker & Essbase Session ID - OATUG

A Simple Docker Web Server Running

Page 14: Docker & Essbase Session ID - OATUG

What just happened?

• Components (files) of the docker image were not in cache and were pulled from a global repository

• A running container was created from the image• On Mac/Windows, the container is running in a tiny Linux VM (would be running

natively on Linux)• The container contains all programs/data necessary to run• The host port 8000 was mapped to the container’s port 80 • Accessed via our web browser

Page 15: Docker & Essbase Session ID - OATUG

The Dockerfile

• Contains a recipe for building a Docker image• Relatively few types of commands• Builds the image based on an exact sequence of commands and files• Generally is in software version control

– Can refine over time and make improvements

Page 16: Docker & Essbase Session ID - OATUG

Dockerfile Commands

• FROM• RUN• CMD• LABEL• ADD/COPY• ENTRYPOINT• USER• WORKDIR• ARG

• VOLUME• ARG• ONBUILD• STOPSIGNAL• HEALTHCHECK• SHELL• MAINTAINER

Page 17: Docker & Essbase Session ID - OATUG

Source Code

Page 18: Docker & Essbase Session ID - OATUG

Mainline

Page 19: Docker & Essbase Session ID - OATUG

Notes

• Alpine Linux often used• Install packages via command-line

Page 20: Docker & Essbase Session ID - OATUG

Docker & Essbase

Page 21: Docker & Essbase Session ID - OATUG

Stand up an Essbase Server in minutes

• Exactly the same every single time• Clean slate• Do anything you want• Throw it away when done (or keep it, whatever)

Page 22: Docker & Essbase Session ID - OATUG

Cattle, not pets.

Page 23: Docker & Essbase Session ID - OATUG

Containerizing Essbase

• Essbase 11.1.2.4 on Linux• Oracle relational backend• Support development/testing• Not for production

Page 24: Docker & Essbase Session ID - OATUG

Not. For. Production.

• Really.

Page 25: Docker & Essbase Session ID - OATUG

About the Image

• Based on CentOS 6.9• Note on Linux flavors:

– Red Hat Enterprise Linux (RHEL)– CentOS– Oracle Enterprise Linux (OEL)

• 5-10 minute bootup– Can probably shrink this down a good bit (DB2?)– Oracle backend

• “Fat image” (db + Essbase combined)• Simple stub/launcher page

Page 26: Docker & Essbase Session ID - OATUG

Use Cases (Bringing the Cloud)

• Testing/development– Dodeca– Drillbridge– Getting an Essbase server up and running very quickly for any purpose

• Programming– Java API

• Experimental automation• Test an idea without fear

Page 27: Docker & Essbase Session ID - OATUG

Files

DockerfileEssbase-11124-linux64.zipFoundation-11124-linux64-Part1.zipFoundation-11124-linux64-Part2.zipFoundation-11124-linux64-Part4.zipFoundation-11124-Part3.ziplinuxamd64_12102_database_se2_1of2.ziplinuxamd64_12102_database_se2_2of2.zipdocker-essbase-startup.shload-sample-databases.mshREADME.mdsilentInstall.xmlsite/

Page 28: Docker & Essbase Session ID - OATUG

Building the Image

docker build -t essbase .

Page 29: Docker & Essbase Session ID - OATUG

Example Run Command (using already built image)

• docker run -d --rm --name essbase -p 9000:9000 -p 80:8080 --add-host epmvirt:127.0.0.1 essbase

• Options– -d – run detached– --rm – delete after running– --name – give container specific name– -p 9000:9000 – map host port 9000 to container port 9000 (compact Essbase deployment

port)– -p 80:8080 – map host web port 80 to container port 8080 (running a convenience web

page with links)– --add-host epmvirt:127.0.0.1 – add a host entry (required by current configuration)

Page 30: Docker & Essbase Session ID - OATUG

Simple Jump Page

Page 31: Docker & Essbase Session ID - OATUG

Launch EAS via JNLP

Page 32: Docker & Essbase Session ID - OATUG

Convenience EAS Launcher

#!/bin/bash

javawshttp://dockertest.corp.appliedolap.com:9000/easconsole/easconsole.jnlp

(above as all one line)

Page 33: Docker & Essbase Session ID - OATUG

EAS – Add EssbaseCluster-1

Page 34: Docker & Essbase Session ID - OATUG

Smart View Connection

Page 35: Docker & Essbase Session ID - OATUG

Future Improvements

• DB2 backend – DB2 has a very nice, fast, compact Docker image• Multi-stage build – save space on final image• Preload Sample/Basic with data• MaxL on PATH• Note on Compose/Swarm/Kubernetes• Oracle & Docker

Page 36: Docker & Essbase Session ID - OATUG

How You Can Use This

• Please contact me directly for now – Dockerfile + related scripts• I am researching the feasibility of releasing this as an open-source project

Page 37: Docker & Essbase Session ID - OATUG

Thanks!

• Q & A• Blog: https://www.jasonwjones.com• Sample Essbase Dockerfile at end of this presentation• Email me for the files you need

Page 38: Docker & Essbase Session ID - OATUG

Essbase Dockerfile

Page 39: Docker & Essbase Session ID - OATUG

Prerequisites

• Docker installed• Essbase ZIP files in folder• Oracle RDBMS files in folder• Then run docker build command, e.g.:

– docker build -t essbase .

Page 40: Docker & Essbase Session ID - OATUG

Files

DockerfileEssbase-11124-linux64.zipFoundation-11124-linux64-Part1.zipFoundation-11124-linux64-Part2.zipFoundation-11124-linux64-Part4.zipFoundation-11124-Part3.ziplinuxamd64_12102_database_se2_1of2.ziplinuxamd64_12102_database_se2_2of2.zipdocker-essbase-startup.shload-sample-databases.mshREADME.mdsilentInstall.xmlsite/

Page 41: Docker & Essbase Session ID - OATUG

Make Sure Host (Linux) Has Enough Swap

dd if=/dev/zero of=/swapfile bs=1024 count=1024k && \chmod 0600 /swapfile && \chown root:root /swapfile && \mkswap /swapfile && \swapon /swapfile && \swapon -s

Page 42: Docker & Essbase Session ID - OATUG

Dockerfile – Beginning

FROM centos:6.9

LABEL maintainer="[email protected]"

RUN touch /var/lib/rpm/* && yum -y install zip \emacs \unzip \xauth \xdpyinfo \compat-libcap1 \libstdc++-devel \sysstat \gcc \gcc-c++ \

Page 43: Docker & Essbase Session ID - OATUG

Base, Cont’d

ksh \libaio \libaio-devel \lsof \numactl \glibc-devel \glibc-devel.i686 \libgcc \libgcc.i686 \compat-libstdc++-33 \compat-libstdc++-33.i686 \openssh-clients

Page 44: Docker & Essbase Session ID - OATUG

Add/Extract Oracle RDBMS

ENV DOWNLOAD_HOME /u0/install/downloadsENV ORACLE_INSTALL_STAGING_HOME /u0/install/oracle_db

COPY linuxamd64_12102_database_se2_1of2.zip $DOWNLOAD_HOMERUN unzip $DOWNLOAD_HOME/linuxamd64_12102_database_se2_1of2.zip -d $ORACLE_INSTALL_STAGING_HOME && \

rm $DOWNLOAD_HOME/linuxamd64_12102_database_se2_1of2.zip

COPY linuxamd64_12102_database_se2_2of2.zip $DOWNLOAD_HOMERUN unzip $DOWNLOAD_HOME/linuxamd64_12102_database_se2_2of2.zip -d $ORACLE_INSTALL_STAGING_HOME && \

rm $DOWNLOAD_HOME/linuxamd64_12102_database_se2_2of2.zip

Page 45: Docker & Essbase Session ID - OATUG

Add Essbase Zips (from E-Delivery)

COPY Foundation-11124-linux64-Part1.zip $DOWNLOAD_HOMECOPY Foundation-11124-linux64-Part2.zip $DOWNLOAD_HOMECOPY Foundation-11124-linux64-Part4.zip $DOWNLOAD_HOMECOPY Foundation-11124-Part3.zip $DOWNLOAD_HOMECOPY Essbase-11124-linux64.zip $DOWNLOAD_HOME

Page 46: Docker & Essbase Session ID - OATUG

Oracle RDBMS Config

COPY u0/automation/database/init.ora/u0/automation/databaseCOPY u0/automation/database/installDB_main.sh/u0/automation/database

RUN su - oracle -c "/u0/install/oracle_db/database/runInstaller -silent -waitforcompletion -showProgress -ignorePrereq -responseFile/u0/automation/database/db.rsp" && \

/u0/app/oraInventory/orainstRoot.sh && \/u0/app/oracle/product/12.1.0/dbhome_1/root.sh

Page 47: Docker & Essbase Session ID - OATUG

Environment

USER oracle

ENV SID HYPDBENV ORACLE_HOME /u0/app/oracle/product/12.1.0/dbhome_1ENV LD_LIBRARY_PATH ${ORACLE_HOME}/libENV ORACLE_SID $SIDENV TNS_ADMIN /u0/app/oracle/product/12.1.0/dbhome_1/network/admin/${SID}ENV WEB_PORT 9000ENV PATH="${ORACLE_HOME}/bin:/u0/Oracle/Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin:${PATH}"

Page 48: Docker & Essbase Session ID - OATUG

Extract Essbase Zips

RUN unzip -o /u0/install/downloads/Foundation-11124-linux64-Part1.zip -d /u0/install/epm && \

unzip -o /u0/install/downloads/Foundation-11124-linux64-Part2.zip -d /u0/install/epm && \

unzip -o /u0/install/downloads/Foundation-11124-linux64-Part4.zip -d /u0/install/epm && \

unzip -o /u0/install/downloads/Foundation-11124-Part3.zip -d /u0/install/epm && \

unzip -o /u0/install/downloads/Essbase-11124-linux64.zip -d /u0/install/epm

Page 49: Docker & Essbase Session ID - OATUG

Add Installer Response Files

COPY silentInstall.xml /u0/automation/epm/RUN /u0/install/epm/installTool.sh -silent /u0/automation/epm/silentInstall.xml

Page 50: Docker & Essbase Session ID - OATUG

RDBMS Config

RUN mkdir -p /u0/app/oracle/admin/$SID/arch && \mkdir -p /u0/app/oracle/admin/$SID/flash_recovery_area && \mkdir -p /u0/app/oracle/oradata/$SID/ && \mkdir -p /u0/app/oracle/admin/$SID/adump && \mkdir -p $TNS_ADMIN && \cp /u0/automation/database/listener.ora $TNS_ADMIN && \perl -p -i -e s/__SID__/$SID/g $TNS_ADMIN/listener.ora && \cp /u0/automation/database/tnsnames.ora $TNS_ADMIN && \perl -p -i -e s/__SID__/$SID/g $TNS_ADMIN/tnsnames.ora && \cp /u0/automation/database/init.ora

$ORACLE_HOME/dbs/init$SID.ora && \perl -p -i -e s/__SID__/$SID/g $ORACLE_HOME/dbs/init$SID.ora

Page 51: Docker & Essbase Session ID - OATUG

More DB Config

RUN sqlplus / as sysdba < /u0/automation/database/installDB_1.sql

RUN echo "startup;" | sqlplus / as sysdba && \cp /u0/automation/database/install_DB_create_db.sql /tmp/ && \perl -p -i -e s/__SID__/$SID/g /tmp/install_DB_create_db.sql && \sqlplus / as sysdba < /tmp/install_DB_create_db.sql && \sqlplus system/orcl <

/u0/app/oracle/product/12.1.0/dbhome_1/sqlplus/admin/pupbld.sql && \cp /u0/automation/database/install_DB_create_objects.sql /tmp/ && \perl -p -i -e s/__SID__/$SID/g /tmp/install_DB_create_objects.sql &&

\sqlplus / as sysdba < /tmp/install_DB_create_objects.sql

Page 52: Docker & Essbase Session ID - OATUG

Final Config

WORKDIR /home/oracle

COPY load-sample-databases.msh .COPY --chown=oracle:oracle docker-essbase-startup.sh .COPY site/* ./RUN perl -p -i -e s/__PORT__/$WEB_PORT/g index.html

EXPOSE 8080 9000

CMD ["./docker-essbase-startup.sh"]

Page 53: Docker & Essbase Session ID - OATUG

Load Sample Databases Script

login "admin" "password" on "localhost";

import database "Sample"."Basic" data from server data_file "Calcdat" on error abort;

execute calculation default on "Sample"."Basic";

Page 54: Docker & Essbase Session ID - OATUG

Docker Startup Script

#!/bin/bash

echo "startup;" | sqlplus / as sysdbalsnrctl start $SID

/u0/Oracle/Middleware/EPMSystem11R1/common/config/11.1.2.0/configtool.sh -silent /u0/automation/epm/EPMconfig_Foundation.xml/u0/Oracle/Middleware/EPMSystem11R1/common/config/11.1.2.0/configtool.sh -silent /u0/automation/epm/EPMconfig_Essbase.xml

/u0/Oracle/Middleware/user_projects/epmsystem1/bin/start.sh

# should be invoked from /home/oracle, which should be the working dirpython -m SimpleHTTPServer 8080 &

# load and calc sample databases in backgroundstartMaxl.sh load-sample-databases.msh &

tail -F /u0/Oracle/Middleware/user_projects/domains/EPMSystem/servers/EPMServer0/logs/apsserver.log

Page 55: Docker & Essbase Session ID - OATUG

Launch Essbase Docker Container

docker run -d --rm --name essbase \-p 9000:9000 -p 80:8080 \--add-host epmvirt:127.0.0.1 essbase

Or as little as:

docker run --add-host epmvirt:127.0.0.1 essbase

Page 56: Docker & Essbase Session ID - OATUG

Session ID:

Remember to complete your evaluation for this session within the app!

10928

[email protected]