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

s2i-liberty #4

Merged
merged 42 commits into from
Oct 14, 2016
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1d45bab
s2i-liberty initial commit
raffaelespazzoli Sep 27, 2016
3cef661
fixed repo
raffaelespazzoli Sep 27, 2016
04fa257
added readme
raffaelespazzoli Sep 28, 2016
dfc8d5a
deleted test directory
raffaelespazzoli Sep 28, 2016
ea42cbc
fixed missing bashang in run command
raffaelespazzoli Sep 28, 2016
97d40b5
Update readme.md
raffaelespazzoli Sep 30, 2016
12666fa
Update readme.md
raffaelespazzoli Sep 30, 2016
23bf58a
added two build approach
raffaelespazzoli Oct 6, 2016
6da266e
added ability to debug liberty
raffaelespazzoli Oct 6, 2016
923ac20
added echo statements to build
raffaelespazzoli Oct 6, 2016
5f74db7
debug port
raffaelespazzoli Oct 6, 2016
64325ec
a
raffaelespazzoli Oct 6, 2016
cb019e4
d
raffaelespazzoli Oct 6, 2016
e2bc269
d
raffaelespazzoli Oct 6, 2016
b073470
d
raffaelespazzoli Oct 6, 2016
c5e6088
jolokia
raffaelespazzoli Oct 7, 2016
17015a7
improved jolokia
raffaelespazzoli Oct 7, 2016
5811643
run debug
raffaelespazzoli Oct 7, 2016
1ea2747
debug run
raffaelespazzoli Oct 7, 2016
7970be5
run debug
raffaelespazzoli Oct 7, 2016
86ad4bf
debug run
raffaelespazzoli Oct 7, 2016
3060150
debug jolokia
raffaelespazzoli Oct 7, 2016
5deb6e3
jolokia debug
raffaelespazzoli Oct 7, 2016
fbf5906
jolokia debug
raffaelespazzoli Oct 7, 2016
2ae50b8
Merge branch 'master' of
raffaelespazzoli Oct 7, 2016
d5560c3
jolokia debug
raffaelespazzoli Oct 7, 2016
a416fb4
jolokia debug
raffaelespazzoli Oct 7, 2016
8d34e3f
jolokia debug
raffaelespazzoli Oct 7, 2016
24e192c
jolokia debug
raffaelespazzoli Oct 7, 2016
2ec145d
jolokia debug
raffaelespazzoli Oct 7, 2016
57f9d58
no jolokia
raffaelespazzoli Oct 8, 2016
13c05c5
improved cohexistance of chained builds and extended build
raffaelespazzoli Oct 8, 2016
e7500dd
debug
raffaelespazzoli Oct 8, 2016
fd7e11d
debug
raffaelespazzoli Oct 8, 2016
67a4a38
fixed readme
raffaelespazzoli Oct 8, 2016
a4cf45d
readme fixes
raffaelespazzoli Oct 8, 2016
ed21fdb
d
raffaelespazzoli Oct 8, 2016
7dacd1e
last fix
raffaelespazzoli Oct 8, 2016
2a0cb63
correction for allowing a random user in root group to run the image
raffaelespazzoli Oct 10, 2016
909ec16
added application verification
raffaelespazzoli Oct 11, 2016
e29a787
fixed the md
raffaelespazzoli Oct 11, 2016
11863f1
fix
raffaelespazzoli Oct 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed readme
  • Loading branch information
raffaelespazzoli committed Oct 8, 2016
commit 67a4a3879ac02dd1e847d6603e7480636f382277
46 changes: 27 additions & 19 deletions s2i-liberty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ This demonstration describes how to produce a new Source to Image (S2I) runtime

