From 1535731c47a6a0b34f1b692471609160838c3f30 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 4 Oct 2023 16:49:45 -0500 Subject: [PATCH 01/27] MAGREQ-8989: Add metadata file to active repos --- .github/.metadata.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/.metadata.json b/.github/.metadata.json index 4f52d256..1c8a4040 100644 --- a/.github/.metadata.json +++ b/.github/.metadata.json @@ -1,14 +1,14 @@ { - "templateVersion": "0.1", + "templateVersion": "0.2", "product": { "name": "Magento Cloud Docker", "description": "The Magento Cloud Docker implementation deploys Cloud projects to a local workstation so that you can develop and test your code in a simulated Cloud environment" }, "contacts": { "team": { - "name": "Magic Mountain", - "DL": "Grp-magento-cloud-all", - "slackChannel": "magic_mountain" + "name": "Mystic Mountain", + "DL": "Grp-Mystic-Mountain", + "slackChannel": "#mystic-mountain-team" } }, "ticketTracker": { @@ -17,10 +17,8 @@ }, "securityJiraQueue": { "projectKey": "MAGREQ", - "component": "Magento Cloud Engineering" + "component": "MAGREQ/Magento Cloud Engineering" } }, - "staticScan": { - "enable": false - } + "productionCodeBranches": ["1.0", "1.1", "1.2", "1.3"] } From ad7b8f9cfcb97b7648cbf5eff20a542b72af28f0 Mon Sep 17 00:00:00 2001 From: nadtochi Date: Thu, 12 Oct 2023 14:27:17 -0500 Subject: [PATCH 02/27] Ticket: MCLOUD-10948 This PR changes version of nginx. Current nginx version: 1.19 will be changed to 1.24 Old version will not be supported. --- images/nginx/{1.19 => 1.24}/Dockerfile | 2 +- images/nginx/{1.19 => 1.24}/docker-entrypoint.sh | 0 images/nginx/{1.19 => 1.24}/etc/nginx.conf | 0 images/nginx/{1.19 => 1.24}/etc/vhost.conf | 0 images/nginx/{1.19 => 1.24}/etc/xdebug-upstream.conf | 0 src/Service/ServiceFactory.php | 2 +- src/Test/Functional/Acceptance/Services72Cest.php | 8 ++++---- src/Test/Functional/Acceptance/ServicesCest.php | 8 ++++---- src/Test/Integration/BuildCustomComposeTest.php | 2 +- .../Integration/_files/cloud_base/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_developer/docker-compose.exp.yml | 4 ++-- .../cloud_base_developer_manual/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_mftf/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_os_2.3_cli/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_os_2_cli/docker-compose.exp.yml | 4 ++-- .../_files/cloud_base_test/docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../docker-compose.exp.yml | 4 ++-- .../_files/cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../cloud_no_varnish_service/docker-compose.exp.yml | 4 ++-- .../_files/custom_cloud_base/docker-compose.exp.yml | 4 ++-- .../custom_cloud_base_native/docker-compose.exp.yml | 4 ++-- .../custom_cloud_custom_images/docker-compose.exp.yml | 4 ++-- .../custom_cloud_no_tls_service/docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 2 +- .../docker-compose.exp.yml | 4 ++-- .../_files/custom_registry/docker-compose.exp.yml | 4 ++-- 29 files changed, 47 insertions(+), 47 deletions(-) rename images/nginx/{1.19 => 1.24}/Dockerfile (98%) rename images/nginx/{1.19 => 1.24}/docker-entrypoint.sh (100%) rename images/nginx/{1.19 => 1.24}/etc/nginx.conf (100%) rename images/nginx/{1.19 => 1.24}/etc/vhost.conf (100%) rename images/nginx/{1.19 => 1.24}/etc/xdebug-upstream.conf (100%) diff --git a/images/nginx/1.19/Dockerfile b/images/nginx/1.24/Dockerfile similarity index 98% rename from images/nginx/1.19/Dockerfile rename to images/nginx/1.24/Dockerfile index e75bac29..ca4a2585 100644 --- a/images/nginx/1.19/Dockerfile +++ b/images/nginx/1.24/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.19 +FROM nginx:1.24 ENV UPLOAD_MAX_FILESIZE 64M ENV XDEBUG_HOST fpm_xdebug diff --git a/images/nginx/1.19/docker-entrypoint.sh b/images/nginx/1.24/docker-entrypoint.sh similarity index 100% rename from images/nginx/1.19/docker-entrypoint.sh rename to images/nginx/1.24/docker-entrypoint.sh diff --git a/images/nginx/1.19/etc/nginx.conf b/images/nginx/1.24/etc/nginx.conf similarity index 100% rename from images/nginx/1.19/etc/nginx.conf rename to images/nginx/1.24/etc/nginx.conf diff --git a/images/nginx/1.19/etc/vhost.conf b/images/nginx/1.24/etc/vhost.conf similarity index 100% rename from images/nginx/1.19/etc/vhost.conf rename to images/nginx/1.24/etc/vhost.conf diff --git a/images/nginx/1.19/etc/xdebug-upstream.conf b/images/nginx/1.24/etc/xdebug-upstream.conf similarity index 100% rename from images/nginx/1.19/etc/xdebug-upstream.conf rename to images/nginx/1.24/etc/xdebug-upstream.conf diff --git a/src/Service/ServiceFactory.php b/src/Service/ServiceFactory.php index b04286fb..c52206a5 100644 --- a/src/Service/ServiceFactory.php +++ b/src/Service/ServiceFactory.php @@ -42,7 +42,7 @@ class ServiceFactory */ private const SERVICE_NGINX_CONFIG = [ 'image' => 'magento/magento-cloud-docker-nginx', - 'version' => '1.19', + 'version' => '1.24', 'pattern' => self::PATTERN_VERSIONED, 'config' => [ 'extends' => ServiceInterface::SERVICE_GENERIC, diff --git a/src/Test/Functional/Acceptance/Services72Cest.php b/src/Test/Functional/Acceptance/Services72Cest.php index b627e4bd..65e71849 100644 --- a/src/Test/Functional/Acceptance/Services72Cest.php +++ b/src/Test/Functional/Acceptance/Services72Cest.php @@ -28,7 +28,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -40,7 +40,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -53,7 +53,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -66,7 +66,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Functional/Acceptance/ServicesCest.php b/src/Test/Functional/Acceptance/ServicesCest.php index 52916362..669cf39d 100644 --- a/src/Test/Functional/Acceptance/ServicesCest.php +++ b/src/Test/Functional/Acceptance/ServicesCest.php @@ -92,7 +92,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2' @@ -104,7 +104,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:3.2', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.2-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.1', @@ -117,7 +117,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:4.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.4-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', @@ -130,7 +130,7 @@ protected function servicesDataProvider(): array 'expectedResult' => [ 'redis:5.0', 'magento/magento-cloud-docker-varnish:6.6-1.3', - 'magento/magento-cloud-docker-nginx:1.19-1.3', + 'magento/magento-cloud-docker-nginx:1.24-1.3', 'magento/magento-cloud-docker-php:7.3-fpm-1.3', 'magento/magento-cloud-docker-elasticsearch:6.5-1.3', 'mariadb:10.2', diff --git a/src/Test/Integration/BuildCustomComposeTest.php b/src/Test/Integration/BuildCustomComposeTest.php index 32a5d2b4..de1600c7 100644 --- a/src/Test/Integration/BuildCustomComposeTest.php +++ b/src/Test/Integration/BuildCustomComposeTest.php @@ -248,7 +248,7 @@ public function buildDataProvider(): array ], 'nginx' => [ 'image' => 'nginx-v1', - 'version' => '1.19', + 'version' => '1.24', 'image-pattern' => '%s:%s', 'enabled' => 'true', ], diff --git a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml index e054a41c..b30d706b 100644 --- a/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml index e56337e6..9efb15b4 100644 --- a/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer/docker-compose.exp.yml @@ -96,7 +96,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:delegated' @@ -123,7 +123,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml index d8c7d928..974390b4 100644 --- a/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_developer_manual/docker-compose.exp.yml @@ -76,7 +76,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - 'magento-app:/app' @@ -103,7 +103,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml index 6e8bab5e..f42e86ff 100644 --- a/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_mftf/docker-compose.exp.yml @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - './magento2ce:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml index e5ec19e0..7487f54f 100644 --- a/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml index c385367a..044e3738 100644 --- a/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -103,7 +103,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -137,7 +137,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml index 0585618f..ca55c534 100644 --- a/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_test/docker-compose.exp.yml @@ -72,7 +72,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml index 53d8630b..ee750e4a 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml index 428d8228..e0a50c5a 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_image_and_version/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml index a38f457a..ec1bd183 100644 --- a/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_base_with_custom_zookeeper_version/docker-compose.exp.yml @@ -82,7 +82,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -116,7 +116,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml index e29152a7..72b7c93f 100644 --- a/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_tls_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml index fe34a339..cfb3e7da 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_and_tls_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml index 519258d7..819e0e80 100644 --- a/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/cloud_no_varnish_service/docker-compose.exp.yml @@ -83,7 +83,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -107,7 +107,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml index 2b9e82d2..bab4b358 100644 --- a/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base/docker-compose.exp.yml @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml index 2b9e82d2..bab4b358 100644 --- a/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_base_native/docker-compose.exp.yml @@ -46,7 +46,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -80,7 +80,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml index 5bd8a9e7..e06213a8 100644 --- a/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_custom_images/docker-compose.exp.yml @@ -84,7 +84,7 @@ services: condition: service_healthy web: hostname: web.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.test - image: 'nginx-v1:1.19' + image: 'nginx-v1:1.24' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml index f2b4ae19..33166249 100644 --- a/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_tls_service/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml index 026a62e1..876f2b95 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_and_tls_services/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' diff --git a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml index 0de6c3ab..152351e0 100644 --- a/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_cloud_no_varnish_service/docker-compose.exp.yml @@ -41,7 +41,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -61,7 +61,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: 'magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: diff --git a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml index 74f1e281..d7bf7488 100644 --- a/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml +++ b/src/Test/Integration/_files/custom_registry/docker-compose.exp.yml @@ -85,7 +85,7 @@ services: condition: service_healthy web: hostname: web.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic volumes: - '.:/app:ro,delegated' @@ -119,7 +119,7 @@ services: condition: service_started tls: hostname: tls.magento2.docker - image: '123.example.com/magento/magento-cloud-docker-nginx:1.19-1.2.0' + image: '123.example.com/magento/magento-cloud-docker-nginx:1.24-1.2.0' extends: generic networks: magento: From d6cb5a4fde4647b8da0c58ae1589973f1c547903 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Wed, 3 Jan 2024 22:36:35 +0530 Subject: [PATCH 03/27] Added PHP8.3 --- images/php/8.3-cli/Dockerfile | 193 +++++++++++++++++++++++ images/php/8.3-cli/bin/cloud-build | 44 ++++++ images/php/8.3-cli/bin/cloud-deploy | 37 +++++ images/php/8.3-cli/bin/cloud-post-deploy | 11 ++ images/php/8.3-cli/bin/ece-command | 7 + images/php/8.3-cli/bin/magento-command | 7 + images/php/8.3-cli/bin/magento-installer | 11 ++ images/php/8.3-cli/bin/mftf-command | 7 + images/php/8.3-cli/bin/run-cron | 3 + images/php/8.3-cli/bin/run-hooks | 61 +++++++ images/php/8.3-cli/docker-entrypoint.sh | 35 ++++ images/php/8.3-cli/etc/mail.ini | 2 + images/php/8.3-cli/etc/php-cli.ini | 10 ++ images/php/8.3-cli/etc/php-gnupg.ini | 1 + images/php/8.3-cli/etc/php-pcov.ini | 2 + images/php/8.3-cli/etc/php-xdebug.ini | 8 + images/php/8.3-fpm/Dockerfile | 151 ++++++++++++++++++ images/php/8.3-fpm/docker-entrypoint.sh | 24 +++ images/php/8.3-fpm/etc/mail.ini | 2 + images/php/8.3-fpm/etc/php-fpm.conf | 25 +++ images/php/8.3-fpm/etc/php-fpm.ini | 4 + images/php/8.3-fpm/etc/php-gnupg.ini | 1 + images/php/8.3-fpm/etc/php-pcov.ini | 2 + images/php/8.3-fpm/etc/php-xdebug.ini | 8 + 24 files changed, 656 insertions(+) create mode 100644 images/php/8.3-cli/Dockerfile create mode 100644 images/php/8.3-cli/bin/cloud-build create mode 100644 images/php/8.3-cli/bin/cloud-deploy create mode 100644 images/php/8.3-cli/bin/cloud-post-deploy create mode 100644 images/php/8.3-cli/bin/ece-command create mode 100644 images/php/8.3-cli/bin/magento-command create mode 100644 images/php/8.3-cli/bin/magento-installer create mode 100644 images/php/8.3-cli/bin/mftf-command create mode 100644 images/php/8.3-cli/bin/run-cron create mode 100644 images/php/8.3-cli/bin/run-hooks create mode 100644 images/php/8.3-cli/docker-entrypoint.sh create mode 100644 images/php/8.3-cli/etc/mail.ini create mode 100644 images/php/8.3-cli/etc/php-cli.ini create mode 100644 images/php/8.3-cli/etc/php-gnupg.ini create mode 100644 images/php/8.3-cli/etc/php-pcov.ini create mode 100644 images/php/8.3-cli/etc/php-xdebug.ini create mode 100644 images/php/8.3-fpm/Dockerfile create mode 100644 images/php/8.3-fpm/docker-entrypoint.sh create mode 100644 images/php/8.3-fpm/etc/mail.ini create mode 100644 images/php/8.3-fpm/etc/php-fpm.conf create mode 100644 images/php/8.3-fpm/etc/php-fpm.ini create mode 100644 images/php/8.3-fpm/etc/php-gnupg.ini create mode 100644 images/php/8.3-fpm/etc/php-pcov.ini create mode 100644 images/php/8.3-fpm/etc/php-xdebug.ini diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile new file mode 100644 index 00000000..2af8d4d7 --- /dev/null +++ b/images/php/8.3-cli/Dockerfile @@ -0,0 +1,193 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.3-cli + +ARG COMPOSER_VERSION=2.2.18 +ARG MAGENTO_ROOT=/app +ARG COMPOSER_ALLOW_SUPERUSER=1 +ARG COMPOSER_HOME=/composer +ARG CRONTAB="" + +ENV COMPOSER_MEMORY_LIMIT -1 +ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER} +ENV COMPOSER_HOME ${COMPOSER_HOME} +ENV COMPOSER_CLEAR_CACHE false +ENV PHP_MEMORY_LIMIT -1 +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Configure Node.js version +RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + cron \ + git \ + mariadb-client \ + nano \ + nodejs \ + python3 \ + python3-pip \ + redis-tools \ + sendmail-bin \ + sendmail \ + sudo \ + unzip \ + vim \ + openssh-client \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install Python packages + + +# Install Grunt +RUN npm install -g grunt-cli + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini +ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +# Get composer installed to /usr/local/bin/composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer + +ADD bin/* /usr/local/bin/ + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +ADD docker-entrypoint.sh /docker-entrypoint.sh + +RUN ["chmod", "+x", \ + "/docker-entrypoint.sh", \ + "/usr/local/bin/magento-installer", \ + "/usr/local/bin/magento-command", \ + "/usr/local/bin/mftf-command", \ + "/usr/local/bin/ece-command", \ + "/usr/local/bin/cloud-build", \ + "/usr/local/bin/cloud-deploy", \ + "/usr/local/bin/cloud-post-deploy", \ + "/usr/local/bin/run-cron", \ + "/usr/local/bin/run-hooks" \ +] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME} +RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["bash"] diff --git a/images/php/8.3-cli/bin/cloud-build b/images/php/8.3-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-build @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +RUN_HOOKS="run-hooks" + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Cleaning directories:" + + if [ "$INSTALLATION_TYPE" == "composer" ]; then + echo "Cleaning setup directory." + rm -rf $MAGENTO_ROOT/setup/* + fi + + echo "Cleaning vendor directory." + rm -rf $MAGENTO_ROOT/vendor/* + + echo "Cleaning generated directory." + rm -rf $MAGENTO_ROOT/generated/* + + echo "Removing app/etc/env.php file" + rm -f $MAGENTO_ROOT/app/etc/env.php +fi + +echo "Installing dependencies." + +composer --working-dir=$MAGENTO_ROOT install --no-suggest --no-ansi --no-interaction --no-progress --prefer-dist + +echo "Running \"build\" hook." + +$RUN_HOOKS build + +if [ "$MAGENTO_RUN_MODE" == "production" ]; then + echo "Setting file permissions." + + chown -R www:www $MAGENTO_ROOT + + find $MAGENTO_ROOT/pub -type f -exec chmod 664 {} \; + find $MAGENTO_ROOT/pub -type d -exec chmod 775 {} \; +fi + +echo "Building complete." diff --git a/images/php/8.3-cli/bin/cloud-deploy b/images/php/8.3-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-deploy @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"deploy\" hook." + +run-hooks deploy + +# check that Varnish exists +if ( varnish=$(curl -I varnish 2>&1 | grep -i "magento2") ); then + minor_magento_version=$(magento-command --version | sed "s/Magento CLI version \([0-9]*\.[0-9]*\).*/\1/") + if [[ "$minor_magento_version" != "2.1" ]]; then + output=$(magento-command config:set system/full_page_cache/caching_application 2) + # as config:set does not return error code, we check output text to continue set varnish settings + if [[ $output == *"Value was saved"* ]]; then + echo "Setting Varnish for Magento FPC." + magento-command setup:config:set --http-cache-hosts=varnish -n + else + echo $output + fi + fi +fi + +# set developer mode if it is configured in $MAGENTO_RUN_MODE +if [ "$MAGENTO_RUN_MODE" == "developer" ]; then + output=$(magento-command deploy:mode:set developer) + if [[ $output == *"Enabled developer mode."* ]]; then + echo "Enabled developer mode." + else + echo $output + fi +fi + + +echo "Deployment finished." diff --git a/images/php/8.3-cli/bin/cloud-post-deploy b/images/php/8.3-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.3-cli/bin/cloud-post-deploy @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +echo "Running \"post-deploy\" hook." + +run-hooks post_deploy + +echo "Post deployment finished." diff --git a/images/php/8.3-cli/bin/ece-command b/images/php/8.3-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.3-cli/bin/ece-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +ECE_COMMAND="$MAGENTO_ROOT/vendor/bin/ece-tools" + +exec $ECE_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-command b/images/php/8.3-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.3-cli/bin/magento-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MAGENTO_COMMAND="php $MAGENTO_ROOT/bin/magento" + +exec $MAGENTO_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/magento-installer b/images/php/8.3-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.3-cli/bin/magento-installer @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +[ "$DEBUG" = "true" ] && set -x + +BUILD_COMMAND="cloud-build" +DEPLOY_COMMAND="cloud-deploy" + +$BUILD_COMMAND +$DEPLOY_COMMAND diff --git a/images/php/8.3-cli/bin/mftf-command b/images/php/8.3-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.3-cli/bin/mftf-command @@ -0,0 +1,7 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +MFTF_COMMAND="$MAGENTO_ROOT/vendor/bin/mftf" + +exec $MFTF_COMMAND "$@" diff --git a/images/php/8.3-cli/bin/run-cron b/images/php/8.3-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.3-cli/bin/run-cron @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cron && tail -f -n0 /var/log/cron.log diff --git a/images/php/8.3-cli/bin/run-hooks b/images/php/8.3-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.3-cli/bin/run-hooks @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +import os +import sys +import subprocess +import json +import base64 + +# Disable output buffering. +os.environ['PYTHONUNBUFFERED'] = "1" + +# The list of available hooks. +available_hooks = ["build", "deploy", "post_deploy"] + + +# Prints a message and returns an exit code. +def error_exit(msg, code=1): + print(msg) + sys.exit(code) + + +# Gets Magento root path. +def get_magento_root(): + try: + return str(os.environ['MAGENTO_ROOT']) + except KeyError: + error_exit('Environment variable MAGENTO_ROOT is not available') + + +# Gets set hooks by hook name. +def get_hooks(hook_name): + try: + application = str(os.environ['MAGENTO_CLOUD_APPLICATION']) + content = json.loads(base64.b64decode(application).decode("utf-8")) + + return content['hooks'][hook_name] + except Exception as exc: + error_exit("Cannot decode string: " + str(exc)) + + +# Main function. +def main(): + if len(sys.argv) != 2: + error_exit("Usage: run-hooks ") + + hook_name = str(sys.argv[1]) + if hook_name not in available_hooks: + error_exit("The hook \"" + hook_name + "\" is not available. The list of available hooks: " + ", ".join(available_hooks)) + + try: + subprocess.check_call( + get_hooks(hook_name), + shell=True, + cwd=get_magento_root() + ) + except subprocess.CalledProcessError as exc: + error_exit("returned non-zero exit status " + str(exc.returncode)) + + +if __name__ == '__main__': + main() diff --git a/images/php/8.3-cli/docker-entrypoint.sh b/images/php/8.3-cli/docker-entrypoint.sh new file mode 100644 index 00000000..ee380b80 --- /dev/null +++ b/images/php/8.3-cli/docker-entrypoint.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +if [ ! -z "${CRONTAB}" ]; then + echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log +fi + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Clear composer cache if needed +[ "$COMPOSER_CLEAR_CACHE" = "true" ] && \ + composer clearcache + +# Configure composer +[ ! -z "${COMPOSER_VERSION}" ] && \ + composer self-update $COMPOSER_VERSION + +[ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ + composer config --global github-oauth.github.com $COMPOSER_GITHUB_TOKEN + +[ ! -z "${COMPOSER_MAGENTO_USERNAME}" ] && \ + composer config --global http-basic.repo.magento.com \ + $COMPOSER_MAGENTO_USERNAME $COMPOSER_MAGENTO_PASSWORD + +exec "$@" diff --git a/images/php/8.3-cli/etc/mail.ini b/images/php/8.3-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-cli/etc/php-cli.ini b/images/php/8.3-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.3-cli/etc/php-cli.ini @@ -0,0 +1,10 @@ +; php.ini +memory_limit = ${PHP_MEMORY_LIMIT} +zlib.output_compression = on +realpath_cache_size = 32k +realpath_cache_ttl = 7200 +always_populate_raw_post_data = -1 +max_input_vars = 10000 +session.gc_probability = 1 +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} diff --git a/images/php/8.3-cli/etc/php-gnupg.ini b/images/php/8.3-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-cli/etc/php-pcov.ini b/images/php/8.3-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-cli/etc/php-xdebug.ini b/images/php/8.3-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-cli/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile new file mode 100644 index 00000000..f21959e6 --- /dev/null +++ b/images/php/8.3-fpm/Dockerfile @@ -0,0 +1,151 @@ +# This file is automatically generated. Do not edit directly. # +FROM golang:1.15 AS builder + +RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \ + && wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \ + && tar -xf mhsendmail.tar.gz \ + && mkdir -p ./src/github.com/mailhog/ \ + && mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \ + && cd ./src/github.com/mailhog/mhsendmail/ \ + && go get . \ + && GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail . + +FROM php:8.3-fpm + +ARG MAGENTO_ROOT=/app + +ENV PHP_MEMORY_LIMIT 2G +ENV PHP_VALIDATE_TIMESTAMPS 1 +ENV DEBUG false +ENV MAGENTO_RUN_MODE production +ENV UPLOAD_MAX_FILESIZE 64M +ENV SENDMAIL_PATH /dev/null +ENV PHPRC ${MAGENTO_ROOT}/php.ini + +ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl + +# Install dependencies +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + sendmail-bin \ + sendmail \ + sudo \ + iproute2 \ + git \ + gnupg2 \ + ca-certificates \ + lsb-release \ + software-properties-common \ + libbz2-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libfreetype6-dev \ + libgmp-dev \ + libgpgme11-dev \ + libicu-dev \ + libldap2-dev \ + libpcre3-dev \ + libpspell-dev \ + libtidy-dev \ + libxslt1-dev \ + libyaml-dev \ + libzip-dev \ + zip \ + python3-yaml \ + && rm -rf /var/lib/apt/lists/* + +# Install MailHog +COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/ +RUN sudo chmod +x /usr/local/bin/mhsendmail + +# Configure the gd library +RUN docker-php-ext-configure \ + gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ +RUN docker-php-ext-configure \ + opcache --enable-opcache + +# Install required PHP extensions +RUN docker-php-ext-install -j$(nproc) \ + bcmath \ + bz2 \ + calendar \ + exif \ + gd \ + gettext \ + gmp \ + intl \ + mysqli \ + opcache \ + pdo_mysql \ + pspell \ + shmop \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + tidy \ + xsl \ + zip \ + pcntl + +RUN pecl install -o -f \ + gnupg \ + mailparse \ + msgpack \ + oauth \ + pcov \ + raphf \ + redis \ + xdebug-3.2.0 \ + xmlrpc-1.0.0RC3 \ + yaml + +RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \ + && install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \ + && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \ + && apt-get update \ + && apt-get install blackfire-php \ + && rm -rf /var/lib/apt/lists/* +RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \ + && docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch} +RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ + && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ + && apt-get remove libsodium* -y \ + && mkdir -p /tmp/libsodium \ + && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ + && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ + && ./configure \ + && make && make check \ + && make install \ + && cd / \ + && rm -rf /tmp/libsodium \ + && pecl install -o -f libsodium + +COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini +COPY etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini +COPY etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini +COPY etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini +COPY etc/php-fpm.conf /usr/local/etc/ +COPY etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini + +RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN ["chmod", "+x", "/docker-entrypoint.sh"] + +RUN mkdir -p ${MAGENTO_ROOT} + +VOLUME ${MAGENTO_ROOT} + +RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d ${MAGENTO_ROOT} + +ENTRYPOINT ["/docker-entrypoint.sh"] + +WORKDIR ${MAGENTO_ROOT} + +USER root + +CMD ["php-fpm", "-R"] diff --git a/images/php/8.3-fpm/docker-entrypoint.sh b/images/php/8.3-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.3-fpm/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +[ "$DEBUG" = "true" ] && set -x + +PHP_EXT_DIR=/usr/local/etc/php/conf.d + +# Enable PHP extensions +PHP_EXT_COM_ON=docker-php-ext-enable + +[ -d ${PHP_EXT_DIR} ] && rm -f ${PHP_EXT_DIR}/docker-php-ext-*.ini + +if [ -x "$(command -v ${PHP_EXT_COM_ON})" ] && [ ! -z "${PHP_EXTENSIONS}" ]; then + ${PHP_EXT_COM_ON} ${PHP_EXTENSIONS} +fi + +# Set host.docker.internal if not available +HOST_NAME="host.docker.internal" +HOST_IP=$(php -r "putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME');") +if [[ "$HOST_IP" == "$HOST_NAME" ]]; then + HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') + printf "\n%s %s\n" "$HOST_IP" "$HOST_NAME" >> /etc/hosts +fi + +exec "$@" diff --git a/images/php/8.3-fpm/etc/mail.ini b/images/php/8.3-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.3-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.3-fpm/etc/php-fpm.conf b/images/php/8.3-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.conf @@ -0,0 +1,25 @@ +[global] + +error_log = /proc/self/fd/2 +daemonize = no + +[www] + +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + +listen = [::]:9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 4 +pm.min_spare_servers = 2 +pm.max_spare_servers = 6 +pm.status_path = /status + +clear_env = no + +env[MAGE_MODE] = $MAGENTO_RUN_MODE + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes diff --git a/images/php/8.3-fpm/etc/php-fpm.ini b/images/php/8.3-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.3-fpm/etc/php-fpm.ini @@ -0,0 +1,4 @@ +memory_limit = ${PHP_MEMORY_LIMIT} +opcache.enable = 1 +opcache.validate_timestamps = ${PHP_VALIDATE_TIMESTAMPS} +user_ini.filename = diff --git a/images/php/8.3-fpm/etc/php-gnupg.ini b/images/php/8.3-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.3-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.3-fpm/etc/php-pcov.ini b/images/php/8.3-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.3-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.3-fpm/etc/php-xdebug.ini b/images/php/8.3-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.3-fpm/etc/php-xdebug.ini @@ -0,0 +1,8 @@ +; Xdebug settings will only kick in if the Xdebug module is loaded +xdebug.mode = debug +xdebug.client_port = 9001 +xdebug.start_with_request = trigger +xdebug.discover_client_host = false +xdebug.scream = false +xdebug.show_local_vars = 1 +xdebug.idekey = PHPSTORM From 11895980c7528cd3375f733f7b5725be8f7ad4ab Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Mon, 8 Jan 2024 21:04:18 +0530 Subject: [PATCH 04/27] Images generated through ./bin/ece-docker image:generate:php --- images/php/8.3-cli/Dockerfile | 4 ++-- images/php/8.3-fpm/Dockerfile | 2 +- src/Command/Image/GeneratePhp.php | 5 +++-- src/Compose/Php/ExtensionResolver.php | 5 +++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2af8d4d7..c9fbd1cc 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -72,11 +72,10 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ - python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install Python packages - +RUN pip3 install --upgrade setuptools && pip3 install pyyaml # Install Grunt RUN npm install -g grunt-cli @@ -125,6 +124,7 @@ RUN pecl install -o -f \ raphf \ redis \ xdebug-3.2.0 \ + xdebug-3.2.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile index f21959e6..6e8a1585 100644 --- a/images/php/8.3-fpm/Dockerfile +++ b/images/php/8.3-fpm/Dockerfile @@ -53,7 +53,6 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ - python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog @@ -100,6 +99,7 @@ RUN pecl install -o -f \ raphf \ redis \ xdebug-3.2.0 \ + xdebug-3.2.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 238b3052..a5bd5416 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,7 +26,7 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; + private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']; private const VERSION_MAP = [ '7.2' => '7.2', @@ -34,7 +34,8 @@ class GeneratePhp extends Command '7.4' => '7.4', '8.0' => '8.0.14', '8.1' => '8.1.1', - '8.2' => '8.2' + '8.2' => '8.2', + '8.3' => '8.3' ]; private const EDITION_CLI = 'cli'; diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 46b95dde..109cc71c 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -431,6 +431,11 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', ], + '>=8.3' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + ], + ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From 1f98a47b0f17148d66a3637b08daed7db53e6bd7 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Tue, 9 Jan 2024 21:44:30 +0530 Subject: [PATCH 05/27] Remove space and added missing php8.3v --- src/Command/Image/GeneratePhp.php | 2 +- src/Compose/Php/ExtensionResolver.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index a5bd5416..664f2a2d 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } - if ($this->semver::satisfies($phpVersion, '8.2.*')) { + if ($this->semver::satisfies($phpVersion, '8.3.*')) { $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 109cc71c..a626febb 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -433,9 +433,8 @@ public static function getConfig(): array ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], - ], 'xmlrpc' => [ '>=7.0 <8.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], From 759c37f38b142764515804a91b905a61550d74b0 Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Wed, 10 Jan 2024 05:51:55 +0530 Subject: [PATCH 06/27] PHP Debug version updated --- src/Compose/Php/ExtensionResolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index a626febb..d13c7c74 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -427,9 +427,9 @@ public static function getConfig(): array self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], - '>=8.2' => [ + '>=8.2 <8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, From 54854f1ce3aaa7b5afd4d3d496e951230acc587e Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 10 Jan 2024 13:46:26 -0600 Subject: [PATCH 07/27] MCLOUD-11525: Fix xDebug version and constrains for python3-yaml --- images/php/8.3-cli/Dockerfile | 6 +++--- images/php/8.3-fpm/Dockerfile | 4 ++-- src/Command/Image/GeneratePhp.php | 2 +- src/Compose/Php/ExtensionResolver.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index c9fbd1cc..2f3dd059 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -72,10 +72,11 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install Python packages -RUN pip3 install --upgrade setuptools && pip3 install pyyaml + # Install Grunt RUN npm install -g grunt-cli @@ -123,8 +124,7 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.2.0 \ - xdebug-3.2.0 \ + xdebug-3.3.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/images/php/8.3-fpm/Dockerfile b/images/php/8.3-fpm/Dockerfile index 6e8a1585..039114c4 100644 --- a/images/php/8.3-fpm/Dockerfile +++ b/images/php/8.3-fpm/Dockerfile @@ -53,6 +53,7 @@ RUN apt-get update \ libyaml-dev \ libzip-dev \ zip \ + python3-yaml \ && rm -rf /var/lib/apt/lists/* # Install MailHog @@ -98,8 +99,7 @@ RUN pecl install -o -f \ pcov \ raphf \ redis \ - xdebug-3.2.0 \ - xdebug-3.2.0 \ + xdebug-3.3.0 \ xmlrpc-1.0.0RC3 \ yaml diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index 664f2a2d..044a5ba0 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -287,7 +287,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string } } - if ($this->semver::satisfies($phpVersion, '8.3.*')) { + if ($this->semver::satisfies($phpVersion, '>=8.2')) { $packages[] = 'python3-yaml'; $pythonPackages = ''; } else { diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index d13c7c74..97db7a5b 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -429,7 +429,7 @@ public static function getConfig(): array ], '>=8.2 <8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, - self::EXTENSION_PACKAGE_NAME => 'xdebug-3.3.0', + self::EXTENSION_PACKAGE_NAME => 'xdebug-3.2.0', ], '>=8.3' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, From e8a99f2284857389b2028fa2b5d3be529a1297ce Mon Sep 17 00:00:00 2001 From: Shambhu Kumar Date: Tue, 23 Jan 2024 22:56:39 +0530 Subject: [PATCH 08/27] Symfony packages updated for PHP8.3 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 95eeda60..b37279a3 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ "composer/composer": "^1.4 || ^2.0", "composer/semver": "@stable", "illuminate/config": "^5.5||^8.77", - "symfony/config": "^4.4 || ^5.1", - "symfony/console": "^2.8 || ^4.0 || ^5.1", - "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1", - "symfony/yaml": "^3.3 || ^4.0 || ^5.1" + "symfony/config": "^4.4 || ^5.1|| ^5.4 || ^6.4", + "symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4", + "symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1|| ^5.4 || ^6.4", + "symfony/yaml": "^3.3 || ^4.0 || ^5.1 || ^5.4|| ^6.4" }, "require-dev": { "codeception/codeception": "^4.1", From 6aee55cce5c8906ec3ae3e4bbfd97be6353f9fe3 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 29 Jan 2024 14:07:10 -0600 Subject: [PATCH 09/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- composer.json | 2 +- config/services.xml | 1 + src/Compose/ProductionBuilder/Service/ElasticSearch.php | 2 +- src/Compose/ProductionBuilder/Service/OpenSearch.php | 2 +- tests/static/phpstan.neon | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b37279a3..aeeebcc5 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2 || ^2.0", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.8", "phpunit/phpunit": "^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, diff --git a/config/services.xml b/config/services.xml index 3e08211f..d7ca845f 100644 --- a/config/services.xml +++ b/config/services.xml @@ -9,6 +9,7 @@ + diff --git a/src/Compose/ProductionBuilder/Service/ElasticSearch.php b/src/Compose/ProductionBuilder/Service/ElasticSearch.php index bd450b54..6c1af0d5 100644 --- a/src/Compose/ProductionBuilder/Service/ElasticSearch.php +++ b/src/Compose/ProductionBuilder/Service/ElasticSearch.php @@ -73,7 +73,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $config->getServiceVersion($this->getServiceName()), - !empty($esEnvVars) ? ['environment' => $esEnvVars] : [], + ['environment' => $esEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/src/Compose/ProductionBuilder/Service/OpenSearch.php b/src/Compose/ProductionBuilder/Service/OpenSearch.php index 32519de2..460d532f 100644 --- a/src/Compose/ProductionBuilder/Service/OpenSearch.php +++ b/src/Compose/ProductionBuilder/Service/OpenSearch.php @@ -84,7 +84,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), $this->getVersion($config), - !empty($osEnvVars) ? ['environment' => $osEnvVars] : [], + ['environment' => $osEnvVars], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), $config->getServiceImagePattern($this->getServiceName()) diff --git a/tests/static/phpstan.neon b/tests/static/phpstan.neon index ea86c28c..6d5cf820 100644 --- a/tests/static/phpstan.neon +++ b/tests/static/phpstan.neon @@ -2,7 +2,7 @@ parameters: level: 5 paths: - ../../src - excludes_analyse: + excludePaths: - ../../src/Test/* reportUnmatchedIgnoredErrors: false ignoreErrors: From ef4eb83e263b0696c20398f966d8042e1f815558 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 10:42:52 -0600 Subject: [PATCH 10/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Application.php b/src/Application.php index 2aca8022..a6403b9e 100644 --- a/src/Application.php +++ b/src/Application.php @@ -35,7 +35,7 @@ public function __construct(ContainerInterface $container) /** * @inheritdoc */ - protected function getDefaultCommands() + protected function getDefaultCommands(): array { return array_merge(parent::getDefaultCommands(), [ $this->container->get(Command\BuildCompose::class), From ab954c8dcf4a2c71aee556e24ac3e4a487f389aa Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 14:32:09 -0600 Subject: [PATCH 11/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Robo/Tasks/DockerCompose/Run.php | 2 +- tests/functional/Robo/Tasks/EnvCleanUp.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Robo/Tasks/DockerCompose/Run.php b/tests/functional/Robo/Tasks/DockerCompose/Run.php index a7dd896d..38bade14 100644 --- a/tests/functional/Robo/Tasks/DockerCompose/Run.php +++ b/tests/functional/Robo/Tasks/DockerCompose/Run.php @@ -63,7 +63,7 @@ public function __construct($container) public function getCommand() { return trim(sprintf( - 'docker-compose run -w %s %s %s ' . $this->runWrapper, + 'docker-compose run --rm -w %s %s %s ' . $this->runWrapper, escapeshellarg($this->workingDir), $this->arguments, escapeshellarg($this->container), diff --git a/tests/functional/Robo/Tasks/EnvCleanUp.php b/tests/functional/Robo/Tasks/EnvCleanUp.php index 7f1d5942..0e84a64f 100644 --- a/tests/functional/Robo/Tasks/EnvCleanUp.php +++ b/tests/functional/Robo/Tasks/EnvCleanUp.php @@ -44,7 +44,7 @@ public function getCommand(): string foreach ($this->volumes as $volume) { $commands[] = sprintf( - 'docker-compose run %s bash -c "mkdir -p %s"', + 'docker-compose run --rm %s bash -c "mkdir -p %s"', Docker::BUILD_CONTAINER, $volume ); From d38d910b96ed255b3dc861c605859a00abc3bf73 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Feb 2024 14:36:04 -0600 Subject: [PATCH 12/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Test/Functional/Acceptance/AcceptanceCest.php | 12 ++++++------ src/Test/Functional/Acceptance/DeveloperCest.php | 4 ++-- src/Test/Functional/Acceptance/MailHogCest.php | 2 +- tests/functional/Codeception/Docker.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index ee2edfc4..3bee5e28 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -28,9 +28,9 @@ public function testProductionMode(\CliTester $I): void $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run build cloud-build'); - $I->runDockerComposeCommand('run deploy cloud-deploy'); - $I->runDockerComposeCommand('run deploy cloud-post-deploy'); + $I->runDockerComposeCommand('run --rm build cloud-build'); + $I->runDockerComposeCommand('run --rm deploy cloud-deploy'); + $I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); @@ -51,9 +51,9 @@ public function testCustomHost(\CliTester $I): void ); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'), 'Post deploy phase failed'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 3ca2efce..86f65c56 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -31,10 +31,10 @@ public function testDevPhpIni(CliTester $I) $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run --rm deploy php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); - $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run --rm fpm php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); } } diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 0ef9461e..caea8d38 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -61,7 +61,7 @@ private function runAndAssert(\CliTester $I): void $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); $I->assertTrue( - $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + $I->runDockerComposeCommand('run --rm deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') ); $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); $I->seeResponseIsJson(); diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 9ed7a70a..77b87ac0 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -108,7 +108,7 @@ public function runDockerComposeCommand(string $command): bool public function resetFilesOwner(): bool { return $this->runDockerComposeCommand( - 'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' + 'run --rm build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' ); } From 0631039cf34a10e502c449e8f3e9f918c3722922 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:40:40 -0600 Subject: [PATCH 13/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/Docker.php | 6 +++--- tests/functional/Codeception/MagentoDb.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 77b87ac0..6f7de6cb 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -23,7 +23,7 @@ class Docker extends BaseModule /** * @var array */ - protected $config = [ + protected array $config = [ 'system_magento_dir' => '', 'printOutput' => false, ]; @@ -31,12 +31,12 @@ class Docker extends BaseModule /** * @var array */ - protected $services = []; + protected array $services = []; /** * @inheritdoc */ - public function _initialize() + public function _initialize(): void { $container = Robo::createDefaultContainer(); $builder = CollectionBuilder::create($container, $this); diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index be5d5d6b..6f632a0f 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -122,7 +122,7 @@ public function _after(TestInterface $test) * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _initialize() {} + public function _initialize(): void {} /** * This method is overridden to avoid connection attempts before running Docker From 64ba3bd515780c1187686a274f471b76cbf174dc Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:47:07 -0600 Subject: [PATCH 14/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/MagentoDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index 6f632a0f..58e3fc2a 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -128,7 +128,7 @@ public function _initialize(): void {} * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _beforeSuite($settings = []) {} + public function _beforeSuite($settings = []): void {} /** * This method is overridden to avoid connection attempts before running Docker From eed93834756063681acfd51ef504c499d5918fc4 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 13:50:19 -0600 Subject: [PATCH 15/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Codeception/MagentoDb.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Codeception/MagentoDb.php b/tests/functional/Codeception/MagentoDb.php index 58e3fc2a..c8dd9d6c 100644 --- a/tests/functional/Codeception/MagentoDb.php +++ b/tests/functional/Codeception/MagentoDb.php @@ -113,7 +113,7 @@ public function _beforeStep(Step $step) /** * @inheritdoc */ - public function _after(TestInterface $test) + public function _after(TestInterface $test): void { $this->disconnectDatabases(); } @@ -134,5 +134,5 @@ public function _beforeSuite($settings = []): void {} * This method is overridden to avoid connection attempts before running Docker * {@inheritdoc} */ - public function _before(TestInterface $test) {} + public function _before(TestInterface $test): void {} } From a9088917ecd50c2446491fc1715be142cb2e0f66 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 14:19:37 -0600 Subject: [PATCH 16/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- src/Test/Functional/Acceptance/AcceptanceCest.php | 12 ++++++------ src/Test/Functional/Acceptance/DeveloperCest.php | 4 ++-- src/Test/Functional/Acceptance/MailHogCest.php | 2 +- tests/functional/Codeception/Docker.php | 2 +- tests/functional/Robo/Tasks/DockerCompose/Run.php | 2 +- tests/functional/Robo/Tasks/EnvCleanUp.php | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index 3bee5e28..ee2edfc4 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -28,9 +28,9 @@ public function testProductionMode(\CliTester $I): void $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run --rm build cloud-build'); - $I->runDockerComposeCommand('run --rm deploy cloud-deploy'); - $I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'); + $I->runDockerComposeCommand('run build cloud-build'); + $I->runDockerComposeCommand('run deploy cloud-deploy'); + $I->runDockerComposeCommand('run deploy cloud-post-deploy'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); @@ -51,9 +51,9 @@ public function testCustomHost(\CliTester $I): void ); $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run --rm build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run --rm deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); $I->amOnPage('/'); $I->see('Home page'); $I->see('CMS homepage content goes here.'); diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 86f65c56..3ca2efce 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -31,10 +31,10 @@ public function testDevPhpIni(CliTester $I) $I->replaceImagesWithCustom(); $I->startEnvironment(); - $I->runDockerComposeCommand('run --rm deploy php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); - $I->runDockerComposeCommand('run --rm fpm php -i | grep opcache.validate_timestamps'); + $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); $I->seeInOutput('=> On'); } } diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index caea8d38..0ef9461e 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -61,7 +61,7 @@ private function runAndAssert(\CliTester $I): void $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); $I->assertTrue( - $I->runDockerComposeCommand('run --rm deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') ); $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); $I->seeResponseIsJson(); diff --git a/tests/functional/Codeception/Docker.php b/tests/functional/Codeception/Docker.php index 6f7de6cb..ac65e51d 100644 --- a/tests/functional/Codeception/Docker.php +++ b/tests/functional/Codeception/Docker.php @@ -108,7 +108,7 @@ public function runDockerComposeCommand(string $command): bool public function resetFilesOwner(): bool { return $this->runDockerComposeCommand( - 'run --rm build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' + 'run build bash -c "chown -R $(id -u):$(id -g) . /composer/cache"' ); } diff --git a/tests/functional/Robo/Tasks/DockerCompose/Run.php b/tests/functional/Robo/Tasks/DockerCompose/Run.php index 38bade14..a7dd896d 100644 --- a/tests/functional/Robo/Tasks/DockerCompose/Run.php +++ b/tests/functional/Robo/Tasks/DockerCompose/Run.php @@ -63,7 +63,7 @@ public function __construct($container) public function getCommand() { return trim(sprintf( - 'docker-compose run --rm -w %s %s %s ' . $this->runWrapper, + 'docker-compose run -w %s %s %s ' . $this->runWrapper, escapeshellarg($this->workingDir), $this->arguments, escapeshellarg($this->container), diff --git a/tests/functional/Robo/Tasks/EnvCleanUp.php b/tests/functional/Robo/Tasks/EnvCleanUp.php index 0e84a64f..7f1d5942 100644 --- a/tests/functional/Robo/Tasks/EnvCleanUp.php +++ b/tests/functional/Robo/Tasks/EnvCleanUp.php @@ -44,7 +44,7 @@ public function getCommand(): string foreach ($this->volumes as $volume) { $commands[] = sprintf( - 'docker-compose run --rm %s bash -c "mkdir -p %s"', + 'docker-compose run %s bash -c "mkdir -p %s"', Docker::BUILD_CONTAINER, $volume ); From 22c4e7cf3302fd3506a651e099bebbee856fcc75 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 22 Feb 2024 14:49:49 -0600 Subject: [PATCH 17/27] MCLOUD-11659: Add php 8.3 to magento-cloud-docker --- tests/functional/Robo/Tasks/CopyFromDocker.php | 2 +- tests/functional/Robo/Tasks/CopyToDocker.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/Robo/Tasks/CopyFromDocker.php b/tests/functional/Robo/Tasks/CopyFromDocker.php index 2dd862d4..1a071542 100644 --- a/tests/functional/Robo/Tasks/CopyFromDocker.php +++ b/tests/functional/Robo/Tasks/CopyFromDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp "$(docker-compose ps -q %s)":%s %s', + 'docker-compose cp %s:%s %s', $this->container, $this->source, $this->destination diff --git a/tests/functional/Robo/Tasks/CopyToDocker.php b/tests/functional/Robo/Tasks/CopyToDocker.php index 5e3cf0c3..22cecf6e 100644 --- a/tests/functional/Robo/Tasks/CopyToDocker.php +++ b/tests/functional/Robo/Tasks/CopyToDocker.php @@ -80,7 +80,7 @@ public function destination(string $destination): self public function getCommand(): string { return sprintf( - 'docker cp %s "$(docker-compose ps -q %s)":%s', + 'docker-compose cp %s %s:%s', $this->source, $this->container, $this->destination From ebb0e4c336269911e1244e07a4a80c722ceded8b Mon Sep 17 00:00:00 2001 From: Charly Maupetit Date: Tue, 27 Feb 2024 16:13:02 +0100 Subject: [PATCH 18/27] fix composer vulnerability CVE-2024-24821 --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 45dd71d1..03ddcad2 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 99010a5f..d810cd61 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index dbafd471..1427b2fd 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2f3dd059..e518ef16 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 9487d0a18d422b2bd9592eaeba9309250404bbf5 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 11 Mar 2024 12:45:36 -0400 Subject: [PATCH 19/27] Add php 8.3 functional tests --- .../Acceptance/Acceptance82Cest.php | 61 ++++++++++ .../Functional/Acceptance/AcceptanceCest.php | 4 +- .../Functional/Acceptance/Developer82Cest.php | 40 +++++++ .../Functional/Acceptance/DeveloperCest.php | 4 +- .../Acceptance/Elasticsearch82Cest.php | 96 ++++++++++++++++ .../Acceptance/ElasticsearchCest.php | 4 +- .../Functional/Acceptance/MailHog82Cest.php | 70 ++++++++++++ .../Functional/Acceptance/MailHogCest.php | 4 +- .../Acceptance/Opensearch82Cest.php | 107 ++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 4 +- 10 files changed, 384 insertions(+), 10 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance82Cest.php create mode 100644 src/Test/Functional/Acceptance/Developer82Cest.php create mode 100644 src/Test/Functional/Acceptance/Elasticsearch82Cest.php create mode 100644 src/Test/Functional/Acceptance/MailHog82Cest.php create mode 100644 src/Test/Functional/Acceptance/Opensearch82Cest.php diff --git a/src/Test/Functional/Acceptance/Acceptance82Cest.php b/src/Test/Functional/Acceptance/Acceptance82Cest.php new file mode 100644 index 00000000..5738615c --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance82Cest.php @@ -0,0 +1,61 @@ +assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->runDockerComposeCommand('run build cloud-build'); + $I->runDockerComposeCommand('run deploy cloud-deploy'); + $I->runDockerComposeCommand('run deploy cloud-post-deploy'); + $I->amOnPage('/'); + $I->see('Home page'); + $I->see('CMS homepage content goes here.'); + } + + /** + * @param \CliTester $I + * @throws TaskException + * @throws \Codeception\Exception\ModuleConfigException + * @throws \Codeception\Exception\ModuleException + */ + public function testCustomHost(\CliTester $I): void + { + $I->updateBaseUrl('http://magento2.test/'); + $I->assertTrue( + $I->generateDockerCompose('--mode=production --host=magento2.test'), + 'Command build:compose failed' + ); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); + $I->amOnPage('/'); + $I->see('Home page'); + $I->see('CMS homepage content goes here.'); + } +} diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index ee2edfc4..bda150fb 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -10,14 +10,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class AcceptanceCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Developer82Cest.php b/src/Test/Functional/Acceptance/Developer82Cest.php new file mode 100644 index 00000000..1bfdaaa7 --- /dev/null +++ b/src/Test/Functional/Acceptance/Developer82Cest.php @@ -0,0 +1,40 @@ +generateDockerCompose('--mode=developer'); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + + $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); + $I->seeInOutput('=> On'); + + $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); + $I->seeInOutput('=> On'); + } +} diff --git a/src/Test/Functional/Acceptance/DeveloperCest.php b/src/Test/Functional/Acceptance/DeveloperCest.php index 3ca2efce..459126ab 100644 --- a/src/Test/Functional/Acceptance/DeveloperCest.php +++ b/src/Test/Functional/Acceptance/DeveloperCest.php @@ -10,14 +10,14 @@ use CliTester; /** - * @group php82 + * @group php83 */ class DeveloperCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * Tests that php settings contains configuration from php.dev.ini diff --git a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php new file mode 100644 index 00000000..c750784c --- /dev/null +++ b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php @@ -0,0 +1,96 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + if (!empty($data['plugins'])) { + $I->runDockerComposeCommand('logs elasticsearch'); + foreach ($data['plugins'] as $plugin) { + $I->seeInOutput($plugin); + } + } + $I->runDockerComposeCommand('exec -T elasticsearch ps aux | grep elasticsearch'); + $I->seeInOutput('-Xms' . $data['xms']); + $I->seeInOutput('-Xmx' . $data['xmx']); + + if (!empty($data['param'])) { + $I->runDockerComposeCommand('exec -T elasticsearch curl http://localhost:9200/_nodes/settings'); + $I->seeInOutput($data['param']['needle']); + } + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --es=%s --es-env-var="ES_JAVA_OPTS=-Xms%s -Xmx%s" --no-os', + $data['version'], + $data['xms'], + $data['xmx'] + ); + + if (!empty($data['param'])) { + $command .= " --es-env-var={$data['param']['key']}={$data['param']['value']}"; + } + if (!empty($data['plugins'])) { + $command .= sprintf(' --es-env-var="ES_PLUGINS=%s"', implode(' ', $data['plugins'])); + } + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '7.10', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/ElasticsearchCest.php b/src/Test/Functional/Acceptance/ElasticsearchCest.php index 7ecdb78b..5bc6c438 100644 --- a/src/Test/Functional/Acceptance/ElasticsearchCest.php +++ b/src/Test/Functional/Acceptance/ElasticsearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class ElasticsearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param CliTester $I diff --git a/src/Test/Functional/Acceptance/MailHog82Cest.php b/src/Test/Functional/Acceptance/MailHog82Cest.php new file mode 100644 index 00000000..9efe72e9 --- /dev/null +++ b/src/Test/Functional/Acceptance/MailHog82Cest.php @@ -0,0 +1,70 @@ +updateBaseUrl('http://magento2.docker:8025/'); + $I->assertTrue( + $I->generateDockerCompose(), + 'Command build:compose failed' + ); + $this->runAndAssert($I); + } + + /** + * @param \CliTester $I + * @throws \Exception + */ + public function testCustomPorts(\CliTester $I): void + { + $I->updateBaseUrl('http://magento2.docker:8026/'); + $I->assertTrue( + $I->generateDockerCompose('--mailhog-http-port=8026 --mailhog-smtp-port=1026'), + 'Command build:compose failed' + ); + $this->runAndAssert($I); + } + + /** + * @param \CliTester $I + * @throws \Exception + */ + private function runAndAssert(\CliTester $I): void + { + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + $I->amOnPage('/'); + $I->see('MailHog'); + + $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); + $I->seeResponseIsJson(); + $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); + + $I->assertTrue( + $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') + ); + $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); + $I->seeResponseIsJson(); + $I->assertSame([1], $I->grabDataFromResponseByJsonPath('$.total')); + } +} diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 0ef9461e..8530a083 100644 --- a/src/Test/Functional/Acceptance/MailHogCest.php +++ b/src/Test/Functional/Acceptance/MailHogCest.php @@ -8,14 +8,14 @@ namespace Magento\CloudDocker\Test\Functional\Acceptance; /** - * @group php82 + * @group php83 */ class MailHogCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php new file mode 100644 index 00000000..0c5c6549 --- /dev/null +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -0,0 +1,107 @@ +generateDockerCompose($this->buildCommand($data)); + $I->replaceImagesWithCustom(); + $I->startEnvironment(); + if (!empty($data['plugins'])) { + $I->runDockerComposeCommand('logs opensearch'); + foreach ($data['plugins'] as $plugin) { + $I->seeInOutput($plugin); + } + } + $I->runDockerComposeCommand('exec -T opensearch curl localhost:9200/_nodes'); + $I->seeInOutput('-Xms' . $data['xms']); + $I->seeInOutput('-Xmx' . $data['xmx']); + + if (!empty($data['param'])) { + $I->runDockerComposeCommand('exec -T opensearch curl http://localhost:9200/_nodes/settings'); + $I->seeInOutput($data['param']['needle']); + } + } + + /** + * Builds build:compose command from given test data + * + * @param Example $data + * @return string + */ + private function buildCommand(Example $data): string + { + $command = sprintf( + '--mode=production --os=%s --os-env-var="OPENSEARCH_JAVA_OPTS=-Xms%s -Xmx%s"', + $data['version'], + $data['xms'], + $data['xmx'] + ); + + if (!empty($data['param'])) { + $command .= " --os-env-var={$data['param']['key']}={$data['param']['value']}"; + } + if (!empty($data['plugins'])) { + $command .= sprintf(' --os-env-var="OS_PLUGINS=%s"', implode(' ', $data['plugins'])); + } + + return $command; + } + + /** + * @return array + */ + protected function dataProvider(): array + { + return [ + [ + 'version' => '2.3', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + [ + 'version' => '2.4', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/OpensearchCest.php b/src/Test/Functional/Acceptance/OpensearchCest.php index 74271ada..f4aa3b91 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php82 + * @group php83 */ class OpensearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.6'; + protected const TEMPLATE_VERSION = '2.4.7-beta-test'; /** * @param CliTester $I From 432265393d0a8f7c6b3d9d3f6dabd9a136bc1ca4 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 11 Mar 2024 14:49:31 -0400 Subject: [PATCH 20/27] php8.2 tests optimization --- .../Acceptance/Acceptance82Cest.php | 40 --------- .../Functional/Acceptance/Developer82Cest.php | 19 ----- .../Acceptance/Elasticsearch82Cest.php | 73 ---------------- .../Functional/Acceptance/MailHog82Cest.php | 51 ------------ .../Acceptance/Opensearch82Cest.php | 83 ------------------- 5 files changed, 266 deletions(-) diff --git a/src/Test/Functional/Acceptance/Acceptance82Cest.php b/src/Test/Functional/Acceptance/Acceptance82Cest.php index 5738615c..b0ac70ff 100644 --- a/src/Test/Functional/Acceptance/Acceptance82Cest.php +++ b/src/Test/Functional/Acceptance/Acceptance82Cest.php @@ -18,44 +18,4 @@ class Acceptance82Cest extends AcceptanceCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param \CliTester $I - * @throws TaskException - */ - public function testProductionMode(\CliTester $I): void - { - $I->assertTrue($I->generateDockerCompose('--mode=production'), 'Command build:compose failed'); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->runDockerComposeCommand('run build cloud-build'); - $I->runDockerComposeCommand('run deploy cloud-deploy'); - $I->runDockerComposeCommand('run deploy cloud-post-deploy'); - $I->amOnPage('/'); - $I->see('Home page'); - $I->see('CMS homepage content goes here.'); - } - - /** - * @param \CliTester $I - * @throws TaskException - * @throws \Codeception\Exception\ModuleConfigException - * @throws \Codeception\Exception\ModuleException - */ - public function testCustomHost(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.test/'); - $I->assertTrue( - $I->generateDockerCompose('--mode=production --host=magento2.test'), - 'Command build:compose failed' - ); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase failed'); - $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post deploy phase failed'); - $I->amOnPage('/'); - $I->see('Home page'); - $I->see('CMS homepage content goes here.'); - } } diff --git a/src/Test/Functional/Acceptance/Developer82Cest.php b/src/Test/Functional/Acceptance/Developer82Cest.php index 1bfdaaa7..36277d20 100644 --- a/src/Test/Functional/Acceptance/Developer82Cest.php +++ b/src/Test/Functional/Acceptance/Developer82Cest.php @@ -18,23 +18,4 @@ class Developer82Cest extends DeveloperCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * Tests that php settings contains configuration from php.dev.ini - * - * @param CliTester $I - * @throws \Robo\Exception\TaskException - */ - public function testDevPhpIni(CliTester $I) - { - $I->generateDockerCompose('--mode=developer'); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - - $I->runDockerComposeCommand('run deploy php -i | grep opcache.validate_timestamps'); - $I->seeInOutput('=> On'); - - $I->runDockerComposeCommand('run fpm php -i | grep opcache.validate_timestamps'); - $I->seeInOutput('=> On'); - } } diff --git a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php index c750784c..681dc973 100644 --- a/src/Test/Functional/Acceptance/Elasticsearch82Cest.php +++ b/src/Test/Functional/Acceptance/Elasticsearch82Cest.php @@ -20,77 +20,4 @@ class Elasticsearch82Cest extends ElasticsearchCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param CliTester $I - * @param Example $data - * @dataProvider dataProvider - * @return void - * @throws TaskException - */ - public function testElasticsearch(CliTester $I, Example $data) - { - $I->generateDockerCompose($this->buildCommand($data)); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - if (!empty($data['plugins'])) { - $I->runDockerComposeCommand('logs elasticsearch'); - foreach ($data['plugins'] as $plugin) { - $I->seeInOutput($plugin); - } - } - $I->runDockerComposeCommand('exec -T elasticsearch ps aux | grep elasticsearch'); - $I->seeInOutput('-Xms' . $data['xms']); - $I->seeInOutput('-Xmx' . $data['xmx']); - - if (!empty($data['param'])) { - $I->runDockerComposeCommand('exec -T elasticsearch curl http://localhost:9200/_nodes/settings'); - $I->seeInOutput($data['param']['needle']); - } - } - - /** - * Builds build:compose command from given test data - * - * @param Example $data - * @return string - */ - private function buildCommand(Example $data): string - { - $command = sprintf( - '--mode=production --es=%s --es-env-var="ES_JAVA_OPTS=-Xms%s -Xmx%s" --no-os', - $data['version'], - $data['xms'], - $data['xmx'] - ); - - if (!empty($data['param'])) { - $command .= " --es-env-var={$data['param']['key']}={$data['param']['value']}"; - } - if (!empty($data['plugins'])) { - $command .= sprintf(' --es-env-var="ES_PLUGINS=%s"', implode(' ', $data['plugins'])); - } - - return $command; - } - - /** - * @return array - */ - protected function dataProvider(): array - { - return [ - [ - 'version' => '7.10', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } } diff --git a/src/Test/Functional/Acceptance/MailHog82Cest.php b/src/Test/Functional/Acceptance/MailHog82Cest.php index 9efe72e9..52e0f255 100644 --- a/src/Test/Functional/Acceptance/MailHog82Cest.php +++ b/src/Test/Functional/Acceptance/MailHog82Cest.php @@ -16,55 +16,4 @@ class MailHog82Cest extends MailHogCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - - /** - * @param \CliTester $I - * @throws \Exception - */ - public function testDefaultPorts(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.docker:8025/'); - $I->assertTrue( - $I->generateDockerCompose(), - 'Command build:compose failed' - ); - $this->runAndAssert($I); - } - - /** - * @param \CliTester $I - * @throws \Exception - */ - public function testCustomPorts(\CliTester $I): void - { - $I->updateBaseUrl('http://magento2.docker:8026/'); - $I->assertTrue( - $I->generateDockerCompose('--mailhog-http-port=8026 --mailhog-smtp-port=1026'), - 'Command build:compose failed' - ); - $this->runAndAssert($I); - } - - /** - * @param \CliTester $I - * @throws \Exception - */ - private function runAndAssert(\CliTester $I): void - { - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - $I->amOnPage('/'); - $I->see('MailHog'); - - $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); - $I->seeResponseIsJson(); - $I->assertSame([0], $I->grabDataFromResponseByJsonPath('$.total')); - - $I->assertTrue( - $I->runDockerComposeCommand('run deploy bash -c "php -r \"mail(\'test@example.com\',\'test\',\'test\');\""') - ); - $I->sendAjaxGetRequest('/api/v2/messages', ['limit' => 10]); - $I->seeResponseIsJson(); - $I->assertSame([1], $I->grabDataFromResponseByJsonPath('$.total')); - } } diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php index 0c5c6549..ea4344f6 100644 --- a/src/Test/Functional/Acceptance/Opensearch82Cest.php +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -21,87 +21,4 @@ class Opensearch82Cest extends OpensearchCest */ protected const TEMPLATE_VERSION = '2.4.6'; - /** - * @param CliTester $I - * @param Example $data - * @dataProvider dataProvider - * @return void - * @throws TaskException - */ - public function testOpensearch(CliTester $I, Example $data) - { - $I->generateDockerCompose($this->buildCommand($data)); - $I->replaceImagesWithCustom(); - $I->startEnvironment(); - if (!empty($data['plugins'])) { - $I->runDockerComposeCommand('logs opensearch'); - foreach ($data['plugins'] as $plugin) { - $I->seeInOutput($plugin); - } - } - $I->runDockerComposeCommand('exec -T opensearch curl localhost:9200/_nodes'); - $I->seeInOutput('-Xms' . $data['xms']); - $I->seeInOutput('-Xmx' . $data['xmx']); - - if (!empty($data['param'])) { - $I->runDockerComposeCommand('exec -T opensearch curl http://localhost:9200/_nodes/settings'); - $I->seeInOutput($data['param']['needle']); - } - } - - /** - * Builds build:compose command from given test data - * - * @param Example $data - * @return string - */ - private function buildCommand(Example $data): string - { - $command = sprintf( - '--mode=production --os=%s --os-env-var="OPENSEARCH_JAVA_OPTS=-Xms%s -Xmx%s"', - $data['version'], - $data['xms'], - $data['xmx'] - ); - - if (!empty($data['param'])) { - $command .= " --os-env-var={$data['param']['key']}={$data['param']['value']}"; - } - if (!empty($data['plugins'])) { - $command .= sprintf(' --os-env-var="OS_PLUGINS=%s"', implode(' ', $data['plugins'])); - } - - return $command; - } - - /** - * @return array - */ - protected function dataProvider(): array - { - return [ - [ - 'version' => '2.3', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - [ - 'version' => '2.4', - 'xms' => '520m', - 'xmx' => '520m', - 'plugins' => ['analysis-nori'], - 'param' => [ - 'key' => 'node.store.allow_mmap', - 'value' => 'false', - 'needle' => '"store":{"allow_mmap":"false"}', - ] - ], - ]; - } } From 8d902ac7424c2579519c85039146346115139985 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 18 Mar 2024 15:14:44 -0500 Subject: [PATCH 21/27] Use Composer 2.7.0 for PHP 8.3 --- images/php/8.3-cli/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index e518ef16..21b4957e 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.7.0 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 65b7b5c22e4b08702d590b010c5d2d29b3e8edc6 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Fri, 22 Mar 2024 12:54:46 -0500 Subject: [PATCH 22/27] update alias --- config/services.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/services.xml b/config/services.xml index d7ca845f..9dc5ae85 100644 --- a/config/services.xml +++ b/config/services.xml @@ -9,7 +9,7 @@ - + From 6dd2feb29c178bf1eec38363410c91a1d3dc3a00 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 26 Mar 2024 12:21:38 -0500 Subject: [PATCH 23/27] MCLOUD-11870: Composer Vulnerability (CVE-2024-24821) (#122) --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 45dd71d1..03ddcad2 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 99010a5f..d810cd61 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.1.14 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index dbafd471..1427b2fd 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.2.23 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 2f3dd059..21b4957e 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.2.18 +ARG COMPOSER_VERSION=2.7.0 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From a195268f62d809d50299deaf742ecc7e06851476 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 26 Mar 2024 13:12:20 -0500 Subject: [PATCH 24/27] Revert "MCLOUD-11870: Composer Vulnerability (CVE-2024-24821) (#122)" (#123) This reverts commit 6dd2feb29c178bf1eec38363410c91a1d3dc3a00. --- images/php/8.0-cli/Dockerfile | 2 +- images/php/8.1-cli/Dockerfile | 2 +- images/php/8.2-cli/Dockerfile | 2 +- images/php/8.3-cli/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/images/php/8.0-cli/Dockerfile b/images/php/8.0-cli/Dockerfile index 03ddcad2..45dd71d1 100644 --- a/images/php/8.0-cli/Dockerfile +++ b/images/php/8.0-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.0.14-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.1.14 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index d810cd61..99010a5f 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.1.1-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.1.14 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile index 1427b2fd..dbafd471 100644 --- a/images/php/8.2-cli/Dockerfile +++ b/images/php/8.2-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.2-cli -ARG COMPOSER_VERSION=2.2.23 +ARG COMPOSER_VERSION=2.2.18 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer diff --git a/images/php/8.3-cli/Dockerfile b/images/php/8.3-cli/Dockerfile index 21b4957e..2f3dd059 100644 --- a/images/php/8.3-cli/Dockerfile +++ b/images/php/8.3-cli/Dockerfile @@ -12,7 +12,7 @@ RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch= FROM php:8.3-cli -ARG COMPOSER_VERSION=2.7.0 +ARG COMPOSER_VERSION=2.2.18 ARG MAGENTO_ROOT=/app ARG COMPOSER_ALLOW_SUPERUSER=1 ARG COMPOSER_HOME=/composer From 5d4b6978266ea6ce8079c05660ebdcd1bd0a3027 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 28 Mar 2024 10:43:14 -0500 Subject: [PATCH 25/27] Add images for OpenSearch 1.3 and 2.12 --- images/opensearch/1.3/Dockerfile | 21 ++++++++++++++++++++ images/opensearch/1.3/docker-entrypoint.sh | 12 +++++++++++ images/opensearch/1.3/docker-healthcheck.sh | 12 +++++++++++ images/opensearch/2.12/Dockerfile | 21 ++++++++++++++++++++ images/opensearch/2.12/docker-entrypoint.sh | 12 +++++++++++ images/opensearch/2.12/docker-healthcheck.sh | 12 +++++++++++ src/Command/Image/GenerateOs.php | 6 ++++++ 7 files changed, 96 insertions(+) create mode 100644 images/opensearch/1.3/Dockerfile create mode 100755 images/opensearch/1.3/docker-entrypoint.sh create mode 100644 images/opensearch/1.3/docker-healthcheck.sh create mode 100644 images/opensearch/2.12/Dockerfile create mode 100755 images/opensearch/2.12/docker-entrypoint.sh create mode 100644 images/opensearch/2.12/docker-healthcheck.sh diff --git a/images/opensearch/1.3/Dockerfile b/images/opensearch/1.3/Dockerfile new file mode 100644 index 00000000..ee27282e --- /dev/null +++ b/images/opensearch/1.3/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:1.3.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/1.3/docker-entrypoint.sh b/images/opensearch/1.3/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/1.3/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/1.3/docker-healthcheck.sh b/images/opensearch/1.3/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/1.3/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/images/opensearch/2.12/Dockerfile b/images/opensearch/2.12/Dockerfile new file mode 100644 index 00000000..976c19fd --- /dev/null +++ b/images/opensearch/2.12/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.12.0 + +USER root +RUN yum -y install zip && \ + zip -q -d /usr/share/opensearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache +USER opensearch + +RUN bin/opensearch-plugin install -b analysis-icu && \ + bin/opensearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/opensearch/2.12/docker-entrypoint.sh b/images/opensearch/2.12/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.12/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$OS_PLUGINS" ]]; then + echo "Installing plugins: $OS_PLUGINS" + for PLUGIN in $OS_PLUGINS + do + ./bin/opensearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/share/opensearch/opensearch-docker-entrypoint.sh diff --git a/images/opensearch/2.12/docker-healthcheck.sh b/images/opensearch/2.12/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.12/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${OS_HOST:-opensearch}:${OS_HOST:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index 2b71aabe..623c05b1 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -34,6 +34,9 @@ class GenerateOs extends Command '1.2' => [ 'real-version' => '1.2.1', ], + '1.3' => [ + 'real-version' => '1.3.0', + ], '2.3' => [ 'real-version' => '2.3.0' ], @@ -42,6 +45,9 @@ class GenerateOs extends Command ], '2.5' => [ 'real-version' => '2.5.0' + ], + '2.12' => [ + 'real-version' => '2.12.0' ] ]; From 4ba9b3287053c520352190036d757142634a2c24 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Thu, 28 Mar 2024 10:57:16 -0500 Subject: [PATCH 26/27] Codesniffer fix --- src/Test/Functional/Acceptance/Opensearch82Cest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Test/Functional/Acceptance/Opensearch82Cest.php b/src/Test/Functional/Acceptance/Opensearch82Cest.php index ea4344f6..8bfcd7de 100644 --- a/src/Test/Functional/Acceptance/Opensearch82Cest.php +++ b/src/Test/Functional/Acceptance/Opensearch82Cest.php @@ -20,5 +20,4 @@ class Opensearch82Cest extends OpensearchCest * Template version for testing */ protected const TEMPLATE_VERSION = '2.4.6'; - } From d0f5bceaae5683c52fa0f49e6fb266863951c554 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 3 Apr 2024 11:34:27 -0500 Subject: [PATCH 27/27] Bump to version 1.3.7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index aeeebcc5..fde460ba 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.6", + "version": "1.3.7", "license": [ "OSL-3.0", "AFL-3.0"