Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBPM-7477 - New docker image for full distribution #39

Merged
merged 1 commit into from Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,6 @@

# Repository wide ignore mac DS_Store files
.DS_Store

# Docker pid file
docker.pid
17 changes: 12 additions & 5 deletions README.md
Expand Up @@ -3,15 +3,22 @@ jBPM Workbench Docker images

JBoss jBPM Workbench [Docker](http://docker.io/) images.

This module provides the community jBPM Workbench images.
This module provides the community jBPM Workbench images.

There are two available images:
There are two available images:

**jBPM Workbench**

It's the base Docker image for jBPM Workbench. It's purpose is to be used as base for extending and creating your own images that uses jBPM Workbench.
It's the base Docker image for jBPM Workbench. It's purpose is to be used as base for extending and creating your own images that uses jBPM Workbench.

**jBPM Workbench showcase**

It inherits from jBPM Workbench image and provides a **ready to run Docker image for jBPM Workbench**.
It provides some custom configurations and default users and roles to try and test the workbench.
It inherits from jBPM Workbench image and provides a **ready to run Docker image for jBPM Workbench**.
It provides some custom configurations and default users and roles to try and test the workbench.

**jBPM Server Full distribution**

Provides a **ready to run Docker image for jBPM server full** with all necessary configurations between services.
Deployed applications include: jBPM Workbench, Kie Server, jBPM Case Management Showcase and jBPM Service Repository.
For more information, please visit the [Getting Started Guide](http://jbpm.org/learn/gettingStarted.html)
It provides some custom configurations and default users and roles to try and test the workbench.
4 changes: 2 additions & 2 deletions base/Dockerfile
@@ -1,5 +1,5 @@
###########################################################################
# Dockerfile that provides the image for JBoss jBPM Workbench 7.8.0.Final
# Dockerfile that provides the image for JBoss jBPM Workbench 7.9.0.Final
###########################################################################

####### BASE ############
Expand All @@ -11,7 +11,7 @@ MAINTAINER "Michael Biarnes Kiefer" "mbiarnes@redhat.com"
####### ENVIRONMENT ############
ENV JBOSS_BIND_ADDRESS 0.0.0.0
ENV KIE_REPOSITORY https://repository.jboss.org/nexus/content/groups/public-jboss
ENV KIE_VERSION 7.8.0.Final
ENV KIE_VERSION 7.9.0.Final
ENV KIE_CLASSIFIER wildfly11
ENV KIE_CONTEXT_PATH jbpm-console
ENV JAVA_OPTS -Xms256m -Xmx1024m -Djava.net.preferIPv4Stack=true
Expand Down
8 changes: 4 additions & 4 deletions base/README.md
Expand Up @@ -22,7 +22,7 @@ Introduction
The image contains:

* JBoss Wildfly 11.0.0.Final
* jBPM Workbench 7.8.0.Final
* jBPM Workbench 7.9.0.Final

This image provides the jBPM Workbench. It's intended to be extended so you can add your custom configurations.

Expand Down Expand Up @@ -217,7 +217,7 @@ Notes
-----

* The context path for jBPM Workbench web application is `jbpm-console`
* jBPM Workbench version is `7.8.0.Final`
* jBPM Workbench version is `7.9.0.Final`
* jBPM Workbench requires running JBoss Wildfly 11.0.0.Final using the `full` server profile
* No users or roles are configured by default
* No support for clustering
Expand All @@ -229,6 +229,6 @@ Notes
Release notes
--------------

**7.8.0.Final**
**7.9.0.Final**

* See release notes for [jBPM](http://docs.jboss.org/jbpm/release/7.8.0.Final/jbpm-docs/html_single/#_jbpmreleasenotes)
* See release notes for [jBPM](http://docs.jboss.org/jbpm/release/7.9.0.Final/jbpm-docs/html_single/#_jbpmreleasenotes)
2 changes: 1 addition & 1 deletion base/start.sh
Expand Up @@ -45,7 +45,7 @@ if [ -f docker.pid ]; then
rm -f docker.pid
fi

# Start the jboss BPM Suite docker container
# Start the JBoss jBPM Workbench docker container
echo "Starting $CONTAINER_NAME docker container using:"
echo "** Container name: $CONTAINER_NAME"
image_jbpm_workbench=$(docker run -P -d --name $CONTAINER_NAME $IMAGE_NAME:$IMAGE_TAG)
Expand Down
26 changes: 26 additions & 0 deletions docker-compose-examples/jbpm-full-mysql.yml
@@ -0,0 +1,26 @@
version: '2'

volumes:
mysql_data:
driver: local

services:
mysql:
image: mysql:5.7
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: jbpm
MYSQL_USER: jbpm
MYSQL_PASSWORD: jbpm
jbpm:
image: jboss/jbpm-server-full
environment:
JBPM_DB_DRIVER: mysql
JBPM_DB_HOST: mysql
ports:
- 8080:8080
- 8001:8001
depends_on:
- mysql
25 changes: 25 additions & 0 deletions docker-compose-examples/jbpm-full-postgres.yml
@@ -0,0 +1,25 @@
version: '2'

volumes:
postgres_data:
driver: local

services:
postgres:
image: postgres:9.6
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: jbpm
POSTGRES_USER: jbpm
POSTGRES_PASSWORD: jbpm
jbpm:
image: jboss/jbpm-server-full
environment:
JBPM_DB_DRIVER: postgres
JBPM_DB_HOST: postgres
ports:
- 8080:8080
- 8001:8001
depends_on:
- postgres
41 changes: 41 additions & 0 deletions server/Dockerfile
@@ -0,0 +1,41 @@
###########################################################################
# Dockerfile that provides the image for JBoss jBPM Server Full 7.9.0.Final
###########################################################################

####### BASE ############
FROM jboss/wildfly:11.0.0.Final

####### MAINTAINER ############
MAINTAINER "Michael Biarnes Kiefer" "mbiarnes@redhat.com"

####### ENVIRONMENT ############
ENV JBOSS_BIND_ADDRESS 0.0.0.0
ENV KIE_REPOSITORY https://download.jboss.org/jbpm/release
ENV KIE_VERSION 7.9.0.Final
ENV KIE_CLASSIFIER wildfly11
ENV KIE_CONTEXT_PATH jbpm-console
ENV EXTRA_OPTS -Dorg.jbpm.ht.admin.group=admin -Dorg.uberfire.nio.git.ssh.host=$JBOSS_BIND_ADDRESS

####### JBPM-WB ############
RUN curl -o $HOME/jbpm-server-dist.zip $KIE_REPOSITORY/$KIE_VERSION/jbpm-server-$KIE_VERSION-dist.zip && \
unzip -o -q jbpm-server-dist.zip -d $JBOSS_HOME && \
rm -rf $HOME/jbpm-server-dist.zip

####### CONFIGURATION ############
USER root
ADD etc/start_jbpm-wb.sh $JBOSS_HOME/bin/start_jbpm-wb.sh
ADD etc/update_db_config.sh $JBOSS_HOME/bin/update_db_config.sh
RUN chown jboss:jboss $JBOSS_HOME/standalone/deployments/*
RUN chown jboss:jboss $JBOSS_HOME/bin/start_jbpm-wb.sh
RUN chown jboss:jboss $JBOSS_HOME/bin/update_db_config.sh

####### CUSTOM JBOSS USER ############
# Switchback to jboss user
USER jboss

####### EXPOSE INTERNAL JBPM GIT PORT ############
EXPOSE 8001

####### RUNNING JBPM-WB ############
WORKDIR $JBOSS_HOME/bin/
CMD ["./start_jbpm-wb.sh"]
197 changes: 197 additions & 0 deletions server/README.md
@@ -0,0 +1,197 @@
jBPM Workbench Showcase Docker image
=====================================

JBoss jBPM Server Full [Docker](http://docker.io/) image.

Table of contents
------------------

* Introduction
* Usage
* Users and roles
* Database
* Logging
* GIT internal repository access
* Persistent configuration
* Experimenting
* Troubleshooting
* Notes
* Release notes

Introduction
------------

The image contains:

* JBoss Wildfly 11.0.0.Final
* jBPM Workbench 7.9.0.Final
* KIE Server 7.9.0.Final
* jBPM Case Management Showcase 7.9.0.Final
* jBPM Service Repository 7.9.0.Final

This is a **ready to run Docker image for jBPM Workbench**. Just run it and try the jBPM Workbench!

Usage
-----

To run a container:

docker run -p 8080:8080 -p 8001:8001 -d --name jbpm-server-full jboss/jbpm-server-full:latest

Once container and web applications started, you can navigate to it using one of the users described in section `Users and roles`, using the following URL:

http://localhost:8080/jbpm-console

Users and roles
----------------

This showcase image contains default users and roles:

USER PASSWORD ROLE
*************************************************
wbadmin wbadmin admin,analyst,user,process-admin,kie-server
krisv krisv admin,analyst,user,process-admin,kie-server
john john analyst,Accounting,PM,kie-server
sales-rep sales-rep analyst,sales,kie-server
katy katy analyst,HR,kie-server
jack jack analyst,IT,kie-server

Database
--------

This image supports using H2, MySQL, PostgreSQL as the database. By default with H2 database with file storage - located under <JBOSS_HOME>/standalone/data/jbpm-db.
The container configuration allows you to switch to either MySQL or PostgreSQL database via a set of environment variables.
Alternatively, you can use the provided Docker compose examples to get started using an alternative database.

## Docker compose examples

### MySQL Example

docker-compose -f docker-compose-examples/jbpm-full-mysql.yml up

### PostgreSQL Example

docker-compose -f docker-compose-examples/jbpm-full-postgres.yml up

## Environment variables

* `JBPM_DB_DRIVER` = Specify which database driver to use. Allows either: 'h2', 'mysql' or 'postgres'. Default: 'h2'.
* `JBPM_DB_HOST` = Specify hostname of the database. Default: 'localhost'
* `JBPM_DB_PORT` = Specify port of the database. Default: '3306' if using 'mysql' driver or '5432' in case of 'postgres'.
* `JBPM_DB_NAME` = Specify name of the database to use. Default: 'jbpm'
* `JBPM_DB_USER` = Specify user to use to authenticate to the database. Default: 'jbpm'
* `JBPM_DB_PASSWORD` = Specify user's password to use to authenticate to the database. Default: 'jbpm'

### MySQL Example

docker run -p 8080:8080 -p 8001:8001 -d --name jbpm-server-full -e JBPM_DB_DRIVER=mysql -e JBPM_DB_HOST=172.17.0.1 jboss/jbpm-server-full:latest

### PostgreSQL Example

docker run -p 8080:8080 -p 8001:8001 -d --name jbpm-server-full -e JBPM_DB_DRIVER=postgres -e JBPM_DB_HOST=172.17.0.1 jboss/jbpm-server-full:latest

Logging
-------

You can see all logs generated by the `standalone` binary running:

docker logs [-f] <container_id>

You can attach the container by running:

docker attach <container_id>

The jBPM Workbench and Kie Server web applications logs can be found inside the container at path:

/opt/jboss/wildfly/standalone/log/server.log

Example:
sudo nsenter -t $(docker inspect --format '{{ .State.Pid }}' $(docker ps -lq)) -m -u -i -n -p -w
-bash-4.2# tail -f /opt/jboss/wildfly/standalone/log/server.log

GIT internal repository access
------------------------------

The workbench stores all the project artifacts in an internal GIT repository. By default, the protocol available for accessing the GIT repository is `SSH` at port `8001`.

As an example, if you import the `IT_Orders` sample project, you can clone it by running:

git clone ssh://wbadmin@localhost:8001/MySpace/IT_Orders

NOTE: Users and password for ssh access are the same that for the web application users defined at the realm files.

By default, the GIT repository is created when the application starts for first time at `$WORKING_DIR/.niogit`, considering `$WORKING_DIR` as the current directory where the application server is started.

You can specify a custom repository location by setting the following Java system property to your target file system directory:

-Dorg.uberfire.nio.git.dir=/home/youruser/some/path

NOTE: This directory can be shared with your docker host and with another containers using shared volumes when running the container, if you need so.


Persistent configuration
------------------------

As Docker defaults, once a container has been removed, the data within that container is removed as well. That includes any assets you created and projects that you deployed to the Kie Server using the local Maven repository.

In the case you need to create a persistent environment you can use an approach based on [Docker Volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Here are two ways of doing it.

**Using default GIT root directory**

By default, the internal GIT root directory for the workbench container is located at `/opt/jboss/wildfly/bin/.niogit`, so you can make this directory persistent in your docker host by running the container using a docker shared volume as:

# Use -v <SOURCE_FS_PATH>:<CONTAINER_FS_PATH>
docker run -p 8080:8080 -p 8001:8001 -v /home/myuser/wb_git:/opt/jboss/wildfly/bin/.niogit:Z -d --name jbpm-server-full jboss/jbpm-server-full:latest

Please create `/home/myuser/wb_git` before running the docker container and ensure you have set the right permissions.
As the above command, now your workbench git repository will be persistent at your host filesystem's path `/home/myuser/wb_git`. So if you remove this container and start a new one just by using same shared volume, you'll find all your assets on the new workbench's container as well.

In order to keep the git repositories between different containers you can just start the container by configuring a new host volume as:

# Use -v <SOURCE_FS_PATH>:<CONTAINER_FS_PATH>
docker run -p 8080:8080 -p 8001:8001 -v /home/myuser/wb_git:/opt/jboss/wildfly/.niogit:Z -d --name jbpm-workbench jboss/jbpm-workbench-showcase:MY_TAG

As the above command, now your workbench git repository will be persistent at your local filesystem path `/home/myuser/wb_git`. So if you remove this container and start a new one just by using same shared volume, you'll find all your assets on the new workbench's container as well.

Experimenting
-------------

To spin up a shell in one of the containers try:

docker run -t -i -p 8080:8080 -p 8001:8001 jboss/jbpm-server-full:latest /bin/bash

You can then noodle around the container and run stuff & look at files etc.

Troubleshooting
---------------

If the application can't be accessed via browser (http://localhost:8080/jbpm-console) please run the container in [host network mode](https://docs.docker.com/engine/reference/run/#network-settings). It seems that latest docker versions have some restrictions on the networking side. Using an older daemon version this does not happen.
Try:

docker run ... --network="host" ...

Notes
-----

* jBPM Workbench version is `7.9.0.Final`
* The context path for jBPM Workbench web application is `jbpm-console`
* KIE Server version is `7.9.0.Final`
* The context path for KIE Server web application is `kie-server`
* jBPM Case Management Showcase version is `7.9.0.Final`
* The context path for jBPM Case Management Showcase web application is `jbpm-casemgmt`
* jBPM Service Repository version is `7.9.0.Final`
* The context path for jBPM Service Repository web application is `repository`
* jBPM Server Full requires running JBoss Wildfly 11.0.0 using the `full` server profile
* Examples and demos are always available, also when not connected to internet
* No support for clustering
* Use of embedded H2 database server by default
* No support for Wildfly domain mode, just standalone mode
* This image is not intended to be run on cloud environments such as RedHat OpenShift or Amazon EC2, as it does not meet all the requirements.
* Please give us your feedback or report a issue at [jBPM Setup](https://groups.google.com/forum/#!forum/jbpm-setup) or [jBPM Usage](https://groups.google.com/forum/#!forum/jbpm-usage) Google groups.

Release notes
--------------

**7.9.0.Final**

* See release notes for [jBPM](http://docs.jboss.org/jbpm/release/7.9.0.Final/jbpm-docs/html_single/#_jbpmreleasenotes)
14 changes: 14 additions & 0 deletions server/build.sh
@@ -0,0 +1,14 @@
#!/bin/bash

# ***************************************************
# jBPM Server Full - Docker image build script
# ***************************************************

IMAGE_NAME="jboss/jbpm-server-full"
IMAGE_TAG="latest"


# Build the container image.
echo "Building the Docker container for $IMAGE_NAME:$IMAGE_TAG.."
docker build --rm -t $IMAGE_NAME:$IMAGE_TAG .
echo "Build done"