Skip to content

Commit 4a59cb7

Browse files
authored
Fix Post Commit Transform Service (apache#36799)
* Fixed transform service Python container to match test Python version * Fix transform service container Python version
1 parent 4eff179 commit 4a59cb7

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3004,7 +3004,7 @@ class BeamModulePlugin implements Plugin<Project> {
30043004

30053005
// Transform service delivers transforms that refer to SDK harness containers with following sufixes.
30063006
def transformServiceJavaContainerSuffix = 'java11'
3007-
def transformServicePythonContainerSuffix = '310'
3007+
def transformServicePythonContainerSuffix = pythonContainerSuffix
30083008

30093009
def setupTask = project.tasks.register(config.name+"Setup", Exec) {
30103010
// Containers for main SDKs when running tests.

sdks/python/expansion-service-container/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
# We just need to support one Python version supported by Beam.
2020
# Picking the current default Beam Python version which is Python 3.10.
21-
FROM python:3.10-bookworm as expansion-service
21+
ARG py_version=3.10
22+
FROM python:${py_version}-bookworm as expansion-service
2223
LABEL Author "Apache Beam <[email protected]>"
2324
ARG TARGETOS
2425
ARG TARGETARCH

sdks/python/expansion-service-container/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ task copyDockerfileDependencies(type: Copy) {
4040
}
4141

4242
task copyRequirementsFile(type: Copy) {
43-
from project(':sdks:python:container:py39').fileTree("./")
43+
def pythonVersionSuffix = project.ext.pythonVersion.replace('.', '')
44+
from project(":sdks:python:container:py${pythonVersionSuffix}").fileTree("./")
4445
include 'base_image_requirements.txt'
4546
rename 'base_image_requirements.txt', 'requirements.txt'
4647
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
@@ -70,6 +71,7 @@ docker {
7071
// tags used by dockerTag task
7172
tags containerImageTags()
7273
files "./build"
74+
buildArgs(['py_version': "${project.ext.pythonVersion}"])
7375
buildx project.useBuildx()
7476
platform(*project.containerPlatforms())
7577
load project.useBuildx() && !pushContainers

0 commit comments

Comments
 (0)