Merge pull request #23922 from HannahShiSFB/del-php5-build

PHP: stop testing against PHP5
pull/24085/head
Stanley Cheung 4 years ago committed by GitHub
commit 3b80a96570
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/php/README.md
  2. 2
      src/php/bin/build_all_docker_images.sh
  3. 2
      src/php/bin/run_all_docker_images.sh
  4. 14
      src/php/docker/README.md
  5. 39
      src/php/docker/php5/Dockerfile
  6. 32
      templates/src/php/docker/php5/Dockerfile.template
  7. 23
      templates/tools/dockerfile/interoptest/grpc_interop_php/Dockerfile.template
  8. 11
      templates/tools/dockerfile/php_deps.include
  9. 25
      templates/tools/dockerfile/test/php_jessie_x64/Dockerfile.template
  10. 10
      tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile
  11. 10
      tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile
  12. 11
      tools/dockerfile/grpc_artifact_linux_x64/Dockerfile
  13. 74
      tools/dockerfile/interoptest/grpc_interop_php/Dockerfile
  14. 53
      tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh
  15. 88
      tools/dockerfile/test/php_jessie_x64/Dockerfile
  16. 2
      tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg
  17. 2
      tools/interop_matrix/client_matrix.py
  18. 38
      tools/run_tests/run_interop_tests.py

@ -11,8 +11,7 @@ gRPC PHP installation instructions for Google Cloud Platform is in
### Prerequisites ### Prerequisites
* `php`: version 7.0 or above (PHP 5.x support will be deprecated some time * `php`: version 7.0 or above (PHP 5.x support is deprecated from Sep 2020).
in 2020).
* `pecl` * `pecl`
* `composer` * `composer`
* `phpunit` (optional) * `phpunit` (optional)

@ -16,7 +16,7 @@
set -e set -e
cd $(dirname $0)/../../.. cd $(dirname $0)/../../..
ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php5 php-src php-future php-zts ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts
fork-support i386 ) fork-support i386 )
if [[ "$1" == "--cmds" ]]; then if [[ "$1" == "--cmds" ]]; then

@ -16,7 +16,7 @@
set -e set -e
cd $(dirname $0)/../../.. cd $(dirname $0)/../../..
ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php5 php-src php-future php-zts ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-future php-zts
fork-support i386 ) fork-support i386 )
if [[ "$1" == "--cmds" ]]; then if [[ "$1" == "--cmds" ]]; then

@ -160,24 +160,10 @@ Run image:
```sh ```sh
$ docker run -it --rm grpc-php/php-future $ docker run -it --rm grpc-php/php-future
``` ```
### `php5` ### `php5`
This image builds the `grpc` extension against a PHP 5 base image with ZTS
enabled.
NOTE: PHP 5.x has reached the end-of-life state and is no longer supported. NOTE: PHP 5.x has reached the end-of-life state and is no longer supported.
Build `php5` docker image:
```sh
$ cd grpc
$ docker build -t grpc-php/php5 -f ./src/php/docker/php5/Dockerfile .
```
Run image:
```sh
$ docker run -it --rm grpc-php/php5
```
### `fork-support` ### `fork-support`

@ -1,39 +0,0 @@
# Copyright 2019 gRPC authors.
#
# 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.
FROM php:5.6-zts-stretch
RUN apt-get -qq update && apt-get -qq install -y \
autoconf automake git libtool pkg-config \
valgrind wget zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
WORKDIR /github/grpc
COPY . .
RUN pear package && \
find . -name grpc-*.tgz | xargs -I{} pecl install {}
CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests"]

@ -1,32 +0,0 @@
%YAML 1.2
--- |
# Copyright 2019 gRPC authors.
#
# 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.
FROM php:5.6-zts-stretch
RUN apt-get -qq update && apt-get -qq install -y ${'\\'}
autoconf automake git libtool pkg-config ${'\\'}
valgrind wget zlib1g-dev
ARG MAKEFLAGS=-j8
WORKDIR /tmp
<%include file="../download_phpunit.include" />
<%include file="../pecl_ext_build_src.include" />
CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests"]

@ -1,23 +0,0 @@
%YAML 1.2
--- |
# Copyright 2016 gRPC authors.
#
# 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.
<%include file="../../debian_jessie_header.include"/>
<%include file="../../apt_get_basic.include"/>
<%include file="../../php_deps.include"/>
<%include file="../../run_tests_addons.include"/>
<%include file="../../php_common_deps.include"/>

