Attempt to migrate to Java 19.

This commit is contained in:
Kavin 2023-03-09 13:00:37 +00:00
parent 10758f595b
commit 4a533e9513
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
10 changed files with 63 additions and 61 deletions

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
java: [ 19 ]
steps:
- uses: actions/checkout@v3
@ -20,7 +20,6 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: temurin
check-latest: true
cache: "gradle"
- name: Run Build
run: ./gradlew build

View file

@ -21,17 +21,17 @@ jobs:
dockerfile:
- Dockerfile.ci
- Dockerfile.openj9.ci
- Dockerfile.graalvm-jvm.ci
# - Dockerfile.graalvm-jvm.ci
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Create Version File
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
- name: set up JDK 17
- name: set up JDK 19
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 19
distribution: temurin
check-latest: true
cache: "gradle"
- name: Run Build
run: ./gradlew shadowJar

View file

@ -23,12 +23,11 @@ jobs:
- uses: actions/checkout@v3
- name: Create Version File
run: echo $(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD) > VERSION
- name: set up JDK 17
- name: set up JDK 19
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 19
distribution: temurin
check-latest: true
cache: "gradle"
- name: Run Build
run: ./gradlew shadowJar

View file

@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jdk AS build
FROM eclipse-temurin:19-jdk AS build
WORKDIR /app/
@ -7,7 +7,7 @@ COPY . /app/
RUN --mount=type=cache,target=/root/.gradle/caches/ \
./gradlew shadowJar
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:19-jre
WORKDIR /app/
@ -17,4 +17,4 @@ COPY VERSION .
EXPOSE 8080
CMD java -jar /app/piped.jar
CMD ["java", "--enable-preview", "-jar", "/app/piped.jar"]

View file

@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:19-jre
WORKDIR /app/
@ -8,4 +8,4 @@ COPY VERSION .
EXPOSE 8080
CMD java -jar /app/piped.jar
CMD ["java", "--enable-preview", "-jar", "/app/piped.jar"]

View file

@ -1,4 +1,4 @@
FROM ibm-semeru-runtimes:open-17-jdk AS build
FROM 1337kavin/openj9-19 AS build
WORKDIR /app/
@ -7,7 +7,7 @@ COPY . /app/
RUN --mount=type=cache,target=/root/.gradle/caches/ \
./gradlew shadowJar
FROM ibm-semeru-runtimes:open-17-jre
FROM 1337kavin/openj9-19:latest-jre
WORKDIR /app/
@ -17,4 +17,4 @@ COPY VERSION .
EXPOSE 8080
CMD java -server -Xmx1G -Xaggressive -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon -Xshareclasses:allowClasspaths -Xtune:virtualized -jar /app/piped.jar
CMD java -server -Xmx1G -Xaggressive -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon -Xshareclasses:allowClasspaths -Xtune:virtualized --enable-preview -jar /app/piped.jar

View file

@ -1,4 +1,4 @@
FROM ibm-semeru-runtimes:open-17-jre
FROM 1337kavin/openj9-19:latest-jre
WORKDIR /app/
@ -8,4 +8,4 @@ COPY VERSION .
EXPOSE 8080
CMD java -server -Xmx1G -Xaggressive -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon -Xshareclasses:allowClasspaths -Xtune:virtualized -jar /app/piped.jar
CMD java -server -Xmx1G -Xaggressive -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+UseStringDeduplication -XX:+UseCompressedOops -XX:+UseNUMA -XX:+IdleTuningGcOnIdle -Xgcpolicy:gencon -Xshareclasses:allowClasspaths -Xtune:virtualized --enable-preview -jar /app/piped.jar

View file

@ -56,7 +56,11 @@ jar {
}
}
tasks.withType(JavaCompile).each {
it.options.compilerArgs.add('--enable-preview')
}
group = 'me.kavin.piped'
version = '1.0'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19

View file

@ -7,7 +7,7 @@ import java.util.function.Supplier;
public class Multithreading {
private static final ExecutorService es = Executors.newCachedThreadPool();
private static final ExecutorService es = Executors.newVirtualThreadPerTaskExecutor();
private static final ExecutorService esLimited = Executors
.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 8);
private static final ExecutorService esLimitedPubSub = Executors

View file

@ -1,40 +1,40 @@
services:
piped:
image: 1337kavin/piped:latest
restart: unless-stopped
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./config.yugabytedb.properties:/app/config.properties
depends_on:
- yb-tserver
command: [ "sh", "-c", "sleep 10 && java -jar piped.jar" ]
yb-master:
image: yugabytedb/yugabyte:latest
command:
[
"/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/master",
"--master_addresses=yb-master:7100",
"--rpc_bind_addresses=yb-master:7100",
"--replication_factor=1"
]
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
command:
[
"/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/tserver",
"--start_pgsql_proxy",
"--rpc_bind_addresses=yb-tserver:9100",
"--tserver_master_addrs=yb-master:7100"
]
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
piped:
image: 1337kavin/piped:latest
restart: unless-stopped
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./config.yugabytedb.properties:/app/config.properties
depends_on:
- yb-tserver
command: [ "sh", "-c", "sleep 10 && java --enable-preview -jar piped.jar" ]
yb-master:
image: yugabytedb/yugabyte:latest
command:
[
"/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/master",
"--master_addresses=yb-master:7100",
"--rpc_bind_addresses=yb-master:7100",
"--replication_factor=1"
]
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
command:
[
"/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/tserver",
"--start_pgsql_proxy",
"--rpc_bind_addresses=yb-tserver:9100",
"--tserver_master_addrs=yb-master:7100"
]
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master