[PHP/CI] Upgraded PHP docker images (#37895)

This aims to resolve segfaults encountered when rebuilding ARM64 PHP Docker images. This segfaults came from gcc during ARM64 builds using QEMU. To workaround this problem, the PHP Docker images have been restructured to use apt-get for installation, thereby avoiding the use of gcc. This also needed to upgrade  Debian and PHP to their latest versions, aligning with our minimum supported PHP 8.

Closes #37895

PiperOrigin-RevId: 686162640
pull/37633/head^2
Esun Kim 3 months ago committed by Copybara-Service
parent df0b1dfed8
commit 78f1235831
  1. 24
      templates/tools/dockerfile/php7_deps.include
  2. 8
      templates/tools/dockerfile/test/php8_debian12_arm64/Dockerfile.template
  3. 8
      templates/tools/dockerfile/test/php8_debian12_x64/Dockerfile.template
  4. 19
      templates/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile.template
  5. 10
      tools/bazelify_tests/dockerimage_current_versions.bzl
  6. 16
      tools/bazelify_tests/test/BUILD
  7. 1
      tools/dockerfile/distribtest/php7_debian11_x64.current_version
  8. 1
      tools/dockerfile/distribtest/php8_debian12_x64.current_version
  9. 6
      tools/dockerfile/distribtest/php8_debian12_x64/Dockerfile
  10. 2
      tools/dockerfile/interoptest/grpc_interop_php7.current_version
  11. 24
      tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile
  12. 1
      tools/dockerfile/test/php73_zts_debian11_x64.current_version
  13. 1
      tools/dockerfile/test/php7_debian11_arm64.current_version
  14. 1
      tools/dockerfile/test/php7_debian11_x64.current_version
  15. 1
      tools/dockerfile/test/php8_debian12_arm64.current_version
  16. 50
      tools/dockerfile/test/php8_debian12_arm64/Dockerfile
  17. 1
      tools/dockerfile/test/php8_debian12_x64.current_version
  18. 50
      tools/dockerfile/test/php8_debian12_x64/Dockerfile
  19. 1
      tools/dockerfile/test/php8_zts_debian12_x64.current_version
  20. 35
      tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile
  21. 2
      tools/internal_ci/linux/arm64/grpc_basictests_php.cfg
  22. 2
      tools/internal_ci/linux/grpc_basictests_php.cfg
  23. 2
      tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg
  24. 2
      tools/internal_ci/macos/grpc_basictests_php.cfg
  25. 2
      tools/internal_ci/macos/pull_request/grpc_basictests_php.cfg
  26. 2
      tools/run_tests/artifacts/artifact_targets.py
  27. 16
      tools/run_tests/artifacts/distribtest_targets.py
  28. 8
      tools/run_tests/run_tests.py
  29. 4
      tools/run_tests/run_tests_matrix.py

@ -1,26 +1,4 @@
#=================
# PHP7 dependencies
# PHP specific dependencies
RUN apt-get update && apt-get install -y ${'\\'}
libbison-dev ${'\\'}
libcurl4-openssl-dev ${'\\'}
libgmp-dev ${'\\'}
libgmp3-dev ${'\\'}
libssl-dev ${'\\'}
libxml2-dev ${'\\'}
re2c ${'\\'}
zlib1g-dev ${'\\'}
&& apt-get clean
# Compile PHP7 from source
RUN git clone https://github.com/php/php-src /var/local/git/php-src
RUN cd /var/local/git/php-src ${'\\'}
&& git checkout PHP-7.2.34 ${'\\'}
&& ./buildconf --force ${'\\'}
&& ./configure ${'\\'}
--with-gmp ${'\\'}
--with-openssl ${'\\'}
--with-zlib ${'\\'}
&& make -j$(nproc) ${'\\'}
&& make install
RUN apt-get update && apt-get install -y php7.4 php-pear && apt-get clean

@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:11
FROM arm64v8/debian:12
<%include file="../../apt_get_basic.include"/>
<%include file="../../run_tests_python_deps.include"/>
<%include file="../../php7_deps.include"/>
<%include file="../../run_tests_python_deps_pep668.include"/>
RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear && apt-get clean
<%include file="../../php_valgrind.include"/>
<%include file="../../cmake.include"/>
<%include file="../../ccache.include"/>
RUN apt-get update && apt-get install -y ccache && apt-get clean
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM arm64v8/debian:11
FROM debian:12
<%include file="../../apt_get_basic.include"/>
<%include file="../../run_tests_python_deps.include"/>
<%include file="../../php7_deps.include"/>
<%include file="../../run_tests_python_deps_pep668.include"/>
RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear && apt-get clean
<%include file="../../php_valgrind.include"/>
<%include file="../../cmake.include"/>
<%include file="../../ccache.include"/>
RUN apt-get update && apt-get install -y ccache && apt-get clean
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -14,8 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# debian 11 = "bullseye"
FROM php:7.3-zts-bullseye
FROM php:8-zts-bookworm
RUN apt-get update && apt-get install -y ${'\\'}
autoconf automake build-essential git libtool curl ${'\\'}
@ -23,22 +22,10 @@
&& apt-get clean
<%include file="../../git_avoid_dubious_ownership_error.include"/>
# install php pthreads from source
# TODO(jtattermusch): is this really needed?
# See https://github.com/grpc/grpc/pull/23056
WORKDIR /tmp
RUN git clone https://github.com/krakjoe/pthreads
RUN cd pthreads && ${'\\'}
phpize && ${'\\'}
./configure && ${'\\'}
make && ${'\\'}
make install
<%include file="../../run_tests_python_deps.include"/>
<%include file="../../run_tests_python_deps_pep668.include"/>
<%include file="../../php_common_deps.include"/>
<%include file="../../cmake.include"/>
<%include file="../../ccache.include"/>
RUN apt-get update && apt-get install -y ccache && apt-get clean
<%include file="../../run_tests_addons.include"/>
<%include file="../../xds_interop_deps.include"/>

@ -35,7 +35,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/distribtest/csharp_dotnet31_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64@sha256:b7afb4aa2f4ac65df757eb42fa78ee105fdde856feda0a9deeb5afedf87a5410",
"tools/dockerfile/distribtest/csharp_dotnet5_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64@sha256:004e02902825b54c7f0d60eaed0819acf6f10c24853bf8f793001114e9969abd",
"tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64@sha256:a439f2ccbc666f231e511a8e58eb7f66a3de4820a4d5aded1e62275cf8ac49f0",
"tools/dockerfile/distribtest/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:e74902d75c5d0afdfb29f2f6200ef3e1b406cf4975c6a3a9a058ab101b004c7e",
"tools/dockerfile/distribtest/php8_debian12_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64@sha256:42399d061f234ee0ef79b333555db0e11ca4f106bb1d49276abf99c459c104f0",
"tools/dockerfile/distribtest/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:d7232ef55c81d125b66899b908668156638cd2cfc5b119083eceacb6018da7e4",
"tools/dockerfile/distribtest/python_arch_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_arch_x64@sha256:2c1adadeb010e107132cf5137f32a2d18727796631245b110cc74f69c07502e1",
"tools/dockerfile/distribtest/python_bullseye_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_bullseye_x64@sha256:80553398f0c59c1dc186052f4f2deaf18fea582f6d1d166eec6ea298639031fb",
@ -82,7 +82,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/interoptest/grpc_interop_java.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_java@sha256:6c0319bbbf77d6c198f61adf92d205efd33cbd2cccaf914a1af8f2dcb61b16a1",
"tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:549a7683cc024fb7ffee807eaa8acb6c2d5a5dd0184a2590f91852804eea39a4",
"tools/dockerfile/interoptest/grpc_interop_nodepurejs.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_nodepurejs@sha256:62f148c4e8b031d02d445e993a840c53eb61566ad0bc007f1d89a3387d1f73a7",
"tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:f1d2075309ae93c1da7ed3230899ac934ce8f0cdb0bc3694c6b1a9cf8a314ef3",
"tools/dockerfile/interoptest/grpc_interop_php7.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7@sha256:eea8738f0aa1b6bbd56b847cbdfd0e0b98a46306d86db2494557f25c334abe4d",
"tools/dockerfile/interoptest/grpc_interop_python.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_python@sha256:b3e62554f360f18672711affb79c509a80083a1ddb8e5221bd3b9823a596d0fb",
"tools/dockerfile/interoptest/grpc_interop_pythonasyncio.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_pythonasyncio@sha256:c349c6e92d32f42e619134ef34d6d33e33e0aa106ea66388b2c22e4231a7baa6",
"tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:ce9539e9068b2597d5d43dc2bb7df17b84fd8192759cf7a02132b676ca6fa4ed",
@ -103,9 +103,9 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"tools/dockerfile/test/cxx_gcc_12_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_12_x64@sha256:bbdfe66f27b964f9bfd526646b94a19d904fea52bdb244f32fd4355cc8c4551f",
"tools/dockerfile/test/cxx_gcc_7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_7_x64@sha256:e1925d7f08a7f167c6aab2f8284a3f13b7f3830ba38876e6de1dee2ffd3c7d2f",
"tools/dockerfile/test/cxx_gcc_8_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_gcc_8_x64@sha256:19511527fc3da78344a7ece5f1cf8ba06d928202ba5b3ca039dccb86d1a417fc",
"tools/dockerfile/test/php73_zts_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php73_zts_debian11_x64@sha256:186a96566a9c11adfb198309431086bdb02421121c262a2bf0166e3e9b21fb37",
"tools/dockerfile/test/php7_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64@sha256:7ee21f253a2ddd255f4f6779cd19818eec6524e78b0bf0a7765339e4aa7347c3",
"tools/dockerfile/test/php7_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64@sha256:34b02fd66832ebf49601bef95632753e6710a75755401c21332d50056ccd52d2",
"tools/dockerfile/test/php8_debian12_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_arm64@sha256:c220e72b415ad194a41cf5640fe360b9358df1dd34553c8d8e6bfd4a82e032b3",
"tools/dockerfile/test/php8_debian12_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64@sha256:18bf37f80415ce3ddd48261b0ef97b421a85646cc15bd21348e19b5fd7b191d6",
"tools/dockerfile/test/php8_zts_debian12_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php8_zts_debian12_x64@sha256:911241a4e38046b603245d56a1ca9491e81990ca9dedb0671e41b15387e3d2ee",
"tools/dockerfile/test/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:0a4e3c166fb676d85ea26d9fffec3858d59a2f243a3acc1c2f9bd293a590a98c",
"tools/dockerfile/test/python_debian11_default_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_arm64@sha256:fccca33a655c7aa89dd7ebd9492cbcc1f636bd2a004cd939d1982cfce3d68326",
"tools/dockerfile/test/python_debian11_default_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_debian11_default_x64@sha256:8beca964d6bbb80a8cb4c4628c25e9702b007c97113e74e589fa50c15000738d",

@ -91,18 +91,18 @@ grpc_run_tests_harness_test(
name = "runtests_php_linux_dbg",
size = "enormous",
args = [
"-l php7 -c dbg",
"-l php8 -c dbg",
],
docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version",
docker_image_version = "tools/dockerfile/test/php8_debian12_x64.current_version",
)
grpc_run_tests_harness_test(
name = "runtests_php_linux_opt",
size = "enormous",
args = [
"-l php7 -c opt",
"-l php8 -c opt",
],
docker_image_version = "tools/dockerfile/test/php7_debian11_x64.current_version",
docker_image_version = "tools/dockerfile/test/php8_debian12_x64.current_version",
)
# Python
@ -263,7 +263,7 @@ grpc_build_artifact_task(
grpc_build_artifact_task(
name = "artifact_php_linux_x64",
build_script = "build_artifact_php_linux.sh",
docker_image_version = "tools/dockerfile/test/php73_zts_debian11_x64.current_version",
docker_image_version = "tools/dockerfile/test/php8_zts_debian12_x64.current_version",
)
# Python artifact build tasks
@ -374,20 +374,20 @@ test_suite(
# PHP distribtests
grpc_run_distribtest_test(
name = "distribtest_php_linux_x64_debian11",
name = "distribtest_php_linux_x64_debian12",
size = "enormous",
artifact_deps = [
"artifact_php_linux_x64",
],
build_script = "run_distribtest_php_linux.sh",
docker_image_version = "tools/dockerfile/distribtest/php7_debian11_x64.current_version",
docker_image_version = "tools/dockerfile/distribtest/php8_debian12_x64.current_version",
docker_run_as_root = True,
)
test_suite(
name = "php_distribtests_linux",
tests = [
":distribtest_php_linux_x64_debian11",
":distribtest_php_linux_x64_debian12",
],
)

@ -1 +0,0 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64:0892cfafba20a8acae4db3272c4497c41cd627d2@sha256:e74902d75c5d0afdfb29f2f6200ef3e1b406cf4975c6a3a9a058ab101b004c7e

@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64:ad7c918a103618ebc381e741e3c2e527cc22ba85@sha256:42399d061f234ee0ef79b333555db0e11ca4f106bb1d49276abf99c459c104f0

@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:11
FROM debian:12
RUN apt-get update && apt-get install -y php php-dev php-pear wget zlib1g-dev
RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear wget zlib1g-dev
RUN wget https://phar.phpunit.de/phpunit-8.5.8.phar && \
mv phpunit-8.5.8.phar /usr/local/bin/phpunit && \
chmod +x /usr/local/bin/phpunit
chmod +x /usr/local/bin/phpunit

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:89c31e58498f75173cfe6252758fb2dd1747bb16@sha256:f1d2075309ae93c1da7ed3230899ac934ce8f0cdb0bc3694c6b1a9cf8a314ef3
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:014312df740258cb5c282375a550a7d075192c7e@sha256:eea8738f0aa1b6bbd56b847cbdfd0e0b98a46306d86db2494557f25c334abe4d

@ -90,29 +90,7 @@ RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-clien
#=================
# PHP7 dependencies
# PHP specific dependencies
RUN apt-get update && apt-get install -y \
libbison-dev \
libcurl4-openssl-dev \
libgmp-dev \
libgmp3-dev \
libssl-dev \
libxml2-dev \
re2c \
zlib1g-dev \
&& apt-get clean
# Compile PHP7 from source
RUN git clone https://github.com/php/php-src /var/local/git/php-src
RUN cd /var/local/git/php-src \
&& git checkout PHP-7.2.34 \
&& ./buildconf --force \
&& ./configure \
--with-gmp \
--with-openssl \
--with-zlib \
&& make -j$(nproc) \
&& make install
RUN apt-get update && apt-get install -y php7.4 php-pear && apt-get clean
# Install composer
RUN curl -sS https://getcomposer.org/installer | php

@ -1 +0,0 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php73_zts_debian11_x64:77e07cf8904ccf92e13aa688cef73e5c93bb6879@sha256:186a96566a9c11adfb198309431086bdb02421121c262a2bf0166e3e9b21fb37

@ -1 +0,0 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64:ce0c5318a40ebe3dd48d15ef85ce745747b8d327@sha256:7ee21f253a2ddd255f4f6779cd19818eec6524e78b0bf0a7765339e4aa7347c3

@ -1 +0,0 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64:5f152d5c34650064da2f21b10f5d63b8774753e0@sha256:34b02fd66832ebf49601bef95632753e6710a75755401c21332d50056ccd52d2

@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_arm64:9675eaaef7dd455bce74b806d7f86d341e0ae024@sha256:c220e72b415ad194a41cf5640fe360b9358df1dd34553c8d8e6bfd4a82e032b3

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:11
FROM arm64v8/debian:12
#=================
# Basic C core dependencies
@ -76,7 +76,10 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean
# use pinned version of pip to avoid sudden breakages
RUN python3 -m pip install --upgrade pip==19.3.1
# 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.
@ -87,33 +90,7 @@ RUN python3 -m pip install six==1.16.0
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
#=================
# PHP7 dependencies
# PHP specific dependencies
RUN apt-get update && apt-get install -y \
libbison-dev \
libcurl4-openssl-dev \
libgmp-dev \
libgmp3-dev \
libssl-dev \
libxml2-dev \
re2c \
zlib1g-dev \
&& apt-get clean
# Compile PHP7 from source
RUN git clone https://github.com/php/php-src /var/local/git/php-src
RUN cd /var/local/git/php-src \
&& git checkout PHP-7.2.34 \
&& ./buildconf --force \
&& ./configure \
--with-gmp \
--with-openssl \
--with-zlib \
&& make -j$(nproc) \
&& make install
RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear && apt-get clean
#=================
# PHP Test dependencies
@ -125,20 +102,7 @@ RUN cd /var/local/git/php-src \
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 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.7.5 \
&& 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.7.5 ccache.tar.gz
RUN apt-get update && apt-get install -y ccache && apt-get clean
RUN mkdir /var/local/jenkins

@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64:8e63aea32d0c1d3b6fcf5354d43e2a81dd29b1c1@sha256:18bf37f80415ce3ddd48261b0ef97b421a85646cc15bd21348e19b5fd7b191d6

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM arm64v8/debian:11
FROM debian:12
#=================
# Basic C core dependencies
@ -76,7 +76,10 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean
# use pinned version of pip to avoid sudden breakages
RUN python3 -m pip install --upgrade pip==19.3.1
# 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.
@ -87,33 +90,7 @@ RUN python3 -m pip install six==1.16.0
RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0
#=================
# PHP7 dependencies
# PHP specific dependencies
RUN apt-get update && apt-get install -y \
libbison-dev \
libcurl4-openssl-dev \
libgmp-dev \
libgmp3-dev \
libssl-dev \
libxml2-dev \
re2c \
zlib1g-dev \
&& apt-get clean
# Compile PHP7 from source
RUN git clone https://github.com/php/php-src /var/local/git/php-src
RUN cd /var/local/git/php-src \
&& git checkout PHP-7.2.34 \
&& ./buildconf --force \
&& ./configure \
--with-gmp \
--with-openssl \
--with-zlib \
&& make -j$(nproc) \
&& make install
RUN apt-get update && apt-get install -y php8.2 php8.2-dev php-pear && apt-get clean
#=================
# PHP Test dependencies
@ -125,20 +102,7 @@ RUN cd /var/local/git/php-src \
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 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.7.5 \
&& 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.7.5 ccache.tar.gz
RUN apt-get update && apt-get install -y ccache && apt-get clean
RUN mkdir /var/local/jenkins

@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/php8_zts_debian12_x64:d6118fb448aa9a3766abca01aa5ec538ce5186ca@sha256:911241a4e38046b603245d56a1ca9491e81990ca9dedb0671e41b15387e3d2ee

@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# debian 11 = "bullseye"
FROM php:7.3-zts-bullseye
FROM php:8-zts-bookworm
RUN apt-get update && apt-get install -y \
autoconf automake build-essential git libtool curl \
@ -28,18 +27,6 @@ RUN apt-get update && apt-get install -y \
RUN git config --global --add safe.directory '*'
RUN git config --global protocol.file.allow always
# install php pthreads from source
# TODO(jtattermusch): is this really needed?
# See https://github.com/grpc/grpc/pull/23056
WORKDIR /tmp
RUN git clone https://github.com/krakjoe/pthreads
RUN cd pthreads && \
phpize && \
./configure && \
make && \
make install
#====================
# run_tests.py python dependencies
@ -54,7 +41,10 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean
# use pinned version of pip to avoid sudden breakages
RUN python3 -m pip install --upgrade pip==19.3.1
# 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.
@ -75,20 +65,7 @@ RUN mv composer.phar /usr/local/bin/composer
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 -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.7.5 \
&& 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.7.5 ccache.tar.gz
RUN apt-get update && apt-get install -y ccache && apt-get clean
RUN mkdir /var/local/jenkins

@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
value: "-f basictests_arm64 linux php7 --inner_jobs 16 -j 2 --bq_result_table aggregate_results"
value: "-f basictests_arm64 linux php8 --inner_jobs 16 -j 2 --bq_result_table aggregate_results"
}

@ -26,5 +26,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
value: "-f basictests linux php7 --inner_jobs 16 -j 2 --bq_result_table aggregate_results"
value: "-f basictests linux php8 --inner_jobs 16 -j 2 --bq_result_table aggregate_results"
}

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

@ -27,5 +27,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
value: "-f basictests macos php7 -j 1 --inner_jobs 4 --bq_result_table aggregate_results"
value: "-f basictests macos php8 -j 1 --inner_jobs 4 --bq_result_table aggregate_results"
}