@ -1,11 +0,0 @@
#=================
# PHP dependencies
# Install dependencies
RUN apt-get update && apt-get install -y ${'\\'}
git php5 php5-dev unzip
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && ${'\\'}
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && ${'\\'}
chmod +x /usr/local/bin/phpunit

@ -1,25 +0,0 @@
%YAML 1.2
--- |
# Copyright 2015 gRPC authors.
#
# 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.
<%include file="../../debian_jessie_header.include"/>
<%include file="../../apt_get_basic.include"/>
<%include file="../../python_deps.include"/>
<%include file="../../gcp_api_libraries.include"/>
<%include file="../../php_deps.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -39,16 +39,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler" RUN /bin/bash -l -c "gem install bundler"
##################
# PHP dependencies
RUN yum -y install php5 php5-dev php-pear
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
# Clean yum # Clean yum
RUN yum clean all RUN yum clean all

@ -39,16 +39,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler" RUN /bin/bash -l -c "gem install bundler"
##################
# PHP dependencies
RUN yum -y install php5 php5-dev php-pear
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
# Clean yum # Clean yum
RUN yum clean all RUN yum clean all

@ -62,17 +62,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document" RUN /bin/bash -l -c "gem install bundler -v 1.17.3 --no-document"
##################
# PHP dependencies
RUN apt-get update && apt-get install -y \
php5 php5-dev php-pear && apt-get clean
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
################## ##################
# C# dependencies (needed to build grpc_csharp_ext) # C# dependencies (needed to build grpc_csharp_ext)

@ -1,74 +0,0 @@
# Copyright 2016 gRPC authors.
#
# 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.
FROM debian:jessie
# Install Git and basic packages.
RUN apt-get update && apt-get install -y \
autoconf \
autotools-dev \
build-essential \
bzip2 \
ccache \
curl \
dnsutils \
gcc \
gcc-multilib \
git \
golang \
gyp \
lcov \
libc6 \
libc6-dbg \
libc6-dev \
libgtest-dev \
libtool \
make \
perl \
strace \
python-dev \
python-setuptools \
python-yaml \
telnet \
unzip \
wget \
zip && apt-get clean
#================
# Build profiling
RUN apt-get update && apt-get install -y time && apt-get clean
#=================
# PHP dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
git php5 php5-dev unzip
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
RUN mkdir /var/local/jenkins
# Install composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
# Define the default command.
CMD ["bash"]

