Skip to content

Commit d51deb4

Browse files
author
Takashi Matsuo
authored
testing: update the python versions in the Dockerfile (#4123)
* testing: update the python versions in the Dockerfile also enable the Docker image upload in python 3.8 periodic build. * use Python 2.7.18 * ensure build failure upon signature verification failure
1 parent 1a681d8 commit d51deb4

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

.kokoro/docker/Dockerfile

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
9292
&& rm -f /var/cache/apt/archives/*.deb
9393

9494
# Install the desired versions of Python.
95-
RUN for PYTHON_VERSION in 2.7.17 3.6.9 3.7.5 3.8.0; do \
96-
set -ex \
97-
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
98-
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
95+
RUN set -ex \
9996
&& export GNUPGHOME="$(mktemp -d)" \
10097
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
10198
# 2.7.17 (Benjamin Peterson)
@@ -106,23 +103,27 @@ RUN for PYTHON_VERSION in 2.7.17 3.6.9 3.7.5 3.8.0; do \
106103
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D \
107104
# 3.8.0 (Łukasz Langa)
108105
E3FF2839C048B25C084DEBE9B26995E310250568 \
109-
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
110-
&& rm -r "$GNUPGHOME" python-${PYTHON_VERSION}.tar.xz.asc \
111-
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
112-
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
113-
&& rm python-${PYTHON_VERSION}.tar.xz \
114-
&& cd /usr/src/python-${PYTHON_VERSION} \
115-
&& ./configure \
116-
--enable-shared \
117-
# This works only on Python 2.7 and throws a warning on every other
118-
# version, but seems otherwise harmless.
119-
--enable-unicode=ucs4 \
120-
--with-system-ffi \
121-
--without-ensurepip \
122-
&& make -j$(nproc) \
123-
&& make install \
124-
&& ldconfig \
106+
&& for PYTHON_VERSION in 2.7.18 3.6.10 3.7.7 3.8.3; do \
107+
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
108+
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
109+
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
110+
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
111+
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
112+
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
113+
&& rm python-${PYTHON_VERSION}.tar.xz \
114+
&& cd /usr/src/python-${PYTHON_VERSION} \
115+
&& ./configure \
116+
--enable-shared \
117+
# This works only on Python 2.7 and throws a warning on every other
118+
# version, but seems otherwise harmless.
119+
--enable-unicode=ucs4 \
120+
--with-system-ffi \
121+
--without-ensurepip \
122+
&& make -j$(nproc) \
123+
&& make install \
124+
&& ldconfig \
125125
; done \
126+
&& rm -r "${GNUPGHOME}" \
126127
&& rm -rf /usr/src/python* \
127128
&& rm -rf ~/.cache/
128129

.kokoro/python3.8/periodic.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ env_vars: {
2424
key: "REPORT_TO_BUILD_COP_BOT"
2525
value: "true"
2626
}
27+
28+
# Tell Trampoline to upload the Docker image after successfull build.
29+
env_vars: {
30+
key: "TRAMPOLINE_IMAGE_UPLOAD"
31+
value: "true"
32+
}

0 commit comments

Comments
 (0)