Skip to content

Commit 1fe0f60

Browse files
committed
fix build; add python 3.13 configs
1 parent 42a2ba9 commit 1fe0f60

File tree

5 files changed

+140
-3
lines changed

5 files changed

+140
-3
lines changed

.kokoro/docker/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ RUN set -ex \
145145
# If the environment variable is called "PIP_VERSION", pip explodes with
146146
# "ValueError: invalid truth value '<VERSION>'"
147147
ENV PYTHON_PIP_VERSION 21.3.1
148-
RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
148+
RUN wget --no-check-certificate -O /tmp/get-pip-3-7.py 'https://bootstrap.pypa.io/pip/3.7/get-pip.py' \
149+
&& wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
149150
&& python3.10 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \
150151
# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python
151152
# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.10/site-packages")
@@ -161,7 +162,7 @@ RUN python3.12 /tmp/get-pip.py
161162
RUN python3.11 /tmp/get-pip.py
162163
RUN python3.9 /tmp/get-pip.py
163164
RUN python3.8 /tmp/get-pip.py
164-
RUN python3.7 /tmp/get-pip.py
165+
RUN python3.7 /tmp/get-pip-3-7.py
165166
RUN rm /tmp/get-pip.py
166167

167168
# Test Pip
@@ -196,7 +197,8 @@ RUN sudo systemctl enable redis-server.service
196197
# Create a user and allow sudo
197198

198199
# kbuilder uid on the default Kokoro image
199-
ARG UID=1000
200+
# UID 1000 is taken in Ubuntu 24.04
201+
ARG UID=10000
200202
ARG USERNAME=kbuilder
201203

202204
# Add a new user to the container image.

.kokoro/python3.13/common.cfg

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
timeout_mins: 300
18+
19+
# Configure the docker image for kokoro-trampoline.
20+
env_vars: {
21+
key: "TRAMPOLINE_IMAGE"
22+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
23+
}
24+
25+
# Download trampoline resources.
26+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
27+
28+
# Use the trampoline script to run in docker.
29+
build_file: "python-docs-samples/.kokoro/trampoline_v2.sh"
30+
31+
# Download secrets from Cloud Storage.
32+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
33+
34+
# Access btlr binaries used in the tests
35+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/btlr"
36+
37+
# Copy results for Resultstore
38+
action {
39+
define_artifacts {
40+
regex: "**/*sponge_log.xml"
41+
}
42+
}
43+
44+
# Specify which tests to run
45+
env_vars: {
46+
key: "RUN_TESTS_SESSION"
47+
value: "py-3.13"
48+
}
49+
50+
# Declare build specific Cloud project. It still uses the common one,
51+
# but we'll update the value once we have more Cloud projects.
52+
env_vars: {
53+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
54+
value: "python-docs-samples-tests-313"
55+
}
56+
57+
# Number of test workers.
58+
env_vars: {
59+
key: "NUM_TEST_WORKERS"
60+
value: "10"
61+
}

.kokoro/python3.13/continuous.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests_diff_head.sh"
21+
}

.kokoro/python3.13/periodic.cfg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests.sh"
21+
}
22+
23+
env_vars: {
24+
key: "REPORT_TO_BUILD_COP_BOT"
25+
value: "false"
26+
}
27+
28+
# Tell Trampoline to upload the Docker image after successfull build.
29+
env_vars: {
30+
key: "TRAMPOLINE_IMAGE_UPLOAD"
31+
value: "true"
32+
}

.kokoro/python3.13/presubmit.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: ".kokoro/tests/run_tests_diff_main.sh"
21+
}

0 commit comments

Comments
 (0)