Abacn commented on code in PR #32960:
URL: https://github.com/apache/beam/pull/32960#discussion_r1828056327


##########
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:
   overwriting root properties may have surprising effect, saying if one 
creates another task that produces container sequentially,
   
   - py39
   - py39-distroless
   - py310
   - py310-distroless
   
   Could it happen that py39-distroless invocation affects the configurations 
for the py310 target? If so is there a way to avoid it?



-- 
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]

Reply via email to