diff --git a/src/adservice/.java-version b/src/adservice/.java-version index 03b6389f32..5f39e91446 100644 --- a/src/adservice/.java-version +++ b/src/adservice/.java-version @@ -1 +1 @@ -17.0 +21.0 diff --git a/src/adservice/Dockerfile b/src/adservice/Dockerfile index 442b69120d..425960e9c0 100644 --- a/src/adservice/Dockerfile +++ b/src/adservice/Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -FROM eclipse-temurin:17-jdk AS builder +FROM eclipse-temurin:21-jdk as builder WORKDIR /usr/src/app/ @@ -18,14 +18,13 @@ RUN ./gradlew installDist -PprotoSourceDir=./proto # ----------------------------------------------------------------------------- -FROM eclipse-temurin:17-jre +FROM eclipse-temurin:21-jre -ARG version=1.30.0 +ARG version=1.31.0 WORKDIR /usr/src/app/ COPY --from=builder /usr/src/app/ ./ ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar -RUN chmod 644 /usr/src/app/opentelemetry-javaagent.jar ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar EXPOSE ${AD_SERVICE_PORT} diff --git a/src/adservice/build.gradle b/src/adservice/build.gradle index dfc4058911..918fda0abd 100644 --- a/src/adservice/build.gradle +++ b/src/adservice/build.gradle @@ -16,20 +16,21 @@ description = 'Ad Service' group = "adservice" version = "0.1.0-SNAPSHOT" -def opentelemetryVersion = "1.28.0" -def opentelemetryInstrumentationAlphaVersion = "1.28.0-alpha" -def grpcVersion = "1.56.1" -def jacksonVersion = "2.15.2" -def protocVersion = "3.20.0" - -tasks.withType(JavaCompile) { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 +def opentelemetryVersion = "1.31.0" +def opentelemetryInstrumentationAlphaVersion = "1.31.0-alpha" +def grpcVersion = "1.58.0" +def jacksonVersion = "2.15.3" +def protocVersion = "3.24.4" + +tasks.withType(JavaCompile).configureEach { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } ext { speed = project.hasProperty('speed') ? project.getProperty('speed') : false - offlineCompile = new File("$buildDir/output/lib") + Provider output = layout.buildDirectory.dir("outputLocation") + offlineCompile = output.get().asFile } dependencies { @@ -48,11 +49,11 @@ dependencies { "io.opentelemetry:opentelemetry-api", "io.opentelemetry:opentelemetry-sdk", "io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations", - "org.apache.logging.log4j:log4j-core:2.20.0" + "org.apache.logging.log4j:log4j-core:2.21.0" runtimeOnly "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}", "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}", - "io.netty:netty-tcnative-boringssl-static:2.0.61.Final" + "io.netty:netty-tcnative-boringssl-static:2.0.62.Final" } } diff --git a/src/adservice/gradle/wrapper/gradle-wrapper.jar b/src/adservice/gradle/wrapper/gradle-wrapper.jar index 249e5832f0..033e24c4cd 100644 Binary files a/src/adservice/gradle/wrapper/gradle-wrapper.jar and b/src/adservice/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/adservice/gradle/wrapper/gradle-wrapper.properties b/src/adservice/gradle/wrapper/gradle-wrapper.properties index 165b5020b0..3fa8f862f7 100644 --- a/src/adservice/gradle/wrapper/gradle-wrapper.properties +++ b/src/adservice/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Wed Jul 19 11:27:42 EDT 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/src/adservice/gradlew b/src/adservice/gradlew index a69d9cb6c2..fcb6fca147 100755 --- a/src/adservice/gradlew +++ b/src/adservice/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +130,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/src/adservice/gradlew.bat b/src/adservice/gradlew.bat index 53a6b238d4..6689b85bee 100644 --- a/src/adservice/gradlew.bat +++ b/src/adservice/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME%