From a2382ead3ed0feb880956de761975c33055e4ce8 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Tue, 24 Mar 2026 14:25:57 -0400 Subject: [PATCH] Handle Flink 2 job server tag in releases and SDK snapshot --- .github/workflows/finalize_release.yml | 6 ++++++ .../groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy | 7 ++++++- .../job-server-container/flink_job_server_container.gradle | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/finalize_release.yml b/.github/workflows/finalize_release.yml index 0eac53ac02dd..3c50cfed8282 100644 --- a/.github/workflows/finalize_release.yml +++ b/.github/workflows/finalize_release.yml @@ -80,6 +80,12 @@ jobs: docker buildx imagetools create --tag "${IMAGE}:latest" "${IMAGE}:${RELEASE}" done + # Flink 2 images have different tagging, add latest tag to latest supported Flink version + echo "================Confirming Runner container Release and RC version===========" + BEAM_FLINK_REPO=apache/beam_flink_job_server + LATEST_FLINK_VERSION=$(wget -qO- https://raw.githubusercontent.com/apache/beam/refs/tags/v${RELEASE}-RC${RC_NUM}/gradle.properties | grep -E flink_versions | tr ',' '\n' | tail -1) + docker buildx imagetools create --tag "${BEAM_FLINK_REPO}:latest" "${BEAM_FLINK_REPO}:${RELEASE}${RC_VERSION}-flink${LATEST_FLINK_VERSION}" + publish_python_artifacts: if: ${{github.event.inputs.PUBLISH_PYTHON_ARTIFACTS == 'yes'}} runs-on: [self-hosted, ubuntu-20.04, main] diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy index e73d4f1b22d9..6963f96d7313 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy @@ -48,6 +48,7 @@ class BeamDockerPlugin implements Plugin { String dockerComposeFile = 'docker-compose.yml' Set dependencies = [] as Set Set tags = [] as Set + String tagSuffix = null Map namedTags = [:] Map labels = [:] Map buildArgs = [:] @@ -100,7 +101,11 @@ class BeamDockerPlugin implements Plugin { } Set getTags() { - return this.tags + project.getVersion().toString() + def allTags = this.tags + project.getVersion().toString() + if (tagSuffix) { + allTags = allTags.collect { it.endsWith(tagSuffix) ? it : it + tagSuffix }.toSet() + } + return allTags } Set getPlatform() { diff --git a/runners/flink/job-server-container/flink_job_server_container.gradle b/runners/flink/job-server-container/flink_job_server_container.gradle index cf492b469297..ae627aeee376 100644 --- a/runners/flink/job-server-container/flink_job_server_container.gradle +++ b/runners/flink/job-server-container/flink_job_server_container.gradle @@ -55,8 +55,10 @@ task copyDockerfileDependencies(type: Copy) { def pushContainers = project.rootProject.hasProperty(["isRelease"]) || project.rootProject.hasProperty("push-containers") def containerName = project.parent.name.startsWith("2") ? "flink_job_server" : "flink${project.parent.name}_job_server" def containerTag = project.rootProject.hasProperty(["docker-tag"]) ? project.rootProject["docker-tag"] : project.sdk_version +String verInSuffix = null if (project.parent.name.startsWith("2")) { containerTag += "-flink${project.parent.name}" + verInSuffix = "-flink${project.parent.name}" } docker { @@ -68,6 +70,7 @@ docker { tag: containerTag) // tags used by dockerTag task tags containerImageTags() + tagSuffix verInSuffix files "./build/" buildx project.useBuildx() platform(*project.containerPlatforms())