* [Overview](#overview)
* [Bill of Materials](#bill-of-materials)
* [Environment Specifications](#environment-specifications)
* [Template Files](#template-files)
* [Config Files](#config-files)
* [External Source Code Repositories](#external-source-code-repositories)
* [Setup Instructions](#setup-instructions)
* [Presenter Notes](#presenter-notes)
* [Environment Setup](#environment-setup)
* [Produce Runtime Image](#produce-runtime-image)
* [Git Source](#git-source)
* [Binary Source](#binary-source)
* [Create the build config](#create-the-build-config)
* [Two Build Approach](#two-build-approach)
* [Produce s2i Liberty Image](#produce-s2i-liberty-image)
* [Create the First s2i Build](#create-the-first-s2i-build)
* [Create the Second s2i Build](#create-the-second-s2i-build)
* [Create a new Application](#create-a-new-application)
* [Considerations on HTTP session failover](#considerations-on-http-session-failover)
* [Extended Build Approach](#extended-build-approach)
* [Produce s2i Liberty Image](#produce-the-s2i-liberty-image)
* [Create the build config](#create-the-build-config)
* [Create the new Application](#create-the-new-application)
* [Considerations on HTTP session failover](#considerations-on-http-session-failover)


## Overview
Expand Down Expand Up @@ -56,7 +54,7 @@ None

* [Example JEE Application](https://github.com/efsavage/hello-world-war) - Public repository for a simple JEE hello world app.

### Setup Instructions
## Setup Instructions

There is no specific requirements necessary for this demonstration. The presenter should have an OpenShift Enterprise 3.3 environment available with access to the public Internet and the OpenShift Command Line Tools installed on their machine.

Expand Down Expand Up @@ -91,7 +89,7 @@ In this example we will use a pre-existing builder image that can build maven ba
The content used to produce the Liberty runtime image can originate from a Git repository. Execute the following command to start a new image build using the git source strategy.:

```
oc new-build websphere-liberty:webProfile7~https://github.com/raffaelespazzoli/containers-quickstarts --context-dir=s2i-liberty --name=liberty-runtime-s2i --strategy=docker
oc new-build websphere-liberty:webProfile7~https://github.com/redhat-cop/containers-quickstarts --context-dir=s2i-liberty --name=s2i-liberty --strategy=docker
```

Let's break down the command in further detail
Expand Down Expand Up @@ -127,14 +125,14 @@ The second s2i build grabs the artifacts created by the first image and puts the

Run the following command:
```
oc new-build --image-stream=liberty-runtime-s2i --name=hello-world --source-image=hello-world-artifacts --source-image-path=/opt/eap/standalone/deployments/hello-world-war-1.0.0.war:artifacts
oc new-build --image-stream=s2i-liberty --name=hello-world --source-image=hello-world-artifacts --source-image-path=/opt/eap/standalone/deployments/hello-world-war-1.0.0.war:artifacts
```
wait for the build to complete, type:
```
oc logs -f bc/hello-world
```

### Create a new Application
### Create the new Application

To demonstrate the usage of the newly created builder and runtime images, a JEE example application will be built and deployed to Liberty using the Source to Image process.

Expand All @@ -152,7 +150,7 @@ Let's break down the command in further detail

## Extended build approach

### Produce s2i Liberty Image
### Produce the s2i Liberty Image

The Liberty runtime image can be created using the [Git](https://docs.openshift.com/enterprise/latest/dev_guide/builds.html#source-code) or [Binary](https://docs.openshift.com/enterprise/latest/dev_guide/builds.html#binary-source) build source

Expand All @@ -161,7 +159,7 @@ In this example we will use a pre-existing builder image that can build maven ba
The content used to produce the Liberty runtime image can originate from a Git repository. Execute the following command to start a new image build using the git source strategy.:

```
oc new-build websphere-liberty:webProfile7~https://github.com/redhat-cop/containers-quickstarts --context-dir=s2i-liberty --name=liberty-runtime-s2i --strategy=docker
oc new-build websphere-liberty:webProfile7~https://github.com/redhat-cop/containers-quickstarts --context-dir=s2i-liberty --name=s2i-liberty --strategy=docker
```

Let's break down the command in further detail
Expand All @@ -176,7 +174,7 @@ Let's break down the command in further detail

*Note: If the repository was moved to a different location (such as a fork), be sure to reference to correct location.*

A new image called *liberty-runtime-s2i* was produced and can be used to build Liberty applications in the subsequent sections.
A new image called *s2i-liberty* was produced and can be used to build Liberty applications in the subsequent sections.

#### Create the build config

Expand All @@ -197,7 +195,7 @@ oc patch bc hello-world -p '
name: 'eap70-openshift:latest'
runtimeImage:
kind: ImageStreamTag
name: 'liberty-runtime-s2i:latest'
name: 's2i-liberty:latest'
runtimeArtifacts:
- sourcePath: /opt/eap/standalone/deployments/hello-world-war-1.0.0.war
destinationDir: artifact
Expand Down Expand Up @@ -231,6 +229,16 @@ Let's break down the command in further detail
* `-i=hello-world` - Name of the ImageStream that contains the result of the build config that uses the extended s2i process
* `--name=hello-world` - Name to be applied to the newly created resources

## Liberty s2i image environment variables

You can set the following environment variable on containers running on images created with the Liberty s2i image:

| Environment Variable | Default | Description |
|----------------------|---------|-------------|
| ENABLE_DEBUG | false | enable running the jvm in debug mode |
| DEBUG_PORT | 7777 | port on which the jvm will listen for a debugger |


## Considerations on http session failover

When liberty is deployed in a cloud environment, there are certain limitations that apply as explained in this [document](http://www.ibm.com/support/knowledgecenter/en/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/ae/cwlp_paas_restrict.html).
Expand Down