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

Change roberts-coherence to work with Operator 3.x #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 6 additions & 8 deletions bobs-books/roberts-books/roberts-coherence/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ RUN yum update -y \
&& yum-config-manager --save --setopt=ol7_ociyum_config.skip_if_unavailable=true \
&& yum -y install tar gzip \
&& yum clean all; rm -rf /var/cache/yum \
&& mkdir -p /app/lib \
&& mkdir -p /app/conf \
&& mkdir -p /app/libs \
&& mkdir -p /app/classpath \
&& mkdir -p /license

ENV JAVA_HOME=/usr/java
ENV PATH $JAVA_HOME/bin:$PATH
ARG JDK_BINARY="${JDK_BINARY:-jdk-8u261-linux-x64.tar.gz}"
ARG JDK_BINARY="${JDK_BINARY:-openjdk-11+28_linux-x64_bin.tar.gz}"
COPY ${JDK_BINARY} jdk.tar.gz
ENV JDK_DOWNLOAD_SHA256=5a04e01a091f6b1ed9c0b801be4fd10689af07eeb9e27f012c9aa3af9948ea34
ENV JDK_DOWNLOAD_SHA256=3784cfc4670f0d4c5482604c7c513beb1a92b005f569df9bf100e8bef6610f2e

RUN set -eux \
echo "Checking JDK hash"; \
Expand All @@ -25,9 +25,7 @@ RUN set -eux \
tar xzf jdk.tar.gz --directory "${JAVA_HOME}" --strip-components=1; \
rm -f jdk.tar.gz;