@ -27,5 +27,5 @@ action {
env_vars {
key: "RUN_TESTS_FLAGS"
value: "-f basictests macos php7 -j 1 --inner_jobs 4 --max_time=3600"
value: "-f basictests macos php8 -j 1 --inner_jobs 4 --max_time=3600"
}

@ -299,7 +299,7 @@ class PHPArtifact:
if self.platform == "linux":
return create_docker_jobspec(
self.name,
"tools/dockerfile/test/php73_zts_debian11_{}".format(self.arch),
"tools/dockerfile/test/php8_zts_debian12_{}".format(self.arch),
"tools/run_tests/artifacts/build_artifact_php.sh",
)
else:

@ -279,15 +279,15 @@ class RubyDistribTest(object):
return self.name
class PHP7DistribTest(object):
"""Tests PHP7 package"""
class PHP8DistribTest(object):
"""Tests PHP8 package"""
def __init__(self, platform, arch, docker_suffix=None, presubmit=False):
self.name = "php7_%s_%s_%s" % (platform, arch, docker_suffix)
self.name = "php8_%s_%s_%s" % (platform, arch, docker_suffix)
self.platform = platform
self.arch = arch
self.docker_suffix = docker_suffix
self.labels = ["distribtest", "php", "php7", platform, arch]
self.labels = ["distribtest", "php", "php8", platform, arch]
if presubmit:
self.labels.append("presubmit")
if docker_suffix:
@ -302,7 +302,7 @@ class PHP7DistribTest(object):
if self.platform == "linux":
return create_docker_jobspec(
self.name,
"tools/dockerfile/distribtest/php7_%s_%s"
"tools/dockerfile/distribtest/php8_%s_%s"
% (self.docker_suffix, self.arch),
"test/distrib/php/run_distrib_test.sh",
copy_rel_path="test/distrib",
@ -504,7 +504,7 @@ def targets():
),
RubyDistribTest("linux", "x64", "ubuntu2004"),
RubyDistribTest("linux", "x64", "ubuntu2204", presubmit=True),
# PHP7
PHP7DistribTest("linux", "x64", "debian11", presubmit=True),
PHP7DistribTest("macos", "x64", presubmit=True),
# PHP8
PHP8DistribTest("linux", "x64", "debian12", presubmit=True),
PHP8DistribTest("macos", "x64", presubmit=True),
]

