diff --git a/.kokoro/samples/lint/presubmit.cfg b/.kokoro/samples/lint/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/lint/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.10/presubmit.cfg b/.kokoro/samples/python3.10/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.10/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.11/continuous.cfg b/.kokoro/samples/python3.11/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.11/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.11/periodic-head.cfg b/.kokoro/samples/python3.11/periodic-head.cfg deleted file mode 100644 index 88d5235e34..0000000000 --- a/.kokoro/samples/python3.11/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.11/presubmit.cfg b/.kokoro/samples/python3.11/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.11/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.12/continuous.cfg b/.kokoro/samples/python3.12/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.12/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.12/periodic-head.cfg b/.kokoro/samples/python3.12/periodic-head.cfg deleted file mode 100644 index 88d5235e34..0000000000 --- a/.kokoro/samples/python3.12/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.12/presubmit.cfg b/.kokoro/samples/python3.12/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.12/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.13/continuous.cfg b/.kokoro/samples/python3.13/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.13/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.13/periodic-head.cfg b/.kokoro/samples/python3.13/periodic-head.cfg deleted file mode 100644 index 88d5235e34..0000000000 --- a/.kokoro/samples/python3.13/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.13/presubmit.cfg b/.kokoro/samples/python3.13/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.13/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.9/common.cfg b/.kokoro/samples/python3.9/common.cfg deleted file mode 100644 index b1b695fdfc..0000000000 --- a/.kokoro/samples/python3.9/common.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Specify which tests to run -env_vars: { - key: "RUN_TESTS_SESSION" - value: "py-3.9" -} - -# Declare build specific Cloud project. -env_vars: { - key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests-py39" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-aiplatform/.kokoro/test-samples.sh" -} - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" -} - -# Download secrets for samples -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "python-aiplatform/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.9/continuous.cfg b/.kokoro/samples/python3.9/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.9/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.9/periodic-head.cfg b/.kokoro/samples/python3.9/periodic-head.cfg deleted file mode 100644 index 88d5235e34..0000000000 --- a/.kokoro/samples/python3.9/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.9/periodic.cfg b/.kokoro/samples/python3.9/periodic.cfg deleted file mode 100644 index 71cd1e597e..0000000000 --- a/.kokoro/samples/python3.9/periodic.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "False" -} diff --git a/.kokoro/samples/python3.9/presubmit.cfg b/.kokoro/samples/python3.9/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.9/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/noxfile.py b/noxfile.py index 5cb6f284ac..291510ff47 100644 --- a/noxfile.py +++ b/noxfile.py @@ -215,6 +215,8 @@ def default(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", f"--junitxml=unit_{session.python}_sponge_log.xml", "--ignore=tests/unit/vertex_ray", @@ -233,6 +235,8 @@ def default(session): # Run tests that require isolation. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", f"--junitxml=unit_{session.python}_test_vertexai_import_sponge_log.xml", os.path.join("tests", "unit", "architecture", "test_vertexai_import.py"), @@ -243,32 +247,11 @@ def default(session): @nox.session(python=UNIT_TEST_PYTHON_VERSIONS) def unit(session): """Run the unit test suite.""" - # First run the minimal GenAI tests - unit_genai_minimal_dependencies(session) # Then run the default full test suite default(session) -def unit_genai_minimal_dependencies(session): - # Install minimal test dependencies, then install this package in-place. - - standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES - session.install(*standard_deps) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - f"--junitxml=unit_{session.python}_sponge_log.xml", - # These tests require the PIL module - # "--ignore=TestGenerativeModels::test_image_mime_types", - os.path.join("tests", "unit", "vertexai", "test_generative_models.py"), - *session.posargs, - ) - - @nox.session(python=["3.10", "3.11"]) @nox.parametrize("ray", ["2.9.3", "2.33.0", "2.42.0", "2.47.1"]) def unit_ray(session, ray): @@ -288,6 +271,8 @@ def unit_ray(session, ray): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", f"--junitxml=unit_ray_{ray}_py_{session.python}_sponge_log.xml", "--cov=google", @@ -314,6 +299,8 @@ def unit_agentplatform_adk(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_agentplatform_adk_sponge_log.xml", "--cov=google", @@ -342,6 +329,8 @@ def unit_agentplatform_langchain(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_agentplatform_langchain_sponge_log.xml", "--cov=google", @@ -381,6 +370,8 @@ def unit_agentplatform_ag2(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_agentplatform_ag2_sponge_log.xml", "--cov=google", @@ -411,6 +402,8 @@ def unit_agentplatform_llama_index(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_agentplatform_llama_index_sponge_log.xml", "--cov=google", @@ -443,6 +436,8 @@ def unit_langchain(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_langchain_sponge_log.xml", "--cov=google", @@ -469,6 +464,8 @@ def unit_ag2(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_ag2_sponge_log.xml", "--cov=google", @@ -497,6 +494,8 @@ def unit_llama_index(session): # Run py.test against the unit tests. session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", "--junitxml=unit_llama_index_sponge_log.xml", "--cov=google", @@ -567,6 +566,8 @@ def system(session): if system_test_exists: session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--quiet", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_path, @@ -575,6 +576,8 @@ def system(session): if system_test_folder_exists: session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "-v", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_folder_path, @@ -776,6 +779,8 @@ def prerelease_deps(session): session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--ignore=tests/unit/vertexai/genai/replays", "--ignore=tests/unit/agentplatform/genai/replays", "tests/unit", @@ -788,6 +793,8 @@ def prerelease_deps(session): if os.path.exists(system_test_path): session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--verbose", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_path, @@ -796,6 +803,8 @@ def prerelease_deps(session): if os.path.exists(system_test_folder_path): session.run( "py.test", + "-n", + "auto", # Use all available CPU cores "--verbose", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_folder_path, diff --git a/owlbot.py b/owlbot.py index cf7ec5a176..7e9f3ada9d 100644 --- a/owlbot.py +++ b/owlbot.py @@ -118,18 +118,16 @@ ".kokoro/release.sh", ".kokoro/release/common.cfg", ".kokoro/requirements*", + # exclude sample configs so they are tested against main + # instead of pypi + ".kokoro/samples/lint/**", ".kokoro/samples/python3.7/**", ".kokoro/samples/python3.8/**", - # exclude sample configs so periodic samples are tested against main - # instead of pypi - ".kokoro/samples/python3.10/common.cfg", - ".kokoro/samples/python3.11/common.cfg", - ".kokoro/samples/python3.12/common.cfg", - ".kokoro/samples/python3.13/common.cfg", - ".kokoro/samples/python3.10/periodic.cfg", - ".kokoro/samples/python3.11/periodic.cfg", - ".kokoro/samples/python3.12/periodic.cfg", - ".kokoro/samples/python3.13/periodic.cfg", + ".kokoro/samples/python3.9/**", + ".kokoro/samples/python3.10/**", + ".kokoro/samples/python3.11/**", + ".kokoro/samples/python3.12/**", + ".kokoro/samples/python3.13/**", ".github/auto-label.yaml", ".github/blunderbuss.yml", ".github/CODEOWNERS",