COPY target/*.jar /app/lib/
COPY src/main/resources/books-cache-config.xml /app/conf/
COPY src/main/resources/books-pof-config.xml /app/conf/
COPY src/main/resources/books.csv /app/conf/
COPY target/libs/*.jar /app/libs/
COPY target/*.jar /app/classpath/
COPY LICENSE.txt /license/
COPY THIRD_PARTY_LICENSES.txt /license/
7 changes: 3 additions & 4 deletions bobs-books/roberts-books/roberts-coherence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
<version.lib.coherence>12.2.1-4-0</version.lib.coherence>
<version.lib.coherence>20.12</version.lib.coherence>
<version.lib.netty>4.1.43.Final</version.lib.netty>
<version.lib.httpclient>4.5.10</version.lib.httpclient>
</properties>
Expand Down Expand Up @@ -87,13 +87,12 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>compile</includeScope>
<excludeArtifactIds>coherence</excludeArtifactIds>
</configuration>
</execution>
</executions>
Expand All @@ -103,7 +102,7 @@

<dependencies>
<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>com.oracle.coherence.ce</groupId>
<artifactId>coherence</artifactId>
<version>${version.lib.coherence}</version>
</dependency>
Expand Down
33 changes: 33 additions & 0 deletions bobs-books/roberts-books/roberts-coherence/src/main/k8s/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (c) 2021 Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
apiVersion: coherence.oracle.com/v1
kind: Coherence
metadata:
name: roberts-coherence
namespace: bobs-books
spec:
replicas: 3
image: ghcr.io/verrazzano/example-roberts-coherence:test
env:
- name: BACKEND_PORT
value: "8001"
- name: BACKEND_HOSTNAME
value: bobs-bookstore-cluster-cluster-1.bobs-books.svc.cluster.local
- name: TRACING_HOST
value: "jaeger-collector"
- name: JAEGER_SAMPLER_TYPE
value: "const"
- name: JAEGER_SAMPLER_PARAM
value: "1"
jvm:
memory:
heapSize: 1g
ports:
- name: extend
port: 9000
service:
name: roberts-coherence-extend
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ RUN yum update -y \
&& yum-config-manager --save --setopt=ol7_ociyum_config.skip_if_unavailable=true \
&& yum -y install tar gzip \
&& yum clean all; rm -rf /var/cache/yum \
&& mkdir -p /app/lib \
&& mkdir -p /app/conf \
&& mkdir -p /app/libs \
&& mkdir -p /license

ENV JAVA_HOME=/usr/java
ENV PATH $JAVA_HOME/bin:$PATH
ARG JDK_BINARY="${JDK_BINARY:-openjdk-14.0.2_linux-x64_bin.tar.gz}"
ARG JDK_BINARY="${JDK_BINARY:-openjdk-11+28_linux-x64_bin.tar.gz}"
COPY ${JDK_BINARY} jdk.tar.gz
ENV JDK_DOWNLOAD_SHA256=91310200f072045dc6cef2c8c23e7e6387b37c46e9de49623ce0fa461a24623d
ENV JDK_DOWNLOAD_SHA256=3784cfc4670f0d4c5482604c7c513beb1a92b005f569df9bf100e8bef6610f2e

RUN set -eux \
echo "Checking JDK hash"; \
Expand All @@ -25,13 +24,9 @@ RUN set -eux \
tar xzf jdk.tar.gz --directory "${JAVA_HOME}" --strip-components=1; \
rm -f jdk.tar.gz;

ENV COH_WKA roberts-coherence-wka
ENV COH_CLUSTER roberts-coherence
ENV COH_CACHE_CONFIG roberts-cache-config.xml
ENV COH_POF_CONFIG roberts-pof-config.xml

COPY target/* /app/
COPY target/libs/*.jar /app/libs/
COPY target/*.jar /app/
COPY LICENSE.txt /license/
COPY THIRD_PARTY_LICENSES.txt /license/

CMD java -cp /app/roberts-helidon-stock-application.jar:/app/coherence-12.2.1-4-0.jar:/app/* -Dcoherence.distributed.localstorage=true -Dcoherence.wka=$COH_WKA -Dcoherence.cluster=$COH_CLUSTER -Dcoherence.cacheconfig=$COH_CACHE_CONFIG -Dcoherence.pof.config=$COH_POF_CONFIG -Dcoherence.tracing.endpoint=zipkin.istio-system -Dcoherence.tracing.ratio=1 org.books.robert.Main
CMD java -cp /app/*:/app/libs/* -Dcoherence.tracing.endpoint=zipkin.istio-system -Dcoherence.tracing.ratio=1 org.books.robert.Main
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
<checkstyle.config.location>etc/checkstyle.xml</checkstyle.config.location>
<version.lib.coherence>12.2.1-4-0</version.lib.coherence>
<version.lib.coherence>20.12</version.lib.coherence>
</properties>

<build>
Expand Down Expand Up @@ -103,7 +103,7 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
Expand Down Expand Up @@ -207,7 +207,7 @@
<!-- Helidon end -->

<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>com.oracle.coherence.ce</groupId>
<artifactId>coherence</artifactId>
<version>${version.lib.coherence}</version>
</dependency>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@
kind: Service
apiVersion: v1
metadata:
name: ${project.artifactId}
name: roberts-helidon-stock-application
namespace: bobs-books
labels:
app: ${project.artifactId}
app: roberts-helidon-stock-application
spec:
type: NodePort
selector:
app: ${project.artifactId}
type: ClusterIP
ports:
- port: 8080
- port: 80
targetPort: 8080
name: http
selector:
app: roberts-helidon-stock-application
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: ${project.artifactId}
name: roberts-helidon-stock-application
namespace: bobs-books
spec:
replicas: 1
template:
metadata:
labels:
app: ${project.artifactId}
app: roberts-helidon-stock-application
version: v1
spec:
containers:
- name: ${project.artifactId}
image: ${project.artifactId}
imagePullPolicy: IfNotPresent
- name: roberts-helidon-stock-application
image: ghcr.io/verrazzano/example-roberts-helidon-stock-application:test
ports:
- containerPort: 8080
selector:
matchLabels:
app: ${project.artifactId}
app: roberts-helidon-stock-application
version: v1
---
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<tcp-initiator>
<remote-addresses>
<socket-address>
<address system-property="tangosol.coherence.proxy.address">roberts-coherence-storage-extend</address>
<address system-property="tangosol.coherence.proxy.address">roberts-coherence-extend</address>
<port system-property="tangosol.coherence.proxy.port">9000</port>
</socket-address>
</remote-addresses>
Expand Down