@ -613,7 +613,7 @@ class CLanguage(object):
return self.lang_suffix
class Php7Language(object):
class Php8Language(object):
def configure(self, config, args):
self.config = config
self.args = args
@ -641,12 +641,12 @@ class Php7Language(object):
return [["tools/run_tests/helper_scripts/post_tests_php.sh"]]
def dockerfile_dir(self):
return "tools/dockerfile/test/php7_debian11_%s" % _docker_arch_suffix(
return "tools/dockerfile/test/php8_debian12_%s" % _docker_arch_suffix(
self.args.arch
)
def __str__(self):
return "php7"
return "php8"
class PythonConfig(
@ -1260,7 +1260,7 @@ with open("tools/run_tests/generated/configs.json") as f:
_LANGUAGES = {
"c++": CLanguage("cxx", "c++"),
"c": CLanguage("c", "c"),
"php7": Php7Language(),
"php8": Php8Language(),
"python": PythonLanguage(),
"ruby": RubyLanguage(),
"csharp": CSharpLanguage(),

@ -302,7 +302,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
)
test_jobs += _generate_jobs(
languages=["ruby", "php7"],
languages=["ruby", "php8"],
configs=["dbg", "opt"],
platforms=["linux", "macos"],
labels=["basictests", "multilang"],
@ -312,7 +312,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
# ARM64 Linux Ruby and PHP tests
test_jobs += _generate_jobs(
languages=["ruby", "php7"],
languages=["ruby", "php8"],
configs=["dbg", "opt"],
platforms=["linux"],
arch="arm64",

Loading…
Cancel
Save