Chapter 1. Installing and running the employee rostering demonstration on OpenShift
You can deploy the Red Hat Business Optimizer Employee Rostering starter application to an OpenShift instance.
Preparing deployment files
-
Unzip the add-ons distribution (
rhdm-7.0.0-add-ons.zip). Unzip the employee-rostering zip file that is extracted from the add-ons archive.
NoteWhen you unzip the employee-rostering zip file, the
optashift-employee-rostering-7.5.0.Final-redhat-4folder is created. This folder is the base folder in subsequent steps. File and folder names may have higher version numbers than specifically noted in this document.
There are two options for quickly deploying this application to OpenShift:
- Using the Source to Image (S2I) template. This template pulls the source for the application from a Git repository and builds it during the deployment.
- Using the pre-built binary application archive that is provided in the distribution. In this case, a template prepares the environment but does not rebuild the application.
The S2I approach requires significantly more resources to complete than the binary deployment. If your OpenShift environment has less than 2GB of memory available, for example, when using the OpenShift Online Starter tier, you must follow the binary deployment approach.
1.1. Deploying using the Source to Image (S2I) template
Procedure
- Log in to the OpenShift web console and click Import YAML/JSON in the upper right corner.
- Select the project to add to from the Add to Project drop down menu, or select Create Project to create a new one. If creating a new project, enter a new project name, display name, and description.
-
Click the Browse button and navigate to the
optashift-employee-rostering-template.yamlfile. Starting from theoptashift-employee-rostering-7.5.0.Final-redhat-4folder, access the file by clicking sources > openshift > templates. Click Create.
Figure 1.1. Upload template window

In the Add Template dialog box, click Continue to accept the default settings.
Figure 1.2. Add template window

In the Import YAML/JSON dialog box, click Create to accept the default settings.
Figure 1.3. Configure template window

- In the Success dialog box, click Close.
Wait for the build and deployment to complete. This might take several minutes. When the deployment completes, click the link in the upper right corner and above the shaded bar to open the application.
Figure 1.4. Completed deployment and resulting link
NotePerform a hard refresh of your browser page if the web app does not open after clicking the link.
1.2. Deploying with pre-built binary
Procedure
Prepare the binary deployment.
NoteYou must conduct binary deployments using the oc command line tools. See the OpenShift documentation for installation steps.
-
Working from the
optashift-employee-rostering-7.5.0.Final-redhat-4distribution folder, open thebinariesfolder. -
Copy the
optashift-employee-rostering-webapp-7.5.0.Final-redhat-4.warto thesourcesfolder. -
Rename the file to
ROOT.war. The updated name instructs the application server to deploy the file to the root context of the server.
-
Working from the
-
Using the command line, change to the
sourcesfolder. Create a project using the following command:
oc new-project optashift-demo --display-name="Employee Rostering Demo"
NoteAlternatively, you can use an existing project. In this case, replace all instances of
optashift-demoin this procedure with your project name.Create a build and deployment configuration. Use the
optashift-employee-rostering-template-binary.yamltemplate file to set the OpenShift configuration, such as the route to expose the application to make it accessible to browsers.oc process -f openshift/templates/optashift-employee-rostering-template-binary.yaml -n optashift-demo | oc create -f - -n optashift-demo
Upload the binary file to begin a deployment.
oc start-build employee-rostering --from-file=ROOT.war
Use the OpenShift web UI to view the details for the deployed application. Click the link in the Routes section to open the starter application.
Figure 1.5. OpenShift web console with deployed Employee Rostering starter application


Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.