You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2025/01/15 19:39:27 UTC
(beam) branch fix-py-vc-dataflow updated: Use run_validatescontainer.sh with IMAGE_SUFFIX env
This is an automated email from the ASF dual-hosted git repository.
damondouglas pushed a commit to branch fix-py-vc-dataflow
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/fix-py-vc-dataflow by this push:
new dfe2dd3b265 Use run_validatescontainer.sh with IMAGE_SUFFIX env
dfe2dd3b265 is described below
commit dfe2dd3b265505d3c1159db6f9fb3d25c0f90f94
Author: Damon <da...@users.noreply.github.com>
AuthorDate: Wed Jan 15 11:39:19 2025 -0800
Use run_validatescontainer.sh with IMAGE_SUFFIX env
---
sdks/python/test-suites/dataflow/common.gradle | 45 ++++++++------------------
1 file changed, 14 insertions(+), 31 deletions(-)
diff --git a/sdks/python/test-suites/dataflow/common.gradle b/sdks/python/test-suites/dataflow/common.gradle
index 0b02baa5348..766be5e95c5 100644
--- a/sdks/python/test-suites/dataflow/common.gradle
+++ b/sdks/python/test-suites/dataflow/common.gradle
@@ -381,40 +381,23 @@ task validatesContainer() {
}
task validatesDistrolessContainer() {
- def pyversion = "${project.ext.pythonVersion.replace('.', '')}"
- dependsOn ":sdks:python:container:distroless:py${pyversion}:dockerPush"
-
- def name = project.docker_image_default_repo_prefix + "python${project.ext.pythonVersion}_sdk_distroless"
-
- def root = project.rootProject.hasProperty(["docker-repository-root"]) ?
- project.rootProject["docker-repository-root"] :
- project.docker_image_default_repo_root
-
- def tag = project.rootProject.hasProperty(["docker-tag"]) ?
- project.rootProject["docker-tag"] : project.sdk_version
-
- def imageURL = containerImageName(
- name: name,
- root: root,
- tag: tag)
-
+ def pyversion = "${project.ext.pythonVersion.replace('.', '')}"
+ if (project.hasProperty("testRCDependencies")) {
+ // Generate a requirements file with pre-release versions for the docker task
+ // if testing with pre-release dependencies.
+ dependsOn ":sdks:python:container:py${pyversion}:generatePythonRequirements"
+ mustRunAfter ":sdks:python:container:py${pyversion}:generatePythonRequirements"
+ }
+ dependsOn 'initializeForDataflowJob'
+ dependsOn ":sdks:python:container:distroless:py${pyversion}:docker"
+ def runScriptsPath = "${rootDir}/sdks/python/container/run_validatescontainer.sh"
doLast {
exec {
- def testTarget = "apache_beam/examples/wordcount_it_test.py::WordCountIT::test_wordcount_it"
- def argMap = [
- "output" : "gs://temp-storage-for-end-to-end-tests/py-it-cloud/output",
- "project" : "apache-beam-testing",
- "region" : "us-central1",
- "runner" : "TestDataflowRunner",
- "sdk_container_image": "${imageURL}",
- "sdk_location" : "container",
- "staging_location" : "gs://temp-storage-for-end-to-end-tests/staging-it",
- "temp_location" : "gs://temp-storage-for-end-to-end-tests/temp-it",
- ]
- def cmdArgs = mapToArgString(argMap)
- workingDir = "${rootDir}/sdks/python"
+ environment 'IMAGE_SUFFIX' '_distroless'
executable 'sh'
- args '-c', ". ${envdir}/bin/activate && pytest ${testTarget} --test-pipeline-options=\"${cmdArgs}\""
+ args '-c', ". ${envdir}/bin/activate && cd ${rootDir} && ${runScriptsPath} " +
+ "${project.ext.pythonVersion} " +
+ "${project.ext.sdkLocation}"
}
}
}