Skip to content

Commit

Permalink
CLOUD-2869 add overrides for building jdk 11 based images
Browse files Browse the repository at this point in the history
Signed-off-by: rcernich <rcernich@redhat.com>
  • Loading branch information
rcernich committed Oct 6, 2018
1 parent 6e1c9ee commit f11473e
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 22 deletions.
16 changes: 16 additions & 0 deletions README.adoc
Expand Up @@ -11,14 +11,30 @@ cekit build

This will produce an image named `centos/openjdk-18-centos7`

### JDK 11

```
cekit --overrides-file=centos7-jdk11-overrides.yaml build
```

This will produce an image named `centos/openjdk-11-centos7`

### RHEL-Based Image

#### JDK 8
```
cekit --overrides-file=product-overrides.yaml build
```

This will produce an image named `redhat-openjdk-8/openjdk18-openshift`

#### JDK 11
```
cekit --overrides-file=product-overrides.yaml --overrides-file=rhel7-jdk11-overrides.yaml build
```

This will produce an image named `redhat-openjdk-11/openjdk11-openshift`

## License

See link:LICENSE[LICENSE] file.
6 changes: 6 additions & 0 deletions centos7-jdk11-overrides.yaml
@@ -0,0 +1,6 @@
name: "centos/openjdk-11-centos7"

modules:
install:
- name: jboss.container.openjdk.jdk
version: "11"
2 changes: 1 addition & 1 deletion product-overrides.yaml
@@ -1,6 +1,6 @@
schema_version: 1

from: "rhel7:7.5-released"
from: "rhel7:7-released"
name: "redhat-openjdk-18/openjdk18-openshift"
version: "1.6"

Expand Down
24 changes: 24 additions & 0 deletions rhel7-jdk11-overrides.yaml
@@ -0,0 +1,24 @@
schema_version: 1

name: &name "redhat-openjdk-11/openjdk11-openshift"
version: &version "1.0"

labels:
- name: "com.redhat.component"
value: "redhat-openjdk-11-openjdk11-openshift-container"

envs:
- name: "JBOSS_IMAGE_NAME"
value: *name
- name: "JBOSS_IMAGE_VERSION"
value: *version

modules:
install:
- name: jboss.container.openjdk.jdk
version: "11"

osbs:
repository:
name: containers/redhat-openjdk-11
branch: jb-openjdk-11.0-openshift-rhel-7
28 changes: 14 additions & 14 deletions tests/features-disabled/java/gc.feature
@@ -1,51 +1,51 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Feature: Openshift OpenJDK GC tests

Scenario: Check default GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m

Scenario: Check GC_MIN_HEAP_FREE_RATIO GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_MIN_HEAP_FREE_RATIO | 5 |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m

Scenario: Check GC_MAX_HEAP_FREE_RATIO GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_MAX_HEAP_FREE_RATIO | 50 |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m

Scenario: Check GC_TIME_RATIO GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_TIME_RATIO | 5 |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m

Scenario: Check GC_ADAPTIVE_SIZE_POLICY_WEIGHT GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_ADAPTIVE_SIZE_POLICY_WEIGHT | 80 |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80 -XX:MaxMetaspaceSize=100m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80 -XX:MaxMetaspaceSize=100m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80 -XX:MaxMetaspaceSize=100m

Scenario: Check GC_MAX_METASPACE_SIZE GC configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_MAX_METASPACE_SIZE | 120 |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
And container log should contain -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m

Scenario: Check GC_CONTAINER_OPTIONS configuration
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
| variable | value |
| GC_CONTAINER_OPTIONS | -XX:+UseG1GC |
Then s2i build log should contain Using MAVEN_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseG1GC
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseG1GC
And container log should contain -XX:+UseG1GC
And container log should not contain -XX:+UseParallelOldGC
2 changes: 1 addition & 1 deletion tests/features-disabled/java/hawkular.feature
@@ -1,4 +1,4 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Feature: Openshift OpenJDK Hawkular tests

Expand Down
2 changes: 1 addition & 1 deletion tests/features-disabled/java/java_s2i.feature
@@ -1,4 +1,4 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Feature: Openshift OpenJDK S2I tests
# NOTE: these tests should be usable with the other images once we have refactored the JDK scripts.
Expand Down
2 changes: 1 addition & 1 deletion tests/features-disabled/java/jolokia.feature
@@ -1,4 +1,4 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
Feature: Openshift OpenJDK Jolokia tests

Scenario: Check Environment variable is correct
Expand Down
2 changes: 1 addition & 1 deletion tests/features-disabled/java/ports.feature
@@ -1,4 +1,4 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Feature: Openshift OpenJDK port tests

Expand Down
2 changes: 1 addition & 1 deletion tests/features-disabled/java/runtime.feature
@@ -1,4 +1,4 @@
@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Feature: Openshift OpenJDK Runtime tests

Expand Down
4 changes: 2 additions & 2 deletions tests/features-disabled/openshift.feature
@@ -1,6 +1,6 @@
Feature: Tests for all openshift images

@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
Scenario: Check that product labels are correctly set
# We don't set 'release' or 'architecture' on CI builds, but it's set on OSBS builds
# Since we base on an image which has it already set, it's kind of meaningless
Expand All @@ -10,7 +10,7 @@ Feature: Tests for all openshift images
Then the image should contain label release
And the image should contain label architecture with value x86_64

@redhat-openjdk-18
@redhat-openjdk-18 @redhat-openjdk-11
@centos/openjdk-18-centos7
Scenario: Check that common labels are correctly set
Given image is built
Expand Down

0 comments on commit f11473e

Please sign in to comment.