Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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:12

{% include "../../apt_get_basic.include" %}
{% include "../../run_tests_python_deps_pep668.include" %}
{% include "../../php8_deps.include" %}
{% include "../../php_common_deps.include" %}
{% include "../../cmake.include" %}
{% include "../../ccache.include" %}
{% include "../../run_tests_addons.include" %}
1 change: 1 addition & 0 deletions tools/bazelify_tests/dockerimage_current_versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:c30e8af219aae32f5c682c1027dfceaa489ea412613b151cc351e4c6daa3bb69",
"tools/dockerfile/interoptest/grpc_interop_nodepurejs.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_nodepurejs@sha256:b990c14434ed85caede949170c2f917085166874de34410be2452b9447e42371",
"tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:6cd1cf75b1b2cec360c2e58ac6e5cabbc4ffb3e6403c78cfbfeb40dc500c68e9",
"tools/dockerfile/interoptest/grpc_interop_php8.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php8:3741277163be6f9f3822d11317b558419d0224ed",
"tools/dockerfile/interoptest/grpc_interop_python.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_python@sha256:5759a1299c2c3b20119be2be4da3865eb67d8c1e41bc233a0dd54122a312eaae",
"tools/dockerfile/interoptest/grpc_interop_pythonasyncio.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_pythonasyncio@sha256:9c11f1e1debbc616a65a9e7027d0e9ab4a4374442620e6f24c3ad92a316841a6",
"tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:ec7161bdc8bb835b41e7b655398651685eaf87978de409995f4eb5479d286cac",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:2c85c9be0f09c45bf0e51a7f729389f949f08ed1@sha256:6cd1cf75b1b2cec360c2e58ac6e5cabbc4ffb3e6403c78cfbfeb40dc500c68e9
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:2c85c9be0f09c45bf0e51a7f729389f949f08ed1@sha256:6cd1cf75b1b2cec360c2e58ac6e5cabbc4ffb3e6403c78cfbfeb40dc500c68e9
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ popd

cd src/php

# Configure Composer to not block insecure/vulnerable packages (needed because of
# older firebase/php-jwt in dependencies on PHP 7.4)
php -d extension=ext/grpc/modules/grpc.so /usr/local/bin/composer config audit.block-insecure false || true

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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php8:3741277163be6f9f3822d11317b558419d0224ed
124 changes: 124 additions & 0 deletions tools/dockerfile/interoptest/grpc_interop_php8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# 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:12

#=================
# Basic C core dependencies

# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md
RUN apt-get update && apt-get install -y \
build-essential \
autoconf \
libtool \
pkg-config \
&& apt-get clean

# GCC
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& apt-get clean

# libc6
RUN apt-get update && apt-get install -y \
libc6 \
libc6-dbg \
libc6-dev \
&& apt-get clean

# Tools
RUN apt-get update && apt-get install -y \
bzip2 \
curl \
dnsutils \
git \
lcov \
make \
strace \
time \
unzip \
wget \
zip \
&& apt-get clean

#=================
# Setup git to access working directory across docker boundary.
# This avoids the "fatal: detected dubious ownership in repository XYZ"
# git error.

RUN git config --global --add safe.directory '*'
RUN git config --global protocol.file.allow always


#====================
# run_tests.py python dependencies

# Basic python dependencies to be able to run tools/run_tests python scripts
# These dependencies are not sufficient to build gRPC Python, gRPC Python
# deps are defined elsewhere (e.g. python_deps.include)
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-setuptools \
python3-yaml \
&& apt-get clean

# use pinned version of pip to avoid sudden breakages
# Some newer distros that have already implemented PEP 668. Use of
# --break-system-packages is to workaround that. We should look into using
# virtualenv in Dockerfile though.
RUN python3 -m pip install --break-system-packages --upgrade pip==19.3.1

# TODO(jtattermusch): currently six is needed for tools/run_tests scripts
# but since our python2 usage is deprecated, we should get rid of it.
RUN python3 -m pip install six==1.16.0

# Google Cloud Platform API libraries
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0


#=================
# PHP8 dependencies

RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear && apt-get clean

# Install composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer

#=================
# Install cmake
# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement.

RUN apt-get update && apt-get install -y cmake && apt-get clean

#=================
# Install ccache

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN curl -sSL --fail --retry 5 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.11.3/ccache-4.11.3.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.11.3 \
&& mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.11.3 ccache.tar.gz


RUN mkdir /var/local/jenkins

43 changes: 43 additions & 0 deletions tools/dockerfile/interoptest/grpc_interop_php8/build_interop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# 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.

set -ex

# cd to gRPC root
cd "$(dirname "$0")/../../.."
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
2 changes: 1 addition & 1 deletion tools/run_tests/python_utils/filter_pull_request_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def add_trigger(self, trigger):
_CSHARP_TEST_SUITE = TestSuite(["csharp"])
_NODE_TEST_SUITE = TestSuite(["grpc-node"])
_OBJC_TEST_SUITE = TestSuite(["objc"])
_PHP_TEST_SUITE = TestSuite(["php", "php7"])
_PHP_TEST_SUITE = TestSuite(["php", "php7", "php8"])
_PYTHON_TEST_SUITE = TestSuite(["python"])
_RUBY_TEST_SUITE = TestSuite(["ruby"])
_LINUX_TEST_SUITE = TestSuite(["linux"])
Expand Down
10 changes: 5 additions & 5 deletions tools/run_tests/run_interop_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def __str__(self):
return "nodepurejs"


class PHP7Language:
class PHP8Language:
def __init__(self):
self.client_cwd = None
self.server_cwd = None
Expand Down Expand Up @@ -470,7 +470,7 @@ def unimplemented_test_cases_server(self):
return _SKIP_COMPRESSION + _ORCA_TEST_CASES

def __str__(self):
return "php7"
return "php8"


class ObjcLanguage:
Expand Down Expand Up @@ -694,7 +694,7 @@ def __str__(self):
"javaokhttp": JavaOkHttpClient(),
"node": NodeLanguage(),
"nodepurejs": NodePureJSLanguage(),
"php7": PHP7Language(),
"php8": PHP8Language(),
"objc": ObjcLanguage(),
"ruby": RubyLanguage(),
"python": PythonLanguage(),
Expand All @@ -712,7 +712,7 @@ def __str__(self):
"python",
"dart",
"pythonasyncio",
"php7",
"php8",
]

_TEST_CASES = [
Expand Down Expand Up @@ -886,7 +886,7 @@ def auth_options(
if language in [
"aspnetcore",
"node",
"php7",
"php8",
"python",
"ruby",
"nodepurejs",
Expand Down
1 change: 1 addition & 0 deletions tools/run_tests/sanity/check_test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"objc",
"php",
"php7",
"php8",
"python",
"ruby",
]
Expand Down