From 0575ab4fe3c64834f3d22287ec5f861db10c0ab1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 26 Oct 2022 11:22:34 -0700 Subject: [PATCH] Remove usage of deprecated docker image (#6969) --- .../workflows/pr-smoke-test-play-images.yml | 22 ------------------- .../publish-smoke-test-play-images.yml | 1 - .../workflows/reusable-smoke-test-images.yml | 7 ------ smoke-tests/images/grpc/build.gradle.kts | 10 ++++++++- smoke-tests/images/play/build.gradle.kts | 13 +++++++++-- smoke-tests/images/quarkus/build.gradle.kts | 13 +++++++++-- smoke-tests/images/servlet/build.gradle.kts | 6 ++++- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/pr-smoke-test-play-images.yml b/.github/workflows/pr-smoke-test-play-images.yml index 4475afa4ed..6bac0e8117 100644 --- a/.github/workflows/pr-smoke-test-play-images.yml +++ b/.github/workflows/pr-smoke-test-play-images.yml @@ -16,25 +16,3 @@ jobs: # https://github.com/playframework/playframework/pull/10819 skip-java-17: true skip-java-19: true - skip-java-20: true - - build-java-15: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up JDK for running Gradle - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 17 - - - name: Set up Gradle cache - uses: gradle/gradle-build-action@v2 - with: - cache-read-only: true - - # Play doesn't support Java 16 (or 17) yet - # https://github.com/playframework/playframework/pull/10819 - - name: Build Java 15 Docker image - run: ./gradlew :smoke-tests:images:play:jibDockerBuild -PtargetJDK=15 -Djib.httpTimeout=120000 -Djib.console=plain diff --git a/.github/workflows/publish-smoke-test-play-images.yml b/.github/workflows/publish-smoke-test-play-images.yml index d0fc309d37..7bfb2c4de4 100644 --- a/.github/workflows/publish-smoke-test-play-images.yml +++ b/.github/workflows/publish-smoke-test-play-images.yml @@ -19,7 +19,6 @@ jobs: # https://github.com/playframework/playframework/pull/10819 skip-java-17: true skip-java-19: true - skip-java-20: true publish-java-15: runs-on: ubuntu-latest diff --git a/.github/workflows/reusable-smoke-test-images.yml b/.github/workflows/reusable-smoke-test-images.yml index 42be7d6676..3a2559a57e 100644 --- a/.github/workflows/reusable-smoke-test-images.yml +++ b/.github/workflows/reusable-smoke-test-images.yml @@ -21,9 +21,6 @@ on: skip-java-19: type: boolean required: false - skip-java-20: - type: boolean - required: false jobs: build: @@ -67,7 +64,3 @@ jobs: - name: Build Java 19 Docker image if: ${{ !inputs.skip-java-19 }} run: ./gradlew ${{ inputs.project }}:${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -Ptag=${{ env.TAG }} -PtargetJDK=19 -Djib.httpTimeout=120000 -Djib.console=plain - - - name: Build Java 20 Docker image - if: ${{ !inputs.skip-java-20 }} - run: ./gradlew ${{ inputs.project }}:${{ inputs.publish && 'jib' || 'jibDockerBuild' }} -Ptag=${{ env.TAG }} -PtargetJDK=20 -Djib.httpTimeout=120000 -Djib.console=plain diff --git a/smoke-tests/images/grpc/build.gradle.kts b/smoke-tests/images/grpc/build.gradle.kts index 579373cb71..a22ba982d2 100644 --- a/smoke-tests/images/grpc/build.gradle.kts +++ b/smoke-tests/images/grpc/build.gradle.kts @@ -28,7 +28,15 @@ val targetJDK = project.findProperty("targetJDK") ?: "11" val tag = findProperty("tag") ?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) +java { + // this is needed to avoid jib failing with + // "Your project is using Java 17 but the base image is for Java 8" + // (it seems the jib plugins does not understand toolchains yet) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + jib { - from.image = "openjdk:$targetJDK" + from.image = "eclipse-temurin:$targetJDK" to.image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-grpc:jdk$targetJDK-$tag" } diff --git a/smoke-tests/images/play/build.gradle.kts b/smoke-tests/images/play/build.gradle.kts index ecf15dd00b..67aa3f5303 100644 --- a/smoke-tests/images/play/build.gradle.kts +++ b/smoke-tests/images/play/build.gradle.kts @@ -29,10 +29,19 @@ dependencies { val targetJDK = project.findProperty("targetJDK") ?: "11" -val tag = findProperty("tag") ?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) +val tag = findProperty("tag") + ?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) + +java { + // this is needed to avoid jib failing with + // "Your project is using Java 17 but the base image is for Java 8" + // (it seems the jib plugins does not understand toolchains yet) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} jib { - from.image = "openjdk:$targetJDK" + from.image = "eclipse-temurin:$targetJDK" to.image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-play:jdk$targetJDK-$tag" container.mainClass = "play.core.server.ProdServerStart" } diff --git a/smoke-tests/images/quarkus/build.gradle.kts b/smoke-tests/images/quarkus/build.gradle.kts index 58b6164e14..658d906ff3 100644 --- a/smoke-tests/images/quarkus/build.gradle.kts +++ b/smoke-tests/images/quarkus/build.gradle.kts @@ -28,10 +28,19 @@ quarkus { val targetJDK = project.findProperty("targetJDK") ?: "11" -val tag = findProperty("tag") ?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) +val tag = findProperty("tag") + ?: DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(LocalDateTime.now()) + +java { + // this is needed to avoid jib failing with + // "Your project is using Java 17 but the base image is for Java 8" + // (it seems the jib plugins does not understand toolchains yet) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} jib { - from.image = "openjdk:$targetJDK" + from.image = "eclipse-temurin:$targetJDK" to.image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-quarkus:jdk$targetJDK-$tag" container { mainClass = "bogus" // to suppress Jib warning about missing main class diff --git a/smoke-tests/images/servlet/build.gradle.kts b/smoke-tests/images/servlet/build.gradle.kts index d531373110..5072ea8303 100644 --- a/smoke-tests/images/servlet/build.gradle.kts +++ b/smoke-tests/images/servlet/build.gradle.kts @@ -134,7 +134,11 @@ fun configureImage(parentTask: TaskProvider, server: String, dockerfil val image = "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-servlet-$server:$version-jdk$jdk$vmSuffix$platformSuffix-$extraTag" val jdkImage = if (vm == "hotspot") { - if (jdk == "19" || jdk == "20") { + if (jdk == "20") { + // "The only tags which will continue to receive updates beyond July 2022 will be Early Access + // builds (which are sourced from jdk.java.net), as those are not published/supported by any + // of the above projects." + // (see https://hub.docker.com/_/openjdk) "openjdk:$jdk" } else { "eclipse-temurin:$jdk"