Skip to content

Commit

Permalink
chore: add kokoro 3.9 configs (#175)
Browse files Browse the repository at this point in the history
This will be blocked until 

- [x] [this synthtool PR](https://github.com/googleapis/synthtool/pull/909/files) is merged 
and 
- [ ] [we run synth here](#6) (I rechecked the box to regen the PR on Friday 1/15 at 5:30pm pacific) 

Internal CL352076910 adds 3.6, 3.8, and 3.9 internal configs (3.7 is already set up)
  • Loading branch information
leahecole committed Jul 29, 2021
1 parent e346117 commit ab6d451
Show file tree
Hide file tree
Showing 14 changed files with 172 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
@@ -1,3 +1,3 @@
docker:
image: gcr.io/repo-automation-bots/owlbot-python:latest
digest: sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605
digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b
12 changes: 6 additions & 6 deletions .kokoro/samples/python3.6/common.cfg
Expand Up @@ -7,18 +7,18 @@ action {
}
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.6"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/test-samples.sh"
Expand Down
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.6/periodic-head.cfg
@@ -0,0 +1,11 @@
# 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"
}
12 changes: 6 additions & 6 deletions .kokoro/samples/python3.7/common.cfg
Expand Up @@ -7,18 +7,18 @@ action {
}
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.7"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-aiplatform/.kokoro/test-samples.sh"
Expand Down
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.7/periodic-head.cfg
@@ -0,0 +1,11 @@
# 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"
}
12 changes: 3 additions & 9 deletions .kokoro/samples/python3.8/common.cfg
Expand Up @@ -7,22 +7,16 @@ action {
}
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.8"
}

# Run tests located under tests/system
# Declare build specific Cloud project.
env_vars: {
key: "RUN_SYSTEM_TESTS"
value: "true"
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}

env_vars: {
Expand Down
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.8/periodic-head.cfg
@@ -0,0 +1,11 @@
# 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"
}
40 changes: 40 additions & 0 deletions .kokoro/samples/python3.9/common.cfg
@@ -0,0 +1,40 @@
# 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: "ucaip-sample-tests"
}

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.sh"
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/continuous.cfg
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.9/periodic-head.cfg
@@ -0,0 +1,11 @@
# 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"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/periodic.cfg
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.9/presubmit.cfg
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
13 changes: 12 additions & 1 deletion owlbot.py
Expand Up @@ -80,10 +80,21 @@
templated_files,
excludes=[
".coveragerc",
".kokoro/samples/**"
]
) # the microgenerator has a good coveragerc file

# Update samples config to use `ucaip-sample-tests` project
s.replace(".kokoro/samples/python3.*/common.cfg",
"""env_vars: \{
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py3.*?"
\}""",
"""env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "ucaip-sample-tests"
}"""
)

# Don't treat docs warnings as errors
s.replace("noxfile.py", """["']-W["'], # warnings as errors""", "")

Expand Down
42 changes: 42 additions & 0 deletions samples/model-builder/noxfile_config.py
@@ -0,0 +1,42 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Default TEST_CONFIG_OVERRIDE for python repos.

# You can copy this file into your directory, then it will be imported from
# the noxfile.py.

# The source of truth:
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
# An envvar key for determining the project id to use. Change it
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
# build specific Cloud project. You can also use your own string
# to use your own Cloud project.
# "gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
# If you need to use a specific version of pip,
# change pip_version_override to the string representation
# of the version number, for example, "20.2.4"
"pip_version_override": None,
# A dictionary you want to inject into your test. Don't put any
# secrets here. These values will override predefined values.
"envs": {},
}

0 comments on commit ab6d451

Please sign in to comment.