From 78f12358313f0746fcadf2d14ceb9ac9b58493a6 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Tue, 15 Oct 2024 10:52:03 -0700 Subject: [PATCH] [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 --- templates/tools/dockerfile/php7_deps.include | 24 +-------- .../Dockerfile.template | 8 +-- .../Dockerfile.template | 8 +-- .../Dockerfile.template | 19 ++----- .../dockerimage_current_versions.bzl | 10 ++-- tools/bazelify_tests/test/BUILD | 16 +++--- .../php7_debian11_x64.current_version | 1 - .../php8_debian12_x64.current_version | 1 + .../Dockerfile | 6 +-- .../grpc_interop_php7.current_version | 2 +- .../interoptest/grpc_interop_php7/Dockerfile | 24 +-------- .../php73_zts_debian11_x64.current_version | 1 - .../test/php7_debian11_arm64.current_version | 1 - .../test/php7_debian11_x64.current_version | 1 - .../test/php8_debian12_arm64.current_version | 1 + .../Dockerfile | 50 +++---------------- .../test/php8_debian12_x64.current_version | 1 + .../Dockerfile | 50 +++---------------- .../php8_zts_debian12_x64.current_version | 1 + .../Dockerfile | 35 +++---------- .../linux/arm64/grpc_basictests_php.cfg | 2 +- .../internal_ci/linux/grpc_basictests_php.cfg | 2 +- .../pull_request/grpc_basictests_php.cfg | 2 +- .../internal_ci/macos/grpc_basictests_php.cfg | 2 +- .../pull_request/grpc_basictests_php.cfg | 2 +- tools/run_tests/artifacts/artifact_targets.py | 2 +- .../artifacts/distribtest_targets.py | 16 +++--- tools/run_tests/run_tests.py | 8 +-- tools/run_tests/run_tests_matrix.py | 4 +- 29 files changed, 74 insertions(+), 226 deletions(-) rename templates/tools/dockerfile/test/{php7_debian11_x64 => php8_debian12_arm64}/Dockerfile.template (78%) rename templates/tools/dockerfile/test/{php7_debian11_arm64 => php8_debian12_x64}/Dockerfile.template (78%) rename templates/tools/dockerfile/test/{php73_zts_debian11_x64 => php8_zts_debian12_x64}/Dockerfile.template (70%) delete mode 100644 tools/dockerfile/distribtest/php7_debian11_x64.current_version create mode 100644 tools/dockerfile/distribtest/php8_debian12_x64.current_version rename tools/dockerfile/distribtest/{php7_debian11_x64 => php8_debian12_x64}/Dockerfile (83%) delete mode 100644 tools/dockerfile/test/php73_zts_debian11_x64.current_version delete mode 100644 tools/dockerfile/test/php7_debian11_arm64.current_version delete mode 100644 tools/dockerfile/test/php7_debian11_x64.current_version create mode 100644 tools/dockerfile/test/php8_debian12_arm64.current_version rename tools/dockerfile/test/{php7_debian11_x64 => php8_debian12_arm64}/Dockerfile (70%) create mode 100644 tools/dockerfile/test/php8_debian12_x64.current_version rename tools/dockerfile/test/{php7_debian11_arm64 => php8_debian12_x64}/Dockerfile (69%) create mode 100644 tools/dockerfile/test/php8_zts_debian12_x64.current_version rename tools/dockerfile/test/{php73_zts_debian11_x64 => php8_zts_debian12_x64}/Dockerfile (71%) diff --git a/templates/tools/dockerfile/php7_deps.include b/templates/tools/dockerfile/php7_deps.include index f75172c9c5d..c60730712e0 100644 --- a/templates/tools/dockerfile/php7_deps.include +++ b/templates/tools/dockerfile/php7_deps.include @@ -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 diff --git a/templates/tools/dockerfile/test/php7_debian11_x64/Dockerfile.template b/templates/tools/dockerfile/test/php8_debian12_arm64/Dockerfile.template similarity index 78% rename from templates/tools/dockerfile/test/php7_debian11_x64/Dockerfile.template rename to templates/tools/dockerfile/test/php8_debian12_arm64/Dockerfile.template index 74e16519751..d341b3f36ce 100644 --- a/templates/tools/dockerfile/test/php7_debian11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/php8_debian12_arm64/Dockerfile.template @@ -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"] diff --git a/templates/tools/dockerfile/test/php7_debian11_arm64/Dockerfile.template b/templates/tools/dockerfile/test/php8_debian12_x64/Dockerfile.template similarity index 78% rename from templates/tools/dockerfile/test/php7_debian11_arm64/Dockerfile.template rename to templates/tools/dockerfile/test/php8_debian12_x64/Dockerfile.template index 5c87f782db0..eed816a7eb9 100644 --- a/templates/tools/dockerfile/test/php7_debian11_arm64/Dockerfile.template +++ b/templates/tools/dockerfile/test/php8_debian12_x64/Dockerfile.template @@ -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"] diff --git a/templates/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile.template b/templates/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile.template similarity index 70% rename from templates/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile.template rename to templates/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile.template index 946e526820f..82f18af83d4 100644 --- a/templates/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile.template @@ -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"/> diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index f60d37e5d5b..65e34725123 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -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", diff --git a/tools/bazelify_tests/test/BUILD b/tools/bazelify_tests/test/BUILD index dee1d5172aa..9918e881804 100644 --- a/tools/bazelify_tests/test/BUILD +++ b/tools/bazelify_tests/test/BUILD @@ -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", ], ) diff --git a/tools/dockerfile/distribtest/php7_debian11_x64.current_version b/tools/dockerfile/distribtest/php7_debian11_x64.current_version deleted file mode 100644 index 23c999b4425..00000000000 --- a/tools/dockerfile/distribtest/php7_debian11_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64:0892cfafba20a8acae4db3272c4497c41cd627d2@sha256:e74902d75c5d0afdfb29f2f6200ef3e1b406cf4975c6a3a9a058ab101b004c7e \ No newline at end of file diff --git a/tools/dockerfile/distribtest/php8_debian12_x64.current_version b/tools/dockerfile/distribtest/php8_debian12_x64.current_version new file mode 100644 index 00000000000..641d3a0d814 --- /dev/null +++ b/tools/dockerfile/distribtest/php8_debian12_x64.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64:ad7c918a103618ebc381e741e3c2e527cc22ba85@sha256:42399d061f234ee0ef79b333555db0e11ca4f106bb1d49276abf99c459c104f0 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/php7_debian11_x64/Dockerfile b/tools/dockerfile/distribtest/php8_debian12_x64/Dockerfile similarity index 83% rename from tools/dockerfile/distribtest/php7_debian11_x64/Dockerfile rename to tools/dockerfile/distribtest/php8_debian12_x64/Dockerfile index 8ca8be05257..a189e297e5e 100644 --- a/tools/dockerfile/distribtest/php7_debian11_x64/Dockerfile +++ b/tools/dockerfile/distribtest/php8_debian12_x64/Dockerfile @@ -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 \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_php7.current_version b/tools/dockerfile/interoptest/grpc_interop_php7.current_version index dea17b85e2e..b5cb70fe54d 100644 --- a/tools/dockerfile/interoptest/grpc_interop_php7.current_version +++ b/tools/dockerfile/interoptest/grpc_interop_php7.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:89c31e58498f75173cfe6252758fb2dd1747bb16@sha256:f1d2075309ae93c1da7ed3230899ac934ce8f0cdb0bc3694c6b1a9cf8a314ef3 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_php7:014312df740258cb5c282375a550a7d075192c7e@sha256:eea8738f0aa1b6bbd56b847cbdfd0e0b98a46306d86db2494557f25c334abe4d \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile index cf9bbfc3d5c..505a859ad77 100644 --- a/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile @@ -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 diff --git a/tools/dockerfile/test/php73_zts_debian11_x64.current_version b/tools/dockerfile/test/php73_zts_debian11_x64.current_version deleted file mode 100644 index d665fca0c21..00000000000 --- a/tools/dockerfile/test/php73_zts_debian11_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/php73_zts_debian11_x64:77e07cf8904ccf92e13aa688cef73e5c93bb6879@sha256:186a96566a9c11adfb198309431086bdb02421121c262a2bf0166e3e9b21fb37 \ No newline at end of file diff --git a/tools/dockerfile/test/php7_debian11_arm64.current_version b/tools/dockerfile/test/php7_debian11_arm64.current_version deleted file mode 100644 index 5e7b664c6c6..00000000000 --- a/tools/dockerfile/test/php7_debian11_arm64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_arm64:ce0c5318a40ebe3dd48d15ef85ce745747b8d327@sha256:7ee21f253a2ddd255f4f6779cd19818eec6524e78b0bf0a7765339e4aa7347c3 \ No newline at end of file diff --git a/tools/dockerfile/test/php7_debian11_x64.current_version b/tools/dockerfile/test/php7_debian11_x64.current_version deleted file mode 100644 index 9f21f62af95..00000000000 --- a/tools/dockerfile/test/php7_debian11_x64.current_version +++ /dev/null @@ -1 +0,0 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian11_x64:5f152d5c34650064da2f21b10f5d63b8774753e0@sha256:34b02fd66832ebf49601bef95632753e6710a75755401c21332d50056ccd52d2 \ No newline at end of file diff --git a/tools/dockerfile/test/php8_debian12_arm64.current_version b/tools/dockerfile/test/php8_debian12_arm64.current_version new file mode 100644 index 00000000000..0fc85575051 --- /dev/null +++ b/tools/dockerfile/test/php8_debian12_arm64.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_arm64:9675eaaef7dd455bce74b806d7f86d341e0ae024@sha256:c220e72b415ad194a41cf5640fe360b9358df1dd34553c8d8e6bfd4a82e032b3 \ No newline at end of file diff --git a/tools/dockerfile/test/php7_debian11_x64/Dockerfile b/tools/dockerfile/test/php8_debian12_arm64/Dockerfile similarity index 70% rename from tools/dockerfile/test/php7_debian11_x64/Dockerfile rename to tools/dockerfile/test/php8_debian12_arm64/Dockerfile index 198f1a90256..e350e894e35 100644 --- a/tools/dockerfile/test/php7_debian11_x64/Dockerfile +++ b/tools/dockerfile/test/php8_debian12_arm64/Dockerfile @@ -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 diff --git a/tools/dockerfile/test/php8_debian12_x64.current_version b/tools/dockerfile/test/php8_debian12_x64.current_version new file mode 100644 index 00000000000..3ae1f135b64 --- /dev/null +++ b/tools/dockerfile/test/php8_debian12_x64.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/php8_debian12_x64:8e63aea32d0c1d3b6fcf5354d43e2a81dd29b1c1@sha256:18bf37f80415ce3ddd48261b0ef97b421a85646cc15bd21348e19b5fd7b191d6 \ No newline at end of file diff --git a/tools/dockerfile/test/php7_debian11_arm64/Dockerfile b/tools/dockerfile/test/php8_debian12_x64/Dockerfile similarity index 69% rename from tools/dockerfile/test/php7_debian11_arm64/Dockerfile rename to tools/dockerfile/test/php8_debian12_x64/Dockerfile index 5bf23c779c5..bdf70b5ce87 100644 --- a/tools/dockerfile/test/php7_debian11_arm64/Dockerfile +++ b/tools/dockerfile/test/php8_debian12_x64/Dockerfile @@ -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 diff --git a/tools/dockerfile/test/php8_zts_debian12_x64.current_version b/tools/dockerfile/test/php8_zts_debian12_x64.current_version new file mode 100644 index 00000000000..f5ffd11950b --- /dev/null +++ b/tools/dockerfile/test/php8_zts_debian12_x64.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/php8_zts_debian12_x64:d6118fb448aa9a3766abca01aa5ec538ce5186ca@sha256:911241a4e38046b603245d56a1ca9491e81990ca9dedb0671e41b15387e3d2ee \ No newline at end of file diff --git a/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile b/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile similarity index 71% rename from tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile rename to tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile index b0e2fa56496..5043704f96b 100644 --- a/tools/dockerfile/test/php73_zts_debian11_x64/Dockerfile +++ b/tools/dockerfile/test/php8_zts_debian12_x64/Dockerfile @@ -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 diff --git a/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg b/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg index d3183434a99..17ecfbaca76 100644 --- a/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg +++ b/tools/internal_ci/linux/arm64/grpc_basictests_php.cfg @@ -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" } diff --git a/tools/internal_ci/linux/grpc_basictests_php.cfg b/tools/internal_ci/linux/grpc_basictests_php.cfg index 998d90ee4b0..1158471d1e9 100644 --- a/tools/internal_ci/linux/grpc_basictests_php.cfg +++ b/tools/internal_ci/linux/grpc_basictests_php.cfg @@ -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" } diff --git a/tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg b/tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg index e735b6f4ce6..7451dd87857 100644 --- a/tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg +++ b/tools/internal_ci/linux/pull_request/grpc_basictests_php.cfg @@ -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" } diff --git a/tools/internal_ci/macos/grpc_basictests_php.cfg b/tools/internal_ci/macos/grpc_basictests_php.cfg index f54293cba8b..b0f63b7d25a 100644 --- a/tools/internal_ci/macos/grpc_basictests_php.cfg +++ b/tools/internal_ci/macos/grpc_basictests_php.cfg @@ -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" } diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_php.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_php.cfg index b8ee5a6579b..a7346c9ead1 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_php.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_php.cfg @@ -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" } diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py index 2695500eae8..50b22256a95 100644 --- a/tools/run_tests/artifacts/artifact_targets.py +++ b/tools/run_tests/artifacts/artifact_targets.py @@ -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: diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 9599661bad8..2750bf42786 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -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), ] diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index c4d7ddcb892..4df7c9689b5 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -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(), diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 3b9f2238248..873b1356e4c 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -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",