damondouglas commented on code in PR #32960:
URL: https://github.com/apache/beam/pull/32960#discussion_r1829846595
##########
sdks/python/test-suites/dataflow/common.gradle:
##########
@@ -380,6 +380,51 @@ task validatesContainer() {
}
}
+/**
+ * Validates the distroless
(https://github.com/GoogleContainerTools/distroless) variant of the Python SDK
container
+ * image (sdks/python/container/Dockerfile).
+ * To test a single version of Python:
+ * ./gradlew
:sdks:python:test-suites:dataflow:py311:validatesDistrolessContainer
+ * See
https://cwiki.apache.org/confluence/display/BEAM/Python+Tips#PythonTips-VirtualEnvironmentSetup
+ * for more information on setting up different Python versions.
+ */
+task validatesDistrolessContainer() {
+ def pyversion = "${project.ext.pythonVersion.replace('.', '')}"
+ def buildTarget = 'distroless'
+ def repository = "us.gcr.io/apache-beam-testing/${System.getenv('USER')}"
+ def tag = java.time.Instant.now().getEpochSecond()
+ def imageURL =
"${repository}/beam_python${project.ext.pythonVersion}_sdk_${buildTarget}:${tag}"
+ project.rootProject.ext['docker-repository-root'] = repository
Review Comment:
@Abacn , thank you for meeting with me a couple days back. I realized that
having separate `py<version>-distroless` gradle projects could be avoided with
the logic introduced in container/common.gradle by querying the
`container-build-target` property. Thus, there is no `py<version>-distroless`.
The description has a screenshot in the collapsed markdown of the Dataflow Job
that succeeded with the `validatesDistrolessContainer` task. I don't have the
means while currently on vacation to test again but I (mostly) remember that
the tag is needed to be set on the rootProject level to work.
`validatesDistrolessContainer` should not interfere with other tasks and these
properties should only be set when the task executes, not when it is configured.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]