Skip to content

Commit 7187ff6

Browse files
authored
Handle Flink 2 job server tag in releases and SDK snapshot (#37939)
1 parent 4b448b0 commit 7187ff6

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/finalize_release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ jobs:
8080
docker buildx imagetools create --tag "${IMAGE}:latest" "${IMAGE}:${RELEASE}"
8181
done
8282
83+
# Flink 2 images have different tagging, add latest tag to latest supported Flink version
84+
echo "================Confirming Runner container Release and RC version==========="
85+
BEAM_FLINK_REPO=apache/beam_flink_job_server
86+
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)
87+
docker buildx imagetools create --tag "${BEAM_FLINK_REPO}:latest" "${BEAM_FLINK_REPO}:${RELEASE}${RC_VERSION}-flink${LATEST_FLINK_VERSION}"
88+
8389
publish_python_artifacts:
8490
if: ${{github.event.inputs.PUBLISH_PYTHON_ARTIFACTS == 'yes'}}
8591
runs-on: [self-hosted, ubuntu-20.04, main]

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class BeamDockerPlugin implements Plugin<Project> {
4848
String dockerComposeFile = 'docker-compose.yml'
4949
Set<Task> dependencies = [] as Set
5050
Set<String> tags = [] as Set
51+
String tagSuffix = null
5152
Map<String, String> namedTags = [:]
5253
Map<String, String> labels = [:]
5354
Map<String, String> buildArgs = [:]
@@ -100,7 +101,11 @@ class BeamDockerPlugin implements Plugin<Project> {
100101
}
101102

102103
Set<String> getTags() {
103-
return this.tags + project.getVersion().toString()
104+
def allTags = this.tags + project.getVersion().toString()
105+
if (tagSuffix) {
106+
allTags = allTags.collect { it.endsWith(tagSuffix) ? it : it + tagSuffix }.toSet()
107+
}
108+
return allTags
104109
}
105110

106111
Set<String> getPlatform() {

runners/flink/job-server-container/flink_job_server_container.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ task copyDockerfileDependencies(type: Copy) {
5555
def pushContainers = project.rootProject.hasProperty(["isRelease"]) || project.rootProject.hasProperty("push-containers")
5656
def containerName = project.parent.name.startsWith("2") ? "flink_job_server" : "flink${project.parent.name}_job_server"
5757
def containerTag = project.rootProject.hasProperty(["docker-tag"]) ? project.rootProject["docker-tag"] : project.sdk_version
58+
String verInSuffix = null
5859
if (project.parent.name.startsWith("2")) {
5960
containerTag += "-flink${project.parent.name}"
61+
verInSuffix = "-flink${project.parent.name}"
6062
}
6163

6264
docker {
@@ -68,6 +70,7 @@ docker {
6870
tag: containerTag)
6971
// tags used by dockerTag task
7072
tags containerImageTags()
73+
tagSuffix verInSuffix
7174
files "./build/"
7275
buildx project.useBuildx()
7376
platform(*project.containerPlatforms())

0 commit comments

Comments
 (0)