8000 GitHub - remilej/odm-dsi-docker: This repository allows to deploy an IBM Operational Decision Manager Insights Runtime on Docker.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remilej/odm-dsi-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run ODM DSI Runtime on Docker

This page shows you how to run a single DSI Runtime on Docker. For some additional usage scenarios, like creating a volume to persist your solutions, see the advance.md documentation.

Prerequisites

You can use the provided materials on MacOS or Ubuntu 16.04 LTS 64-bit. And you can use any Linux VM with a recent version of Docker. Before you start, make sure you have installed the following software:

Note: To be able to create the Docker image you must have an installation of IBM ODM Decision Server Insights V8.9.1.

OK, let's continue...

Build the Docker image

Install the scripts

The source for this tutorial is available on Github in this GIT repository: https://github.com/ODMDev/odm-dsi-docker.

Change the current working directory to the location where you want the cloned directory to be made. Get the source files from Github over the SSH transfer protocol by typing:

git clone https://github.com/ODMDev/odm-dsi-docker.git

In the following document:

  • DSI_DOCKER_GIT designates the directory containing the working copy of this GIT repository.
  • DSI_HOME designates the directory containing the installation of ODM DSI V8.9.1.

Create the Docker image

The Docker image can be produced by running the script 'build.sh'. Pass the path of the ODM installation directory as the first argument. For example:

cd $DSI_DOCKER_GIT/dsi-runtime
./build.sh $DSI_HOME

The output should end with:

The docker image dsi-runtime has been created.

This message means that the Docker image dsi-runtime has been produced. The command docker images can be used to verify that the image is now listed in the local registry of Docker.

MacOS

On MacOS the build of the image will use the IBM JDK from the 'ibmjava' image, which might be different to the one supported by DSI Runtime.

The name of this image will be dsi-runtime-ibmjava instead of dsi-runtime, it will require to update accordingly the scripts and commands for running a DSI container.

To make sure you use a supported JDK, build the DSI runtime image from a Linux installation directory.

Run a single DSI runtime with Docker

docker run -p9443:9443 --name dsi-runtime dsi-runtime

The name of the Docker container is dsi-runtime and the port 9443 of the DSI REST API is bound to port 9443 of the host.

When DSI is started, the output ends with the following lines:

[AUDIT   ] CWWKF0011I: The server dsi-runtime is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/ibm/ia/debug/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/ibm/ia/gateway/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/ibm/ia/rest/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/ibm/insights/

Test a DSI Runtime running in Docker

Deploy a solution

To deploy a solution and the connectivity configuration, the usual command line tools solutionManager and connectivityManager can be used.

The sample script solution_deploy.sh can also be used to deploy a simple test solution and its connectivity configuration. In a separate command shell to the one you used to run the DSI container:

cd $DSI_DOCKER_GIT/dsi-runtime/samples/simple
./solution_deploy.sh $DSI_HOME localhost 9443

The first argument is the path to the installation directory of DSI. The second argument is the hostname of the DSI runtime. The third argument is the port of the DSI Runtime.

The output of the command line should be similar to:

Solution successfully deployed.
CWMBE1146I: Reading the input file: ./simple_solution-0.0.esa
CWMBE1475I: The connectivity server configuration file for the solution "simple_solution" contains the configuration required for the specified endpoints.
CWMBE1148I: Writing to the output file: /tmp/simple_solution-inbound.ear7303141339821942454.tmp
CWMBE1452I: Successfully deployed connectivity for the solution "simple_solution".
CWMBE1498I: Number of active inbound endpoints: 1
CWMBE1499I: Number of active outbound endpoints: 0

The DSI runtime console should display a message about the solution:

[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.407 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [usr:simple_solution-0.0].
[AUDIT   ] CWWKF0008I: Feature update completed in 0.402 seconds.
[AUDIT   ] CWMBD0055I: Solution simple_solution-0.0 installed.
[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0028A: Processing included configuration resource: /opt/dsi/runtime/wlp/usr/servers/cisDev/simple_solution-config.xml
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.040 seconds.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://58de6092c19c:9080/in/
[AUDIT   ] CWWKZ0001I: Application simple_solution-inbound started in 0.097 seconds.
[AUDIT   ] CWMBD0060I: Solution simple_solution-0.0 ready.

Check that the solution is deployed

Open the URL https://localhost:9443/ibm/ia/rest/solutions/simple_solution/.

The REST command returns the following data:

<object type="com.ibm.ia.admin.solution.Solution">
        <attribute name="entityTypes">
                <collection type="entityTypes">
                        <string>simple.Person</string>
                </collection>
        </attribute>
        <attribute name="eventTypes">
                <collection type="eventTypes">
                        <string>simple.SayHello</string>
                        <string>simple.CreatePerson</string>
                        <string>simple.Message</string>
                </collection>
        </attribute>
        <attribute name="name">
                <string>simple_solution</string>
        </attribute>
        <attribute name="timeZone">
                <object type="java.time.ZoneId">UTC</object>
        </attribute>
</object>

Send an event

To create an entity of the type simple.Person, and an event of type simple.CreatePerson send REST API calls to the DSI runtime.

The script create_person.sh can be used:

cd $DSI_DOCKER_GIT/samples/simple
./create_person.sh localhost

The first argument is the hostname of the DSI runtime.

View the created entity

The sent event creates an entity instance of 'simple.Person'.

Open the URL https://localhost:9443/ibm/ia/rest/solutions/simple_solution/entity-types/simple.Person.

The REST command returns the following data:

<object xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ibm.com/ia/Entity" type="Collection[simple.Person]">
  <attribute name="entities">
    <collection>
      <object type="simple.Person">
        <attribute name="$CreationTime">
          <null/>
        </attribute>
        <attribute name="$IdAttrib">
          <string>name</string>
        </attribute>
        <attribute name="description">
          <string>  </string>
        </attribute>
        <attribute name="name">
          <string>jean</string>
        </attribute>
      </object>
    </collection>
  </attribute>
</object>

Issues and contributions

For issues relating specifically to the Dockerfiles and scripts, please use the GitHub issue tracker. We welcome contributions following our guidelines.

License

The Dockerfiles and associated scripts found in this project are licensed under the Apache License 2.0.

Notice

© Copyright IBM Corporation 2017.

About

This repository allows to deploy an IBM Operational Decision Manager Insights Runtime on Docker.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%
0