Skip to content

Commit

Permalink
Servers migrated to Jakarta (#198)
Browse files Browse the repository at this point in the history
* Client and lib-common manual changes.

* Generated based on latest Lyodesigner with support for migration to
Jakarta.

* Update jakarta.servlet.jsp.jstl-api version

* Client and lib-common manual changes.

* Generated based on latest Lyodesigner with support for migration to
Jakarta.

* Update jakarta.servlet.jsp.jstl-api version

* updates to run under jetty-maven-plugin as well as cargo-maven3-plugin

* fixing jstl problems.

* Update based on latest generation.

* update docker files.

* Update servers based on latest LyoDesigner generation

* build: jakarta-ready docker images for CI

* readme update.

* build: tomcat CI checks

* ci: manual acceptance

* ci: manual acceptance

* ci: manual acceptance

* fix: lib lyo dep

* fix: kotlin client lyo dep

* build: fix tomcat docker ci

---------

Co-authored-by: Jad El-khoury <jad.elkhoury@lynxwork.com>
Co-authored-by: Andrew Berezovskyi <andrew@berezovskyi.me>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent 06231c5 commit 3ca27c7
Show file tree
Hide file tree
Showing 193 changed files with 1,330 additions and 1,009 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/maven-acceptance-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,117 @@ jobs:
- name: Run tests on RefImpl
run: mvn -B -Pacceptance clean verify --file main/src/pom.xml


docker-compose-e2e:
runs-on: [ubuntu-latest]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# jdk: ['11']
# distribution: ['temurin', 'corretto', 'microsoft', 'adopt-openj9', 'zulu']
# experimental: [false]
include:
- jdk: '17'
distribution: 'zulu'
experimental: false
# - jdk: '19'
# distribution: 'zulu'
# experimental: true
continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v4
with:
repository: eclipse/lyo
ref: "${{ github.event.inputs.lyoBranch }}"
path: lyo-trunk
- uses: actions/checkout@v4
with:
path: main
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.jdk }}_${{ matrix.distribution }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.jdk }}_${{ matrix.distribution }}-maven-
- name: Build Lyo locally (branch ${{ github.event.inputs.lyoBranch }})
run: mvn -B clean install --file lyo-trunk/pom.xml -DskipTests -Dmaven.javadoc.skip=true
- name: Build with Maven
run: mvn -B package --file main/src/pom.xml
- name: Build and Start Docker Compose
working-directory: main/src/
run: |
docker-compose build
docker-compose up -d
- name: Wait for Services to Start
run: sleep 30 # Adjust as needed
- name: Test RM SPC endpoint with curl
run: curl -fsSL --user "admin:admin" http://localhost:8800/services/catalog/singleton
continue-on-error: true # Continue even if curl command fails
- name: Tear down Docker Compose
working-directory: main/src/
run: docker-compose down


docker-compose-e2e-tomcat:
runs-on: [ubuntu-latest]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# jdk: ['11']
# distribution: ['temurin', 'corretto', 'microsoft', 'adopt-openj9', 'zulu']
# experimental: [false]
include:
- jdk: '17'
distribution: 'zulu'
experimental: false
# - jdk: '19'
# distribution: 'zulu'
# experimental: true
continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v4
with:
repository: eclipse/lyo
ref: "${{ github.event.inputs.lyoBranch }}"
path: lyo-trunk
- uses: actions/checkout@v4
with:
path: main
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-${{ matrix.jdk }}_${{ matrix.distribution }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.jdk }}_${{ matrix.distribution }}-maven-
- name: Build Lyo locally (branch ${{ github.event.inputs.lyoBranch }})
working-directory: lyo-trunk/
run: mvn -B clean install -DskipTests -Dmaven.javadoc.skip=true
- name: Build with Maven
working-directory: main/src/
run: mvn -B package -Pwith-jstl-impl
- name: Build and Start Docker Compose
working-directory: main/src/
run: |
docker-compose -f docker-compose.tomcat.yml build
docker-compose -f docker-compose.tomcat.yml up -d
- name: Wait for Services to Start
run: sleep 30 # Adjust as needed
- name: Test RM SPC endpoint with curl
run: curl -fsSL --user "admin:admin" http://localhost:8800/services/catalog/singleton
- name: Tear down Docker Compose
working-directory: main/src/
run: docker-compose -f docker-compose.tomcat.yml down
2 changes: 1 addition & 1 deletion .github/workflows/maven-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
# - name: Set up Docker
# uses: docker/setup-docker@v2
- name: Build with Maven
run: mvn -B package --file src/pom.xml
run: mvn -B package --file src/pom.xml -Pwith-jstl-impl
- name: Build and Start Docker Compose
working-directory: src/
run: |
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ cd src/
mvn clean install

