Fix the benchmark job and delete old Python configs (#9497)
Our benchmark job starting failing when we stopped supporting Python 3.5
and 3.6, but this change fixes it by running it in our java_stretch
Docker container, which has a more recent Python version. I also deleted
all configs related to old Python versions that we no longer support.
diff --git a/kokoro/linux/benchmark/build.sh b/kokoro/linux/benchmark/build.sh
index dee7c47..f470989 100755
--- a/kokoro/linux/benchmark/build.sh
+++ b/kokoro/linux/benchmark/build.sh
@@ -1,18 +1,18 @@
#!/bin/bash
#
+# This is the top-level script we give to Kokoro as the entry point for
+# running the "pull request" project:
+#
+# This script selects a specific Dockerfile (for building a Docker image) and
+# a script to run inside that image. Then we delegate to the general
+# build_and_run_docker.sh script.
+
# Change to repo root
cd $(dirname $0)/../../..
-set -ex
-
-# Install openJDK 11 (required by the java benchmarks)
-sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 78BD65473CB3BD13
-sudo add-apt-repository ppa:openjdk-r/ppa
-sudo apt-get update
-sudo apt-get install -y openjdk-11-jdk-headless
-
-# use java 11
-sudo update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64
-java -version
-
-./tests.sh benchmark
+export DOCKERHUB_ORGANIZATION=protobuftesting
+export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch
+export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
+export OUTPUT_DIR=testoutput
+export TEST_SET="benchmark"
+./kokoro/linux/build_and_run_docker.sh
diff --git a/kokoro/linux/benchmark/run.sh b/kokoro/linux/benchmark/run.sh
index acd8737..963f779 100755
--- a/kokoro/linux/benchmark/run.sh
+++ b/kokoro/linux/benchmark/run.sh
@@ -23,7 +23,7 @@
./configure CXXFLAGS="-fPIC -O2"
make -j8
pushd python
-virtualenv -p python3 env
+python3 -m venv env
source env/bin/activate
python3 setup.py build --cpp_implementation
pip3 install --install-option="--cpp_implementation" .
diff --git a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile b/kokoro/linux/dockerfile/test/java_stretch/Dockerfile
index 7e1feea..8eeb6a2 100644
--- a/kokoro/linux/dockerfile/test/java_stretch/Dockerfile
+++ b/kokoro/linux/dockerfile/test/java_stretch/Dockerfile
@@ -11,6 +11,7 @@
build-essential \
bzip2 \
ccache \
+ cmake \
curl \
gcc \
git \
@@ -21,6 +22,7 @@
libtool \
make \
parallel \
+ pkg-config \
time \
wget \
# Java dependencies
@@ -29,6 +31,7 @@
# Required for the gtest build.
python2 \
# Python dependencies
+ python3-dev \
python3-setuptools \
python3-pip \
python3-venv \
diff --git a/kokoro/linux/dockerfile/test/python35/Dockerfile b/kokoro/linux/dockerfile/test/python35/Dockerfile
deleted file mode 100644
index 50ee184..0000000
--- a/kokoro/linux/dockerfile/test/python35/Dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM python:3.5-buster
-
-# Install dependencies. We start with the basic ones require to build protoc
-# and the C++ build
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- gcc \
- git \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- parallel \
- time \
- wget \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/*
-
-# Install Python libraries.
-RUN python -m pip install --no-cache-dir --upgrade \
- pip \
- setuptools \
- tox \
- wheel
diff --git a/kokoro/linux/dockerfile/test/python36/Dockerfile b/kokoro/linux/dockerfile/test/python36/Dockerfile
deleted file mode 100644
index 742503e..0000000
--- a/kokoro/linux/dockerfile/test/python36/Dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM python:3.6-buster
-
-# Install dependencies. We start with the basic ones require to build protoc
-# and the C++ build
-RUN apt-get update && apt-get install -y \
- autoconf \
- autotools-dev \
- build-essential \
- bzip2 \
- ccache \
- curl \
- gcc \
- git \
- libc6 \
- libc6-dbg \
- libc6-dev \
- libgtest-dev \
- libtool \
- make \
- parallel \
- time \
- wget \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/*
-
-# Install Python libraries.
-RUN python -m pip install --no-cache-dir --upgrade \
- pip \
- setuptools \
- tox \
- wheel
diff --git a/kokoro/linux/python27/build.sh b/kokoro/linux/python27/build.sh
deleted file mode 100755
index 41531a1..0000000
--- a/kokoro/linux/python27/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# This is the top-level script we give to Kokoro as the entry point for
-# running the "pull request" project:
-#
-# This script selects a specific Dockerfile (for building a Docker image) and
-# a script to run inside that image. Then we delegate to the general
-# build_and_run_docker.sh script.
-
-# Change to repo root
-cd $(dirname $0)/../../..
-
-export DOCKERHUB_ORGANIZATION=protobuftesting
-export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python27
-export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
-export OUTPUT_DIR=testoutput
-export TEST_SET="python27"
-./kokoro/linux/build_and_run_docker.sh
diff --git a/kokoro/linux/python27/continuous.cfg b/kokoro/linux/python27/continuous.cfg
deleted file mode 100644
index dd98469..0000000
--- a/kokoro/linux/python27/continuous.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python27/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python27/presubmit.cfg b/kokoro/linux/python27/presubmit.cfg
deleted file mode 100644
index dd98469..0000000
--- a/kokoro/linux/python27/presubmit.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python27/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python27_cpp/build.sh b/kokoro/linux/python27_cpp/build.sh
deleted file mode 100755
index 1a972ee..0000000
--- a/kokoro/linux/python27_cpp/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# This is the top-level script we give to Kokoro as the entry point for
-# running the "pull request" project:
-#
-# This script selects a specific Dockerfile (for building a Docker image) and
-# a script to run inside that image. Then we delegate to the general
-# build_and_run_docker.sh script.
-
-# Change to repo root
-cd $(dirname $0)/../../..
-
-export DOCKERHUB_ORGANIZATION=protobuftesting
-export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python27
-export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
-export OUTPUT_DIR=testoutput
-export TEST_SET="python27_cpp"
-./kokoro/linux/build_and_run_docker.sh
diff --git a/kokoro/linux/python27_cpp/continuous.cfg b/kokoro/linux/python27_cpp/continuous.cfg
deleted file mode 100644
index ace22d0..0000000
--- a/kokoro/linux/python27_cpp/continuous.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python27_cpp/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python27_cpp/presubmit.cfg b/kokoro/linux/python27_cpp/presubmit.cfg
deleted file mode 100644
index ace22d0..0000000
--- a/kokoro/linux/python27_cpp/presubmit.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python27_cpp/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python35/build.sh b/kokoro/linux/python35/build.sh
deleted file mode 100755
index 66ea03f..0000000
--- a/kokoro/linux/python35/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# This is the top-level script we give to Kokoro as the entry point for
-# running the "pull request" project:
-#
-# This script selects a specific Dockerfile (for building a Docker image) and
-# a script to run inside that image. Then we delegate to the general
-# build_and_run_docker.sh script.
-
-# Change to repo root
-cd $(dirname $0)/../../..
-
-export DOCKERHUB_ORGANIZATION=protobuftesting
-export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python35
-export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
-export OUTPUT_DIR=testoutput
-export TEST_SET="python35"
-./kokoro/linux/build_and_run_docker.sh
diff --git a/kokoro/linux/python35/continuous.cfg b/kokoro/linux/python35/continuous.cfg
deleted file mode 100644
index 2b3e12c..0000000
--- a/kokoro/linux/python35/continuous.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python35/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python35/presubmit.cfg b/kokoro/linux/python35/presubmit.cfg
deleted file mode 100644
index 2b3e12c..0000000
--- a/kokoro/linux/python35/presubmit.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python35/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python35_cpp/build.sh b/kokoro/linux/python35_cpp/build.sh
deleted file mode 100755
index 4d0dbd4..0000000
--- a/kokoro/linux/python35_cpp/build.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#
-# This is the top-level script we give to Kokoro as the entry point for
-# running the "pull request" project:
-#
-# This script selects a specific Dockerfile (for building a Docker image) and
-# a script to run inside that image. Then we delegate to the general
-# build_and_run_docker.sh script.
-
-# Change to repo root
-cd $(dirname $0)/../../..
-
-export DOCKERHUB_ORGANIZATION=protobuftesting
-export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python35
-export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
-export OUTPUT_DIR=testoutput
-export TEST_SET="python35_cpp"
-./kokoro/linux/build_and_run_docker.sh
diff --git a/kokoro/linux/python35_cpp/continuous.cfg b/kokoro/linux/python35_cpp/continuous.cfg
deleted file mode 100644
index ad5cc86..0000000
--- a/kokoro/linux/python35_cpp/continuous.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python35_cpp/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}
diff --git a/kokoro/linux/python35_cpp/presubmit.cfg b/kokoro/linux/python35_cpp/presubmit.cfg
deleted file mode 100644
index ad5cc86..0000000
--- a/kokoro/linux/python35_cpp/presubmit.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python35_cpp/build.sh"
-timeout_mins: 120
-
-action {
- define_artifacts {
- regex: "**/sponge_log.xml"
- }
-}