From 055e04bd3677e64e7fad1cc4f3399f8ad6519789 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 28 Nov 2022 15:56:30 -0600 Subject: [PATCH 01/10] MCLOUD-9683: Update Code of Conduct on public Cloud repos --- .github/CODE_OF_CONDUCT.md | 70 ++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 637f3a24..5eb057af 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -1,47 +1,75 @@ -# Contributor Covenant Code of Conduct +# Magento Code of Conduct ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to creating a positive environment include: +Examples of behavior that contribute to a positive environment for our project and community include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best, not just for us as individuals but for the overall community -Examples of unacceptable behavior by participants include: +Examples of unacceptable behavior include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Publishing others’ private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. +This Code of Conduct applies when an individual is representing the project or its community both within project spaces and in public spaces. Examples of representing a project or community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by first contacting the project team at engcom@adobe.com. Oversight of Adobe projects is handled by the Adobe Open Source Office, which has final say in any violations and enforcement of this Code of Conduct and can be reached at Grp-opensourceoffice@adobe.com. All complaints will be reviewed and investigated promptly and fairly. -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +The project team must respect the privacy and security of the reporter of any incident. -## Attribution +Project maintainers who do not follow or enforce the Code of Conduct may face temporary or permanent repercussions as determined by other members of the project's leadership or the Adobe Open Source Office. + +## Enforcement Guidelines + +Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem to be in violation of this Code of Conduct: + +**1. Correction** + +Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +Consequence: A private, written warning from project maintainers describing the violation and why the behavior was unacceptable. A public apology may be requested from the violator before any further involvement in the project by violator. + +**2. Warning** -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +Community Impact: A relatively minor violation through a single incident or series of actions. -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +Consequence: A written warning from project maintainers that includes stated consequences for continued unacceptable behavior. Violator must refrain from interacting with the people involved for a specified period of time as determined by the project maintainers, including, but not limited to, unsolicited interaction with those enforcing the Code of Conduct through channels such as community spaces and social media. Continued violations may lead to a temporary or permanent ban. + +**3. Temporary Ban** + +Community Impact: A more serious violation of community standards, including sustained unacceptable behavior. + +Consequence: A temporary ban from any interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Failure to comply with the temporary ban may lead to a permanent ban. + +**4. Permanent Ban** + +Community Impact: Demonstrating a consistent pattern of violation of community standards or an egregious violation of community standards, including, but not limited to, sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +Consequence: A permanent ban from any interaction with the community. + +## Attribution +This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. From e414436fe39982c092d9cc4265809a888738a5f7 Mon Sep 17 00:00:00 2001 From: Dmitry Chayka Date: Tue, 6 Dec 2022 22:53:36 -0500 Subject: [PATCH 02/10] Added ionCube extension to PHP8.1 image Dockerfile --- images/php/8.1-cli/Dockerfile | 9 +++++++++ images/php/8.1-fpm/Dockerfile | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/images/php/8.1-cli/Dockerfile b/images/php/8.1-cli/Dockerfile index 9708007e..651f17d9 100644 --- a/images/php/8.1-cli/Dockerfile +++ b/images/php/8.1-cli/Dockerfile @@ -164,6 +164,15 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && cd / \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium +RUN cd /tmp \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ + && export PHP_EXT_DIR=$(php-config --extension-dir) \ + && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ + && rm -rf ./ioncube \ + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz 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 diff --git a/images/php/8.1-fpm/Dockerfile b/images/php/8.1-fpm/Dockerfile index bb188c99..f9f544dd 100644 --- a/images/php/8.1-fpm/Dockerfile +++ b/images/php/8.1-fpm/Dockerfile @@ -139,6 +139,15 @@ RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ && cd / \ && rm -rf /tmp/libsodium \ && pecl install -o -f libsodium +RUN cd /tmp \ + && if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi \ + && curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && tar zxvf ioncube_loaders_lin_${ioncube_arch}.tar.gz \ + && export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") \ + && export PHP_EXT_DIR=$(php-config --extension-dir) \ + && cp "./ioncube/ioncube_loader_lin_${PHP_VERSION}.so" "${PHP_EXT_DIR}/ioncube.so" \ + && rm -rf ./ioncube \ + && rm ioncube_loaders_lin_${ioncube_arch}.tar.gz 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 From 9a22833b0eb07c4f1be09cc202199c0aa184fbd7 Mon Sep 17 00:00:00 2001 From: Dmitry Chayka Date: Wed, 7 Dec 2022 15:02:00 -0500 Subject: [PATCH 03/10] added php8.1 version to ExtensionResolver for ioncube --- src/Compose/Php/ExtensionResolver.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index c00f9198..45c74dcf 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -481,6 +481,20 @@ public static function getConfig(): array rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz BASH ], + '8.1' => [ + self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, + self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH +cd /tmp +if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi +curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_\${ioncube_arch}.tar.gz +tar zxvf ioncube_loaders_lin_\${ioncube_arch}.tar.gz +export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") +export PHP_EXT_DIR=$(php-config --extension-dir) +cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" +rm -rf ./ioncube +rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz +BASH + ] ], ]; } From 3a25089c19fbaff45d320441c0a1ddb9cf3f2a3c Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 9 Dec 2022 14:30:35 -0600 Subject: [PATCH 04/10] MCLOUD-9761: Added ionCube extension to PHP8.1 images to MCD --- src/Compose/Php/ExtensionResolver.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 45c74dcf..8fa9a01a 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -467,7 +467,7 @@ public static function getConfig(): array '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], ], 'ioncube' => [ - '>=7.0 <=7.4' => [ + '>=7.0 <8.0 || >8.0 <=8.1' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH cd /tmp @@ -481,20 +481,6 @@ public static function getConfig(): array rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz BASH ], - '8.1' => [ - self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, - self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH -cd /tmp -if [ $(uname -m) = "x86_64" ]; then ioncube_arch="x86-64"; else ioncube_arch="aarch64"; fi -curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_\${ioncube_arch}.tar.gz -tar zxvf ioncube_loaders_lin_\${ioncube_arch}.tar.gz -export PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;") -export PHP_EXT_DIR=$(php-config --extension-dir) -cp "./ioncube/ioncube_loader_lin_\${PHP_VERSION}.so" "\${PHP_EXT_DIR}/ioncube.so" -rm -rf ./ioncube -rm ioncube_loaders_lin_\${ioncube_arch}.tar.gz -BASH - ] ], ]; } From 5094270281216a67e154a812ac70ed2400af6510 Mon Sep 17 00:00:00 2001 From: Sandeep Sikharam Date: Fri, 16 Dec 2022 11:18:32 -0600 Subject: [PATCH 05/10] MCLOUD-9738: Adding images for new service versions. (#105) --- images/opensearch/2.3/Dockerfile | 21 +++ images/opensearch/2.3/docker-entrypoint.sh | 12 ++ images/opensearch/2.3/docker-healthcheck.sh | 12 ++ images/opensearch/2.4/Dockerfile | 21 +++ images/opensearch/2.4/docker-entrypoint.sh | 12 ++ images/opensearch/2.4/docker-healthcheck.sh | 12 ++ images/php/8.2-cli/Dockerfile | 192 ++++++++++++++++++++ images/php/8.2-cli/bin/cloud-build | 44 +++++ images/php/8.2-cli/bin/cloud-deploy | 37 ++++ images/php/8.2-cli/bin/cloud-post-deploy | 11 ++ images/php/8.2-cli/bin/ece-command | 7 + images/php/8.2-cli/bin/magento-command | 7 + images/php/8.2-cli/bin/magento-installer | 11 ++ images/php/8.2-cli/bin/mftf-command | 7 + images/php/8.2-cli/bin/run-cron | 3 + images/php/8.2-cli/bin/run-hooks | 61 +++++++ images/php/8.2-cli/docker-entrypoint.sh | 31 ++++ images/php/8.2-cli/etc/mail.ini | 2 + images/php/8.2-cli/etc/php-cli.ini | 10 + images/php/8.2-cli/etc/php-gnupg.ini | 1 + images/php/8.2-cli/etc/php-pcov.ini | 2 + images/php/8.2-cli/etc/php-xdebug.ini | 8 + images/php/8.2-fpm/Dockerfile | 150 +++++++++++++++ images/php/8.2-fpm/docker-entrypoint.sh | 24 +++ images/php/8.2-fpm/etc/mail.ini | 2 + images/php/8.2-fpm/etc/php-fpm.conf | 25 +++ images/php/8.2-fpm/etc/php-fpm.ini | 4 + images/php/8.2-fpm/etc/php-gnupg.ini | 1 + images/php/8.2-fpm/etc/php-pcov.ini | 2 + images/php/8.2-fpm/etc/php-xdebug.ini | 8 + images/varnish/7.1.1/Dockerfile | 3 + images/varnish/7.1.1/etc/default.vcl | 177 ++++++++++++++++++ src/Command/Image/GenerateOs.php | 6 + src/Command/Image/GeneratePhp.php | 22 ++- src/Compose/Php/ExtensionResolver.php | 8 +- 35 files changed, 949 insertions(+), 7 deletions(-) create mode 100644 images/opensearch/2.3/Dockerfile create mode 100755 images/opensearch/2.3/docker-entrypoint.sh create mode 100644 images/opensearch/2.3/docker-healthcheck.sh create mode 100644 images/opensearch/2.4/Dockerfile create mode 100755 images/opensearch/2.4/docker-entrypoint.sh create mode 100644 images/opensearch/2.4/docker-healthcheck.sh create mode 100644 images/php/8.2-cli/Dockerfile create mode 100644 images/php/8.2-cli/bin/cloud-build create mode 100644 images/php/8.2-cli/bin/cloud-deploy create mode 100644 images/php/8.2-cli/bin/cloud-post-deploy create mode 100644 images/php/8.2-cli/bin/ece-command create mode 100644 images/php/8.2-cli/bin/magento-command create mode 100644 images/php/8.2-cli/bin/magento-installer create mode 100644 images/php/8.2-cli/bin/mftf-command create mode 100644 images/php/8.2-cli/bin/run-cron create mode 100644 images/php/8.2-cli/bin/run-hooks create mode 100644 images/php/8.2-cli/docker-entrypoint.sh create mode 100644 images/php/8.2-cli/etc/mail.ini create mode 100644 images/php/8.2-cli/etc/php-cli.ini create mode 100644 images/php/8.2-cli/etc/php-gnupg.ini create mode 100644 images/php/8.2-cli/etc/php-pcov.ini create mode 100644 images/php/8.2-cli/etc/php-xdebug.ini create mode 100644 images/php/8.2-fpm/Dockerfile create mode 100644 images/php/8.2-fpm/docker-entrypoint.sh create mode 100644 images/php/8.2-fpm/etc/mail.ini create mode 100644 images/php/8.2-fpm/etc/php-fpm.conf create mode 100644 images/php/8.2-fpm/etc/php-fpm.ini create mode 100644 images/php/8.2-fpm/etc/php-gnupg.ini create mode 100644 images/php/8.2-fpm/etc/php-pcov.ini create mode 100644 images/php/8.2-fpm/etc/php-xdebug.ini create mode 100755 images/varnish/7.1.1/Dockerfile create mode 100755 images/varnish/7.1.1/etc/default.vcl diff --git a/images/opensearch/2.3/Dockerfile b/images/opensearch/2.3/Dockerfile new file mode 100644 index 00000000..1f52e728 --- /dev/null +++ b/images/opensearch/2.3/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.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/2.3/docker-entrypoint.sh b/images/opensearch/2.3/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.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/2.3/docker-healthcheck.sh b/images/opensearch/2.3/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.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.4/Dockerfile b/images/opensearch/2.4/Dockerfile new file mode 100644 index 00000000..b38adc78 --- /dev/null +++ b/images/opensearch/2.4/Dockerfile @@ -0,0 +1,21 @@ +FROM opensearchproject/opensearch:2.4.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.4/docker-entrypoint.sh b/images/opensearch/2.4/docker-entrypoint.sh new file mode 100755 index 00000000..ad80b15a --- /dev/null +++ b/images/opensearch/2.4/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.4/docker-healthcheck.sh b/images/opensearch/2.4/docker-healthcheck.sh new file mode 100644 index 00000000..4081bbb2 --- /dev/null +++ b/images/opensearch/2.4/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/php/8.2-cli/Dockerfile b/images/php/8.2-cli/Dockerfile new file mode 100644 index 00000000..f5bebb6a --- /dev/null +++ b/images/php/8.2-cli/Dockerfile @@ -0,0 +1,192 @@ +# 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.2-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 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 \ + && rm -rf /var/lib/apt/lists/* + +# Install PyYAML +RUN pip3 install --upgrade setuptools \ + && pip3 install pyyaml + +# 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.2-cli/bin/cloud-build b/images/php/8.2-cli/bin/cloud-build new file mode 100644 index 00000000..bbd584c9 --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/cloud-deploy b/images/php/8.2-cli/bin/cloud-deploy new file mode 100644 index 00000000..f6b891bf --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/cloud-post-deploy b/images/php/8.2-cli/bin/cloud-post-deploy new file mode 100644 index 00000000..f5bb3956 --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/ece-command b/images/php/8.2-cli/bin/ece-command new file mode 100644 index 00000000..36d896c5 --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/magento-command b/images/php/8.2-cli/bin/magento-command new file mode 100644 index 00000000..8d439f7d --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/magento-installer b/images/php/8.2-cli/bin/magento-installer new file mode 100644 index 00000000..73645ab7 --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/mftf-command b/images/php/8.2-cli/bin/mftf-command new file mode 100644 index 00000000..88eaa1df --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/run-cron b/images/php/8.2-cli/bin/run-cron new file mode 100644 index 00000000..f6554a5c --- /dev/null +++ b/images/php/8.2-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.2-cli/bin/run-hooks b/images/php/8.2-cli/bin/run-hooks new file mode 100644 index 00000000..8ac215c9 --- /dev/null +++ b/images/php/8.2-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.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh new file mode 100644 index 00000000..1e025ca7 --- /dev/null +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -0,0 +1,31 @@ +#!/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 + +# 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.2-cli/etc/mail.ini b/images/php/8.2-cli/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.2-cli/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.2-cli/etc/php-cli.ini b/images/php/8.2-cli/etc/php-cli.ini new file mode 100644 index 00000000..dfaf04e4 --- /dev/null +++ b/images/php/8.2-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.2-cli/etc/php-gnupg.ini b/images/php/8.2-cli/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.2-cli/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.2-cli/etc/php-pcov.ini b/images/php/8.2-cli/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.2-cli/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.2-cli/etc/php-xdebug.ini b/images/php/8.2-cli/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.2-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.2-fpm/Dockerfile b/images/php/8.2-fpm/Dockerfile new file mode 100644 index 00000000..7ae884d7 --- /dev/null +++ b/images/php/8.2-fpm/Dockerfile @@ -0,0 +1,150 @@ +# 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.2-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 \ + && 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.2-fpm/docker-entrypoint.sh b/images/php/8.2-fpm/docker-entrypoint.sh new file mode 100644 index 00000000..0c8c5c9c --- /dev/null +++ b/images/php/8.2-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.2-fpm/etc/mail.ini b/images/php/8.2-fpm/etc/mail.ini new file mode 100644 index 00000000..c1620288 --- /dev/null +++ b/images/php/8.2-fpm/etc/mail.ini @@ -0,0 +1,2 @@ +; Sendmail +sendmail_path = ${SENDMAIL_PATH} diff --git a/images/php/8.2-fpm/etc/php-fpm.conf b/images/php/8.2-fpm/etc/php-fpm.conf new file mode 100644 index 00000000..d988b314 --- /dev/null +++ b/images/php/8.2-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.2-fpm/etc/php-fpm.ini b/images/php/8.2-fpm/etc/php-fpm.ini new file mode 100644 index 00000000..387c8aeb --- /dev/null +++ b/images/php/8.2-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.2-fpm/etc/php-gnupg.ini b/images/php/8.2-fpm/etc/php-gnupg.ini new file mode 100644 index 00000000..f0f7e9a7 --- /dev/null +++ b/images/php/8.2-fpm/etc/php-gnupg.ini @@ -0,0 +1 @@ +extension = gnupg.so diff --git a/images/php/8.2-fpm/etc/php-pcov.ini b/images/php/8.2-fpm/etc/php-pcov.ini new file mode 100644 index 00000000..a9f0145a --- /dev/null +++ b/images/php/8.2-fpm/etc/php-pcov.ini @@ -0,0 +1,2 @@ +pcov.enabled = 1 +pcov.directory = ${MAGENTO_ROOT} diff --git a/images/php/8.2-fpm/etc/php-xdebug.ini b/images/php/8.2-fpm/etc/php-xdebug.ini new file mode 100644 index 00000000..57b1bd9f --- /dev/null +++ b/images/php/8.2-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 diff --git a/images/varnish/7.1.1/Dockerfile b/images/varnish/7.1.1/Dockerfile new file mode 100755 index 00000000..90b5f19a --- /dev/null +++ b/images/varnish/7.1.1/Dockerfile @@ -0,0 +1,3 @@ +FROM varnish:7.1.1 + +COPY etc/default.vcl /etc/varnish/ diff --git a/images/varnish/7.1.1/etc/default.vcl b/images/varnish/7.1.1/etc/default.vcl new file mode 100755 index 00000000..d9a17a55 --- /dev/null +++ b/images/varnish/7.1.1/etc/default.vcl @@ -0,0 +1,177 @@ +vcl 4.0; + +import std; + +# The minimal Varnish version is 4.0 +# For SSL offloading, pass the following header in your proxy server or load balancer: 'SSL-OFFLOADED: https' + +backend default { + .host = "web"; + .port = "8080"; + .first_byte_timeout = 300s; + .between_bytes_timeout = 300s; +} + +sub vcl_recv { + # Ensure the true IP is sent onwards. + # This was an issue getting xdebug working through varnish + # whilst having a proxy infront of varnish (for local docker dev) + if (req.http.X-Real-Ip) { + set req.http.X-Forwarded-For = req.http.X-Real-Ip; + } + + if (req.method == "PURGE") { + if (!req.http.X-Magento-Tags-Pattern) { + return (synth(400, "X-Magento-Tags-Pattern header required")); + } + ban("obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern); + return (synth(200, "Purged")); + } + + # Bypass debug session + if (req.http.Cookie ~ "(^|;\s*)(XDEBUG_SESSION=.*)(;|$)") { + return (pass); + } + + if (req.method != "GET" && + req.method != "HEAD" && + req.method != "PUT" && + req.method != "POST" && + req.method != "TRACE" && + req.method != "OPTIONS" && + req.method != "DELETE") { + /* Non-RFC2616 or CONNECT which is weird. */ + return (pipe); + } + + # We only deal with GET and HEAD by default + if (req.method != "GET" && req.method != "HEAD") { + return (pass); + } + + # Bypass shopping cart, checkout and search requests + if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { + return (pass); + } + + # normalize url in case of leading HTTP scheme and domain + set req.url = regsub(req.url, "^http[s]?://", ""); + + # collect all cookies + std.collect(req.http.Cookie); + + # Compression filter. See https://www.varnish-cache.org/trac/wiki/FAQ/Compression + if (req.http.Accept-Encoding) { + if (req.url ~ "\.(jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf|flv)$") { + # No point in compressing these + unset req.http.Accept-Encoding; + } elsif (req.http.Accept-Encoding ~ "gzip") { + set req.http.Accept-Encoding = "gzip"; + } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") { + set req.http.Accept-Encoding = "deflate"; + } else { + # unkown algorithm + unset req.http.Accept-Encoding; + } + } + + # Remove Google gclid parameters to minimize the cache objects + set req.url = regsuball(req.url,"\?gclid=[^&]+$",""); # strips when QS = "?gclid=AAA" + set req.url = regsuball(req.url,"\?gclid=[^&]+&","?"); # strips when QS = "?gclid=AAA&foo=bar" + set req.url = regsuball(req.url,"&gclid=[^&]+",""); # strips when QS = "?foo=bar&gclid=AAA" or QS = "?foo=bar&gclid=AAA&bar=baz" + + # static files are always cacheable. remove SSL flag and cookie + if (req.url ~ "^/(pub/)?(media|static)/.*\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)$") { + unset req.http.Https; + unset req.http.SSL-OFFLOADED; + unset req.http.Cookie; + } + + return (hash); +} + +sub vcl_hash { + if (req.http.cookie ~ "X-Magento-Vary=") { + hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "\1")); + } + + # For multi site configurations to not cache each other's content + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + + # To make sure http users don't see ssl warning + if (req.http.SSL-OFFLOADED) { + hash_data(req.http.SSL-OFFLOADED); + } + + # Cache https seperately + if (req.http.X-Forwarded-Proto) { + hash_data(req.http.X-Forwarded-Proto); + } +} + +sub vcl_backend_response { + if (beresp.http.content-type ~ "text") { + set beresp.do_esi = true; + } + + if (bereq.url ~ "\.js$" || beresp.http.content-type ~ "text") { + set beresp.do_gzip = true; + } + + # cache only successfully responses and 404s + if (beresp.status != 200 && beresp.status != 404) { + set beresp.ttl = 0s; + set beresp.uncacheable = true; + return (deliver); + } elsif (beresp.http.Cache-Control ~ "private") { + set beresp.uncacheable = true; + set beresp.ttl = 86400s; + return (deliver); + } + + if (beresp.http.X-Magento-Debug) { + set beresp.http.X-Magento-Cache-Control = beresp.http.Cache-Control; + } + + # validate if we need to cache it and prevent from setting cookie + # images, css and js are cacheable by default so we have to remove cookie also + if (beresp.ttl > 0s && (bereq.method == "GET" || bereq.method == "HEAD")) { + unset beresp.http.set-cookie; + if (bereq.url !~ "\.(ico|css|js|jpg|jpeg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff|woff2|eot|ttf|otf)(\?|$)") { + set beresp.http.Pragma = "no-cache"; + set beresp.http.Expires = "-1"; + set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0"; + set beresp.grace = 1m; + } + } + + # If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass + if (beresp.ttl <= 0s || + beresp.http.Surrogate-control ~ "no-store" || + (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { + # Mark as Hit-For-Pass for the next 2 minutes + set beresp.ttl = 120s; + set beresp.uncacheable = true; + } + return (deliver); +} + +sub vcl_deliver { + if (resp.http.x-varnish ~ " ") { + set resp.http.X-Magento-Cache-Debug = "HIT"; + } else { + set resp.http.X-Magento-Cache-Debug = "MISS"; + } + + unset resp.http.X-Magento-Debug; + unset resp.http.X-Magento-Tags; + unset resp.http.X-Powered-By; + unset resp.http.Server; + unset resp.http.X-Varnish; + unset resp.http.Via; + unset resp.http.Link; +} diff --git a/src/Command/Image/GenerateOs.php b/src/Command/Image/GenerateOs.php index 4b277b02..f2ebefab 100644 --- a/src/Command/Image/GenerateOs.php +++ b/src/Command/Image/GenerateOs.php @@ -34,6 +34,12 @@ class GenerateOs extends Command '1.2' => [ 'real-version' => '1.2.1', ], + '2.3' => [ + 'real-version' => '2.3.0' + ], + '2.4' => [ + 'real-version' => '2.4.0' + ] ]; /** diff --git a/src/Command/Image/GeneratePhp.php b/src/Command/Image/GeneratePhp.php index d6dd63c0..e33e4c33 100644 --- a/src/Command/Image/GeneratePhp.php +++ b/src/Command/Image/GeneratePhp.php @@ -26,14 +26,15 @@ class GeneratePhp extends Command { private const NAME = 'image:generate:php'; - private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1']; + private const SUPPORTED_VERSIONS = ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']; private const VERSION_MAP = [ '7.2' => '7.2', '7.3' => '7.3', '7.4' => '7.4', '8.0' => '8.0.14', - '8.1' => '8.1.1' + '8.1' => '8.1.1', + '8.2' => '8.2' ]; private const EDITION_CLI = 'cli'; @@ -303,9 +304,7 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string [ '{%note%}' => '# This file is automatically generated. Do not edit directly. #', '{%version%}' => self::VERSION_MAP[$phpVersion], - '{%composer_version%}' => $this->semver::satisfies($phpVersion, '<8.0') - ? '1.10.22' - : '2.1.14', + '{%composer_version%}' => $this->getComposerVersion($phpVersion), '{%packages%}' => implode(" \\\n ", array_unique($packages)), '{%docker-php-ext-configure%}' => implode(PHP_EOL, $phpExtCoreConfigOptions), '{%docker-php-ext-install%}' => $phpExtCore @@ -325,4 +324,17 @@ private function buildDockerfile(string $dockerfile, string $phpVersion, string ] ); } + + /** + * @param string $phpVersion + * @return string + */ + private function getComposerVersion(string $phpVersion) : string + { + if ($this->semver::satisfies($phpVersion, '<8.0')) { + return '1.10.22'; + } + + return $this->semver::satisfies($phpVersion, '<8.2') ? '2.1.14' : '2.2.18'; + } } diff --git a/src/Compose/Php/ExtensionResolver.php b/src/Compose/Php/ExtensionResolver.php index 8fa9a01a..46b95dde 100644 --- a/src/Compose/Php/ExtensionResolver.php +++ b/src/Compose/Php/ExtensionResolver.php @@ -340,7 +340,7 @@ public static function getConfig(): array '>=7.0' => [self::EXTENSION_TYPE => self::EXTENSION_TYPE_CORE], ], 'zookeeper' => [ - '>=7.2' => [ + '>=7.2 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_INSTALLATION_SCRIPT, // phpcs:disable self::EXTENSION_INSTALLATION_SCRIPT => <<< BASH @@ -423,10 +423,14 @@ public static function getConfig(): array ], ], 'xdebug' => [ - '>=7.2' => [ + '>=7.2 <8.2' => [ self::EXTENSION_TYPE => self::EXTENSION_TYPE_PECL, self::EXTENSION_PACKAGE_NAME => 'xdebug-3.1.2', ], + '>=8.2' => [ + 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 864e6c7a54155e5af052b2e1c86a928a9b9cacad Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Wed, 4 Jan 2023 22:03:53 +0530 Subject: [PATCH 06/10] AC-7423::Upgrade Test Pipeline jenkins job failed while upgrading from 245p1 to 245p2 - Clear composer cache --- images/php/7.4-cli/docker-entrypoint.sh | 1 + images/php/8.0-cli/docker-entrypoint.sh | 1 + images/php/8.1-cli/docker-entrypoint.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/images/php/7.4-cli/docker-entrypoint.sh b/images/php/7.4-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/7.4-cli/docker-entrypoint.sh +++ b/images/php/7.4-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.0-cli/docker-entrypoint.sh b/images/php/8.0-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.0-cli/docker-entrypoint.sh +++ b/images/php/8.0-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/8.1-cli/docker-entrypoint.sh b/images/php/8.1-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.1-cli/docker-entrypoint.sh +++ b/images/php/8.1-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ From cd00c87b47ca068070636576cb9fb7906437dec1 Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Thu, 5 Jan 2023 00:08:06 +0530 Subject: [PATCH 07/10] AC-7423::Upgrade Test Pipeline jenkins job failed while upgrading - Clear composer cache --- images/php/8.2-cli/docker-entrypoint.sh | 1 + images/php/cli/docker-entrypoint.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/images/php/8.2-cli/docker-entrypoint.sh b/images/php/8.2-cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100644 --- a/images/php/8.2-cli/docker-entrypoint.sh +++ b/images/php/8.2-cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ diff --git a/images/php/cli/docker-entrypoint.sh b/images/php/cli/docker-entrypoint.sh index 1e025ca7..f26def5d 100755 --- a/images/php/cli/docker-entrypoint.sh +++ b/images/php/cli/docker-entrypoint.sh @@ -19,6 +19,7 @@ fi # Configure composer [ ! -z "${COMPOSER_VERSION}" ] && \ + composer clearcache && \ composer self-update $COMPOSER_VERSION [ ! -z "${COMPOSER_GITHUB_TOKEN}" ] && \ From 91ab379ac36004c88458f560a4e697e68fcd6af8 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 17 Jan 2023 15:37:29 -0600 Subject: [PATCH 08/10] MCLOUD-9856: Bump MCD version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdee8976..55559df2 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.4", + "version": "1.3.5", "license": [ "OSL-3.0", "AFL-3.0" From 06a392d8d0c0a30db7ad4c69f63f4a4cfcde9a0d Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 14 Feb 2023 14:48:54 -0600 Subject: [PATCH 09/10] MCLOUD-9951: MCD uses wrong OpenSearch version for Magento 2.4.6 --- .../ProductionBuilder/Service/OpenSearch.php | 24 +- src/Test/Integration/BuildComposeTest.php | 18 ++ .../.docker/config.php.dist | 2 +- .../.magento/services.yaml | 2 +- .../docker-compose.exp.yml | 2 +- .../cloud_base_os_2.3_cli/.docker/.gitignore | 0 .../.docker/config.php.dist | 75 ++++++ .../cloud_base_os_2.3_cli/.magento.app.yaml | 30 +++ .../.magento/services.yaml | 22 ++ .../cloud_base_os_2.3_cli/composer.json | 6 + .../docker-compose.exp.yml | 234 ++++++++++++++++++ .../cloud_base_os_2_cli/.docker/.gitignore | 0 .../.docker/config.php.dist | 75 ++++++ .../cloud_base_os_2_cli/.magento.app.yaml | 30 +++ .../.magento/services.yaml | 22 ++ .../_files/cloud_base_os_2_cli/composer.json | 6 + .../docker-compose.exp.yml | 234 ++++++++++++++++++ 17 files changed, 778 insertions(+), 4 deletions(-) create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json create mode 100644 src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/composer.json create mode 100644 src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml diff --git a/src/Compose/ProductionBuilder/Service/OpenSearch.php b/src/Compose/ProductionBuilder/Service/OpenSearch.php index 79056fc0..32519de2 100644 --- a/src/Compose/ProductionBuilder/Service/OpenSearch.php +++ b/src/Compose/ProductionBuilder/Service/OpenSearch.php @@ -18,8 +18,16 @@ */ class OpenSearch implements ServiceBuilderInterface { + /** + * The list of installed plugins by default + */ private const INSTALLED_PLUGINS = ['analysis-icu', 'analysis-phonetic']; + /** + * The default OpenSearch version, which will be used if config has only major version + */ + private const DEFAULT_VERSION = '2.4'; + /** * @var ServiceFactory */ @@ -75,7 +83,7 @@ public function getConfig(Config $config): array return $this->serviceFactory->create( $this->getServiceName(), - $config->getServiceVersion($this->getServiceName()), + $this->getVersion($config), !empty($osEnvVars) ? ['environment' => $osEnvVars] : [], $config->getServiceImage($this->getServiceName()), $config->getCustomRegistry(), @@ -98,4 +106,18 @@ public function getDependsOn(Config $config): array { return []; } + + /** + * If config has only major version 2 - returns default OpenSearch version for MCD + * @see OpenSearch::DEFAULT_VERSION + * + * @param Config $config + * @return string + * @throws \Magento\CloudDocker\App\ConfigurationMismatchException + */ + private function getVersion(Config $config): string + { + $version = $config->getServiceVersion($this->getServiceName()); + return $version == '2' ? self::DEFAULT_VERSION : $version; + } } diff --git a/src/Test/Integration/BuildComposeTest.php b/src/Test/Integration/BuildComposeTest.php index 707c262f..288f5635 100644 --- a/src/Test/Integration/BuildComposeTest.php +++ b/src/Test/Integration/BuildComposeTest.php @@ -82,6 +82,24 @@ public function buildDataProvider(): array [CliSource::OPTION_WITH_MARIADB_CONF, true] ] ], + 'cloud-base-os-2-cli' => [ + __DIR__ . '/_files/cloud_base_os_2_cli', + [ + [CliSource::OPTION_MODE, BuilderFactory::BUILDER_PRODUCTION], + [CliSource::OPTION_WITH_ENTRYPOINT, true], + [CliSource::OPTION_WITH_MARIADB_CONF, true], + [CliSource::OPTION_OS, '2'], + ] + ], + 'cloud-base-os-2.3-cli' => [ + __DIR__ . '/_files/cloud_base_os_2.3_cli', + [ + [CliSource::OPTION_MODE, BuilderFactory::BUILDER_PRODUCTION], + [CliSource::OPTION_WITH_ENTRYPOINT, true], + [CliSource::OPTION_WITH_MARIADB_CONF, true], + [CliSource::OPTION_OS, '2.3'], + ] + ], 'custom_registry' => [ __DIR__ . '/_files/custom_registry', [ diff --git a/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist index 73c31674..f0e88e79 100644 --- a/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist +++ b/src/Test/Integration/_files/cloud_base_developer/.docker/config.php.dist @@ -30,7 +30,7 @@ return [ [ 'host' => 'opensearch', 'port' => '9200', - 'type' => 'opensearch:1.1' + 'type' => 'opensearch:2' ] ] ])), diff --git a/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml index cad17cb8..f2b85f32 100644 --- a/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml +++ b/src/Test/Integration/_files/cloud_base_developer/.magento/services.yaml @@ -14,7 +14,7 @@ elasticsearch: - plugin_2 opensearch: - type: opensearchsearch:1.1 + type: opensearchsearch:2 disk: 512 configuration: plugins: 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 4282169c..e56337e6 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 @@ -65,7 +65,7 @@ services: - elasticsearch.magento2.docker opensearch: hostname: opensearch.magento2.docker - image: 'magento/magento-cloud-docker-opensearch:1.1-1.2.0' + image: 'magento/magento-cloud-docker-opensearch:2.4-1.2.0' ulimits: memlock: soft: -1 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist new file mode 100644 index 00000000..a6fc549b --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.docker/config.php.dist @@ -0,0 +1,75 @@ + base64_encode(json_encode([ + 'database' => [ + [ + 'host' => 'db', + 'path' => 'magento2', + 'password' => 'magento2', + 'username' => 'magento2', + 'port' => '3306', + 'type' => 'mysql:10.2' + ] + ], + 'redis' => [ + [ + 'host' => 'redis', + 'port' => '6379', + 'type' => 'redis:5.0' + ] + ], + 'elasticsearch' => [ + [ + 'host' => 'elasticsearch', + 'port' => '9200', + 'type' => 'elasticsearch:6.5' + ] + ], + 'opensearch' => [ + [ + 'host' => 'opensearch', + 'port' => '9200', + 'type' => 'opensearch:2.3' + ] + ] + ])), + 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ + 'http://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'http://{default}' + ], + 'https://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'https://{default}' + ] + ])), + 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ + 'ADMIN_EMAIL' => 'admin@example.com', + 'ADMIN_PASSWORD' => '123123q', + 'ADMIN_URL' => 'admin' + ])), + 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ + 'hooks' => [ + + ], + 'mounts' => [ + 'var' => [ + 'path' => 'var', + 'orig' => 'shared:files/var' + ], + 'app/etc' => [ + 'path' => 'app/etc', + 'orig' => 'shared:files/etc' + ], + 'pub/media' => [ + 'path' => 'pub/media', + 'orig' => 'shared:files/media' + ], + 'pub/static' => [ + 'path' => 'pub/static', + 'orig' => 'shared:files/static' + ] + ] + ])), +]; diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml new file mode 100644 index 00000000..03f4f7b2 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento.app.yaml @@ -0,0 +1,30 @@ +name: magento + +type: php:7.3 +build: + flavor: composer + +runtime: + extensions: + - redis + - xsl + - json + - newrelic + - sodium + +relationships: + database: "mysql:mysql" + redis: "redis:redis" + elasticsearch: "elasticsearch:elasticsearch" + opensearch: "opensearch:opensearch" + +mounts: + "var": "shared:files/var" + "app/etc": "shared:files/etc" + "pub/media": "shared:files/media" + "pub/static": "shared:files/static" + +crons: + cronrun: + spec: "* * * * *" + cmd: "php bin/magento cron:run" diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml new file mode 100644 index 00000000..cad17cb8 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/.magento/services.yaml @@ -0,0 +1,22 @@ +mysql: + type: mysql:10.2 + disk: 2048 + +redis: + type: redis:5.0 + +elasticsearch: + type: elasticsearch:6.5 + disk: 1024 + configuration: + plugins: + - plugin_1 + - plugin_2 + +opensearch: + type: opensearchsearch:1.1 + disk: 512 + configuration: + plugins: + - plugin_3 + - plugin_4 diff --git a/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json b/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json new file mode 100644 index 00000000..6ed415ed --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/composer.json @@ -0,0 +1,6 @@ +{ + "name": "magento/project-enterprise-edition", + "description": "Composer file for integration tests", + "type": "project", + "version": "2.2.0" +} 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 new file mode 100644 index 00000000..e5ec19e0 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2.3_cli/docker-compose.exp.yml @@ -0,0 +1,234 @@ +version: '2.1' +services: + db: + hostname: db.magento2.docker + image: 'mariadb:10.2' + shm_size: 2gb + environment: + - MYSQL_ROOT_PASSWORD=magento2 + - MYSQL_DATABASE=magento2 + - MYSQL_USER=magento2 + - MYSQL_PASSWORD=magento2 + ports: + - '3306' + volumes: + - '.docker/mnt:/mnt:rw,delegated' + - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' + - 'magento-magento-db:/var/lib/mysql' + - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' + healthcheck: + test: 'mysqladmin ping -h localhost -pmagento2' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - db.magento2.docker + redis: + hostname: redis.magento2.docker + image: 'redis:5.0' + volumes: + - /data + ports: + - 6379 + sysctls: + net.core.somaxconn: 1024 + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + healthcheck: + test: 'redis-cli ping || exit 1' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - redis.magento2.docker + elasticsearch: + hostname: elasticsearch.magento2.docker + image: 'magento/magento-cloud-docker-elasticsearch:6.5-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - bootstrap.memory_lock=true + - 'ES_PLUGINS=plugin_1 plugin_2' + networks: + magento: + aliases: + - elasticsearch.magento2.docker + opensearch: + hostname: opensearch.magento2.docker + image: 'magento/magento-cloud-docker-opensearch:2.3-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - discovery.seed_hosts=opensearch + - bootstrap.memory_lock=true + - DISABLE_SECURITY_PLUGIN=true + - 'OS_PLUGINS=plugin_3 plugin_4' + networks: + magento: + aliases: + - opensearch.magento2.docker + fpm: + hostname: fpm.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - fpm.magento2.docker + depends_on: + db: + condition: service_healthy + web: + hostname: web.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + environment: + - WITH_XDEBUG=0 + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + networks: + magento: + aliases: + - web.magento2.docker + depends_on: + fpm: + condition: service_started + varnish: + hostname: varnish.magento2.docker + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' + networks: + magento: + aliases: + - varnish.magento2.docker + depends_on: + web: + condition: service_started + tls: + hostname: tls.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + networks: + magento: + aliases: + - magento2.docker + environment: + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + - UPSTREAM_HOST=varnish + - UPSTREAM_PORT=80 + ports: + - '80:80' + - '443:443' + depends_on: + varnish: + condition: service_started + generic: + hostname: generic.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + env_file: ./.docker/config.env + environment: + - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' + build: + hostname: build.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:rw,delegated' + - 'magento-vendor:/app/vendor:rw,delegated' + - 'magento-generated:/app/generated:rw,delegated' + - '~/.composer/cache:/composer/cache:rw,delegated' + networks: + magento-build: + aliases: + - build.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + deploy: + hostname: deploy.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - deploy.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + mailhog: + hostname: mailhog.magento2.docker + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' + ports: + - '1025:1025' + - '8025:8025' + networks: + magento: + aliases: + - mailhog.magento2.docker +volumes: + magento-vendor: { } + magento-generated: { } + magento-var: { } + magento-app-etc: { } + magento-pub-media: { } + magento-pub-static: { } + magento-magento-db: { } +networks: + magento: + driver: bridge + magento-build: + driver: bridge diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist new file mode 100644 index 00000000..f0e88e79 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.docker/config.php.dist @@ -0,0 +1,75 @@ + base64_encode(json_encode([ + 'database' => [ + [ + 'host' => 'db', + 'path' => 'magento2', + 'password' => 'magento2', + 'username' => 'magento2', + 'port' => '3306', + 'type' => 'mysql:10.2' + ] + ], + 'redis' => [ + [ + 'host' => 'redis', + 'port' => '6379', + 'type' => 'redis:5.0' + ] + ], + 'elasticsearch' => [ + [ + 'host' => 'elasticsearch', + 'port' => '9200', + 'type' => 'elasticsearch:6.5' + ] + ], + 'opensearch' => [ + [ + 'host' => 'opensearch', + 'port' => '9200', + 'type' => 'opensearch:2' + ] + ] + ])), + 'MAGENTO_CLOUD_ROUTES' => base64_encode(json_encode([ + 'http://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'http://{default}' + ], + 'https://magento2.docker/' => [ + 'type' => 'upstream', + 'original_url' => 'https://{default}' + ] + ])), + 'MAGENTO_CLOUD_VARIABLES' => base64_encode(json_encode([ + 'ADMIN_EMAIL' => 'admin@example.com', + 'ADMIN_PASSWORD' => '123123q', + 'ADMIN_URL' => 'admin' + ])), + 'MAGENTO_CLOUD_APPLICATION' => base64_encode(json_encode([ + 'hooks' => [ + + ], + 'mounts' => [ + 'var' => [ + 'path' => 'var', + 'orig' => 'shared:files/var' + ], + 'app/etc' => [ + 'path' => 'app/etc', + 'orig' => 'shared:files/etc' + ], + 'pub/media' => [ + 'path' => 'pub/media', + 'orig' => 'shared:files/media' + ], + 'pub/static' => [ + 'path' => 'pub/static', + 'orig' => 'shared:files/static' + ] + ] + ])), +]; diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml new file mode 100644 index 00000000..03f4f7b2 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento.app.yaml @@ -0,0 +1,30 @@ +name: magento + +type: php:7.3 +build: + flavor: composer + +runtime: + extensions: + - redis + - xsl + - json + - newrelic + - sodium + +relationships: + database: "mysql:mysql" + redis: "redis:redis" + elasticsearch: "elasticsearch:elasticsearch" + opensearch: "opensearch:opensearch" + +mounts: + "var": "shared:files/var" + "app/etc": "shared:files/etc" + "pub/media": "shared:files/media" + "pub/static": "shared:files/static" + +crons: + cronrun: + spec: "* * * * *" + cmd: "php bin/magento cron:run" diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml new file mode 100644 index 00000000..cad17cb8 --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/.magento/services.yaml @@ -0,0 +1,22 @@ +mysql: + type: mysql:10.2 + disk: 2048 + +redis: + type: redis:5.0 + +elasticsearch: + type: elasticsearch:6.5 + disk: 1024 + configuration: + plugins: + - plugin_1 + - plugin_2 + +opensearch: + type: opensearchsearch:1.1 + disk: 512 + configuration: + plugins: + - plugin_3 + - plugin_4 diff --git a/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json b/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json new file mode 100644 index 00000000..6ed415ed --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/composer.json @@ -0,0 +1,6 @@ +{ + "name": "magento/project-enterprise-edition", + "description": "Composer file for integration tests", + "type": "project", + "version": "2.2.0" +} 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 new file mode 100644 index 00000000..c385367a --- /dev/null +++ b/src/Test/Integration/_files/cloud_base_os_2_cli/docker-compose.exp.yml @@ -0,0 +1,234 @@ +version: '2.1' +services: + db: + hostname: db.magento2.docker + image: 'mariadb:10.2' + shm_size: 2gb + environment: + - MYSQL_ROOT_PASSWORD=magento2 + - MYSQL_DATABASE=magento2 + - MYSQL_USER=magento2 + - MYSQL_PASSWORD=magento2 + ports: + - '3306' + volumes: + - '.docker/mnt:/mnt:rw,delegated' + - '.docker/mysql/mariadb.conf.d:/etc/mysql/mariadb.conf.d' + - 'magento-magento-db:/var/lib/mysql' + - '.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d' + healthcheck: + test: 'mysqladmin ping -h localhost -pmagento2' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - db.magento2.docker + redis: + hostname: redis.magento2.docker + image: 'redis:5.0' + volumes: + - /data + ports: + - 6379 + sysctls: + net.core.somaxconn: 1024 + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + healthcheck: + test: 'redis-cli ping || exit 1' + interval: 30s + timeout: 30s + retries: 3 + networks: + magento: + aliases: + - redis.magento2.docker + elasticsearch: + hostname: elasticsearch.magento2.docker + image: 'magento/magento-cloud-docker-elasticsearch:6.5-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - bootstrap.memory_lock=true + - 'ES_PLUGINS=plugin_1 plugin_2' + networks: + magento: + aliases: + - elasticsearch.magento2.docker + opensearch: + hostname: opensearch.magento2.docker + image: 'magento/magento-cloud-docker-opensearch:2.4-1.2.0' + ulimits: + memlock: + soft: -1 + hard: -1 + environment: + - cluster.name=docker-cluster + - discovery.type=single-node + - discovery.seed_hosts=opensearch + - bootstrap.memory_lock=true + - DISABLE_SECURITY_PLUGIN=true + - 'OS_PLUGINS=plugin_3 plugin_4' + networks: + magento: + aliases: + - opensearch.magento2.docker + fpm: + hostname: fpm.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-fpm-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - fpm.magento2.docker + depends_on: + db: + condition: service_healthy + web: + hostname: web.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + environment: + - WITH_XDEBUG=0 + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + networks: + magento: + aliases: + - web.magento2.docker + depends_on: + fpm: + condition: service_started + varnish: + hostname: varnish.magento2.docker + image: 'magento/magento-cloud-docker-varnish:6.6-1.2.0' + networks: + magento: + aliases: + - varnish.magento2.docker + depends_on: + web: + condition: service_started + tls: + hostname: tls.magento2.docker + image: 'magento/magento-cloud-docker-nginx:1.19-1.2.0' + extends: generic + networks: + magento: + aliases: + - magento2.docker + environment: + - NGINX_WORKER_PROCESSES=1 + - NGINX_WORKER_CONNECTIONS=1024 + - UPSTREAM_HOST=varnish + - UPSTREAM_PORT=80 + ports: + - '80:80' + - '443:443' + depends_on: + varnish: + condition: service_started + generic: + hostname: generic.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + env_file: ./.docker/config.env + environment: + - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium redis' + - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025' + build: + hostname: build.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:rw,delegated' + - 'magento-vendor:/app/vendor:rw,delegated' + - 'magento-generated:/app/generated:rw,delegated' + - '~/.composer/cache:/composer/cache:rw,delegated' + networks: + magento-build: + aliases: + - build.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + deploy: + hostname: deploy.magento2.docker + image: 'magento/magento-cloud-docker-php:7.3-cli-1.2.0' + extends: generic + volumes: + - '.:/app:ro,delegated' + - 'magento-vendor:/app/vendor:ro,delegated' + - 'magento-generated:/app/generated:ro,delegated' + - 'magento-var:/app/var:rw,delegated' + - 'magento-app-etc:/app/app/etc:rw,delegated' + - 'magento-pub-media:/app/pub/media:rw,delegated' + - 'magento-pub-static:/app/pub/static:rw,delegated' + - '.docker/mnt:/mnt:rw,delegated' + networks: + magento: + aliases: + - deploy.magento2.docker + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + elasticsearch: + condition: service_healthy + opensearch: + condition: service_healthy + mailhog: + hostname: mailhog.magento2.docker + image: 'magento/magento-cloud-docker-mailhog:1.0-1.2.0' + ports: + - '1025:1025' + - '8025:8025' + networks: + magento: + aliases: + - mailhog.magento2.docker +volumes: + magento-vendor: { } + magento-generated: { } + magento-var: { } + magento-app-etc: { } + magento-pub-media: { } + magento-pub-static: { } + magento-magento-db: { } +networks: + magento: + driver: bridge + magento-build: + driver: bridge From 52012b18c90fc21eeb0fcdfc830676c635b16b04 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 1 Mar 2023 14:28:34 -0600 Subject: [PATCH 10/10] MCLOUD-9902: Add FT to Magento Cloud Tools for PHP 8.2 & Magento 2.4.6 (#109) --- composer.json | 2 +- .../Functional/Acceptance/AbstractCest.php | 4 +- .../Acceptance/Acceptance81Cest.php | 21 ++++++++ .../Functional/Acceptance/AcceptanceCest.php | 4 +- .../Functional/Acceptance/DeveloperCest.php | 4 +- .../Acceptance/Elasticsearch81Cest.php | 43 +++++++++++++++ .../Acceptance/ElasticsearchCest.php | 6 +-- .../Functional/Acceptance/MailHogCest.php | 4 +- .../Acceptance/Opensearch81Cest.php | 54 +++++++++++++++++++ .../Functional/Acceptance/OpensearchCest.php | 17 ++++-- 10 files changed, 144 insertions(+), 15 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance81Cest.php create mode 100644 src/Test/Functional/Acceptance/Elasticsearch81Cest.php create mode 100644 src/Test/Functional/Acceptance/Opensearch81Cest.php diff --git a/composer.json b/composer.json index 55559df2..dff91e7a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "codeception/module-db": "^1.0", "codeception/module-phpbrowser": "^1.0", "codeception/module-rest": "^1.2", - "consolidation/robo": "^1.2", + "consolidation/robo": "^1.2 || ^2.0", "phpmd/phpmd": "@stable", "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^8.5 || ^9.5", diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index e9432f19..14f5e603 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -33,9 +33,9 @@ public function _before(\CliTester $I): void $I->cloneTemplateToWorkDir(static::TEMPLATE_VERSION); $I->createAuthJson(); $I->createArtifactsDir(); - $I->createArtifactCurrentTestedCode('docker', '1.3.1'); + $I->createArtifactCurrentTestedCode('docker', '1.3.5'); $I->addArtifactsRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.1'); + $I->addDependencyToComposer('magento/magento-cloud-docker', '1.3.5'); $I->addEceToolsGitRepoToComposer(); $I->addDependencyToComposer( diff --git a/src/Test/Functional/Acceptance/Acceptance81Cest.php b/src/Test/Functional/Acceptance/Acceptance81Cest.php new file mode 100644 index 00000000..c748f419 --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance81Cest.php @@ -0,0 +1,21 @@ + '7.6', + '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 98e29c77..7ecdb78b 100644 --- a/src/Test/Functional/Acceptance/ElasticsearchCest.php +++ b/src/Test/Functional/Acceptance/ElasticsearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php81 + * @group php82 */ class ElasticsearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param CliTester $I @@ -81,7 +81,7 @@ protected function dataProvider(): array { return [ [ - 'version' => '7.6', + 'version' => '7.10', 'xms' => '520m', 'xmx' => '520m', 'plugins' => ['analysis-nori'], diff --git a/src/Test/Functional/Acceptance/MailHogCest.php b/src/Test/Functional/Acceptance/MailHogCest.php index 96e74941..0ef9461e 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 php81 + * @group php82 */ class MailHogCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param \CliTester $I diff --git a/src/Test/Functional/Acceptance/Opensearch81Cest.php b/src/Test/Functional/Acceptance/Opensearch81Cest.php new file mode 100644 index 00000000..cd49356a --- /dev/null +++ b/src/Test/Functional/Acceptance/Opensearch81Cest.php @@ -0,0 +1,54 @@ + '1.1', + 'xms' => '520m', + 'xmx' => '520m', + 'plugins' => ['analysis-nori'], + 'param' => [ + 'key' => 'node.store.allow_mmap', + 'value' => 'false', + 'needle' => '"store":{"allow_mmap":"false"}', + ] + ], + [ + 'version' => '1.2', + '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 4ebcf492..74271ada 100644 --- a/src/Test/Functional/Acceptance/OpensearchCest.php +++ b/src/Test/Functional/Acceptance/OpensearchCest.php @@ -12,14 +12,14 @@ use Robo\Exception\TaskException; /** - * @group php81 + * @group php82 */ class OpensearchCest extends AbstractCest { /** * Template version for testing */ - protected const TEMPLATE_VERSION = '2.4.4'; + protected const TEMPLATE_VERSION = '2.4.6'; /** * @param CliTester $I @@ -81,7 +81,18 @@ protected function dataProvider(): array { return [ [ - 'version' => '1.2', + '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'],