cd server-rm/
mvn clean package
mvn clean package -Pwith-jstl-impl
docker build -f tomcat.Dockerfile -t refimpl-server-rm .
docker run -p 8800:8080 refimpl-server-rm
```
Expand All @@ -141,16 +141,16 @@ mvn clean install
# mvn clean verify -Pacceptance

cd server-rm/
mvn cargo:run
mvn clean package cargo:run -D"cargo.maven.containerId=tomcat10x" -Pwith-jstl-impl

cd ../server-cm/
mvn cargo:run
mvn clean package cargo:run -D"cargo.maven.containerId=tomcat10x" -Pwith-jstl-impl

cd ../server-qm/
mvn cargo:run
mvn clean package cargo:run -D"cargo.maven.containerId=tomcat10x" -Pwith-jstl-impl

cd ../server-am/
mvn cargo:run
mvn clean package cargo:run -D"cargo.maven.containerId=tomcat10x" -Pwith-jstl-impl

```
## Populate with sample data
Expand Down
10 changes: 5 additions & 5 deletions src/client-toolchain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<maven.compiler.target>17</maven.compiler.target>

<v.kotlin>1.8.20</v.kotlin>
<v.lyo>6.0.0.Alpha1</v.lyo>
<v.lyo>6.0.0-SNAPSHOT</v.lyo>
<!-- <v.lyo.oslc-ui>${v.lyo}</v.lyo.oslc-ui>-->
<v.jersey>2.35</v.jersey>
<v.jersey>3.1.5</v.jersey>
<v.kotlin.coroutines>1.6.4</v.kotlin.coroutines>
</properties>

Expand Down Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.33</version>
<version>1.7.36</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand All @@ -75,8 +75,8 @@
<exclusions>
<exclusion>
<!-- Jakarta API is used in Lyo Client -->
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import java.net.ConnectException
import java.net.URI
import java.util.*
import javax.net.ssl.SSLContext
import javax.ws.rs.client.ClientBuilder
import javax.ws.rs.core.Response
import jakarta.ws.rs.client.ClientBuilder
import jakarta.ws.rs.core.Response
import kotlin.collections.HashSet
import kotlin.system.measureNanoTime

Expand Down
12 changes: 9 additions & 3 deletions src/docker-compose.tomcat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ services:
ports:
- "8800:8080"
server-cm:
build: server-cm/
build:
context: server-cm/
dockerfile: tomcat.Dockerfile
ports:
- "8801:8080"
server-qm:
build: server-qm/
build:
context: server-qm/
dockerfile: tomcat.Dockerfile
ports:
- "8802:8080"
server-am:
build: server-am/
build:
context: server-am/
dockerfile: tomcat.Dockerfile
ports:
- "8803:8080"
29 changes: 15 additions & 14 deletions src/lib-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<version.lyo>6.0.0.Alpha1</version.lyo>
<version.lyo>6.0.0-SNAPSHOT</version.lyo>
<!-- <version.lyo>5.0.1.CR</version.lyo>-->
<version.jersey>2.35</version.jersey>
<v.jakarta.servlet.api>6.0.0</v.jakarta.servlet.api>
<version.jersey>3.1.5</version.jersey>
</properties>

<repositories>
Expand All @@ -39,7 +40,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.33</version>
<version>1.7.36</version>
<scope>runtime</scope>
</dependency>

Expand Down Expand Up @@ -77,8 +78,8 @@
<version>${version.jersey}</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -88,27 +89,27 @@
<version>${version.jersey}</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${v.jakarta.servlet.api}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<version>1.2.7</version>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.xml.bind.DatatypeConverter;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import jakarta.xml.bind.DatatypeConverter;
import javax.xml.datatype.DatatypeConfigurationException;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
Expand Down
4 changes: 3 additions & 1 deletion src/server-am/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
**/*
overlays/
src/
target/**/*
!target/*.war
2 changes: 1 addition & 1 deletion src/server-am/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/jetty:10-jre17
FROM docker.io/library/jetty:11-jre17
# WARNING DO NOT CHANGE WORKDIR or set it back to what it was before
# $JETTY_BASE must be correct before starting Jetty

Expand Down
21 changes: 21 additions & 0 deletions src/server-am/config/tomcat-log.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Docker log config to make sure Tomcat logs everything to Docker!

handlers = java.util.logging.ConsoleHandler

.handlers = java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = \
java.util.logging.ConsoleHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = \
java.util.logging.ConsoleHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE
Loading

0 comments on commit 3ca27c7

Please sign in to comment.