@ -1,53 +0,0 @@
#!/bin/bash
# Copyright 2015 gRPC authors.
#
# 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.
#
# Builds PHP interop server and client in a base image.
set -ex
mkdir -p /var/local/git
git clone /var/local/jenkins/grpc /var/local/git/grpc
# clone gRPC submodules, use data from locally cloned submodules where possible
(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \
&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \
${name}')
# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc
grpc_root="$(pwd)"
# Install gRPC C core
make -j4 shared_c static_c
# Build gRPC PHP native extension
pushd src/php/ext/grpc
phpize
GRPC_LIB_SUBDIR=libs/opt ./configure --enable-grpc="${grpc_root}"
make -j4
popd
cd src/php
DONE=0
for ((i = 0; i < 5; i++)); do
php -d extension=ext/grpc/modules/grpc.so /usr/local/bin/composer install && DONE=1 && break
done
if [ "$DONE" != "1" ]
then
echo "Failed to do composer install"
exit 1
fi

@ -1,88 +0,0 @@
# Copyright 2015 gRPC authors.
#
# 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.
FROM debian:jessie
# Install Git and basic packages.
RUN apt-get update && apt-get install -y \
autoconf \
autotools-dev \
build-essential \
bzip2 \
ccache \
curl \
dnsutils \
gcc \
gcc-multilib \
git \
golang \
gyp \
lcov \
libc6 \
libc6-dbg \
libc6-dev \
libgtest-dev \
libtool \
make \
perl \
strace \
python-dev \
python-setuptools \
python-yaml \
telnet \
unzip \
wget \
zip && apt-get clean
#================
# Build profiling
RUN apt-get update && apt-get install -y time && apt-get clean
#====================
# Python dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
python-all-dev \
python3-all-dev \
python-setuptools
# Install Python packages from PyPI
RUN curl https://bootstrap.pypa.io/get-pip.py | python2.7
RUN pip install --upgrade pip==19.3.1
RUN pip install virtualenv==16.7.9
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 twisted==17.5.0
# Google Cloud platform API libraries
RUN pip install --upgrade google-api-python-client oauth2client
#=================
# PHP dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
git php5 php5-dev unzip
RUN wget https://phar.phpunit.de/phpunit-5.7.27.phar && \
mv phpunit-5.7.27.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
RUN mkdir /var/local/jenkins
# Define the default command.
CMD ["bash"]

@ -26,5 +26,5 @@ action {
env_vars { env_vars {
key: "RUN_TESTS_FLAGS" key: "RUN_TESTS_FLAGS"
value: "-f basictests linux php --inner_jobs 16 -j 2 --internal_ci --max_time=3600" value: "-f basictests linux php7 --inner_jobs 16 -j 2 --internal_ci --max_time=3600"
} }

@ -59,7 +59,7 @@ LANG_RUNTIME_MATRIX = {
'python': ['python', 'pythonasyncio'], 'python': ['python', 'pythonasyncio'],
'node': ['node'], 'node': ['node'],
'ruby': ['ruby'], 'ruby': ['ruby'],
'php': ['php', 'php7'], 'php': ['php7'],
'csharp': ['csharp', 'csharpcoreclr'], 'csharp': ['csharp', 'csharpcoreclr'],
} }

@ -483,35 +483,6 @@ class NodePureJSLanguage:
return 'nodepurejs' return 'nodepurejs'
class PHPLanguage:
def __init__(self):
self.client_cwd = None
self.safename = str(self)
def client_cmd(self, args):
return ['src/php/bin/interop_client.sh'] + args
def cloud_to_prod_env(self):
return {}
def global_env(self):
return {}
def unimplemented_test_cases(self):
return _SKIP_SERVER_COMPRESSION + \
_SKIP_DATA_FRAME_PADDING + \
_SKIP_SPECIAL_STATUS_MESSAGE + \
_SKIP_GOOGLE_DEFAULT_CREDS + \
_SKIP_COMPUTE_ENGINE_CHANNEL_CREDS
def unimplemented_test_cases_server(self):
return []
def __str__(self):
return 'php'
class PHP7Language: class PHP7Language:
def __init__(self): def __init__(self):
@ -734,7 +705,6 @@ _LANGUAGES = {
'javaokhttp': JavaOkHttpClient(), 'javaokhttp': JavaOkHttpClient(),
'node': NodeLanguage(), 'node': NodeLanguage(),
'nodepurejs': NodePureJSLanguage(), 'nodepurejs': NodePureJSLanguage(),
'php': PHPLanguage(),
'php7': PHP7Language(), 'php7': PHP7Language(),
'objc': ObjcLanguage(), 'objc': ObjcLanguage(),
'ruby': RubyLanguage(), 'ruby': RubyLanguage(),
@ -879,7 +849,7 @@ def auth_options(language, test_case, google_default_creds_use_key_file,
if test_case in ['jwt_token_creds', 'per_rpc_creds', 'oauth2_auth_token']: if test_case in ['jwt_token_creds', 'per_rpc_creds', 'oauth2_auth_token']:
if language in [ if language in [
'csharp', 'csharpcoreclr', 'aspnetcore', 'node', 'php', 'php7', 'csharp', 'csharpcoreclr', 'aspnetcore', 'node', 'php7',
'python', 'ruby', 'nodepurejs' 'python', 'ruby', 'nodepurejs'
]: ]:
env['GOOGLE_APPLICATION_CREDENTIALS'] = service_account_key_file env['GOOGLE_APPLICATION_CREDENTIALS'] = service_account_key_file
@ -1161,12 +1131,6 @@ def build_interop_image_jobspec(language, tag=None):
} }
if not args.travis: if not args.travis:
env['TTY_FLAG'] = '-t' env['TTY_FLAG'] = '-t'
# This env variable is used to get around the github rate limit
# error when running the PHP `composer install` command
host_file = '%s/.composer/auth.json' % os.environ['HOME']
if language.safename == 'php' and os.path.exists(host_file):
env['BUILD_INTEROP_DOCKER_EXTRA_ARGS'] = \
'-v %s:/root/.composer/auth.json:ro' % host_file
build_job = jobset.JobSpec( build_job = jobset.JobSpec(
cmdline=['tools/run_tests/dockerize/build_interop_image.sh'], cmdline=['tools/run_tests/dockerize/build_interop_image.sh'],
environ=env, environ=env,

Loading…
Cancel
Save