Merge pull request #2878 from PavelSavushkinMix/feature/php8.0_cassandra

feat(cassandra extension): upgrade version of cassandra and avoid installation for PHP 8.0
This commit is contained in:
Shao Yu-Lung (Allen) 2021-03-15 10:29:26 +08:00 committed by GitHub
commit d374dc2ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 53 deletions

View File

@ -354,7 +354,7 @@ services:
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
- INSTALL_SOCKETS=${LARAVEL_HORIZON_INSTALL_SOCKETS} - INSTALL_SOCKETS=${LARAVEL_HORIZON_INSTALL_SOCKETS}
- INSTALL_YAML=${LARAVEL_HORIZON_INSTALL_YAML} - INSTALL_YAML=${LARAVEL_HORIZON_INSTALL_YAML}
- INSTALL_CASSANDRA=${PHP_FPM_INSTALL_CASSANDRA} - INSTALL_CASSANDRA=${LARAVEL_HORIZON_INSTALL_CASSANDRA}
- INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS} - INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS}
- INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO} - INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO}
- INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG} - INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG}

View File

@ -321,6 +321,7 @@ LARAVEL_HORIZON_INSTALL_YAML=false
LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE=false LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE=false
LARAVEL_HORIZON_INSTALL_PHPREDIS=true LARAVEL_HORIZON_INSTALL_PHPREDIS=true
LARAVEL_HORIZON_INSTALL_MONGO=false LARAVEL_HORIZON_INSTALL_MONGO=false
LARAVEL_HORIZON_INSTALL_CASSANDRA=false
LARAVEL_HORIZON_INSTALL_FFMPEG=false LARAVEL_HORIZON_INSTALL_FFMPEG=false
LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM=false LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM=false
LARAVEL_HORIZON_PGID=1000 LARAVEL_HORIZON_PGID=1000

View File

@ -178,21 +178,24 @@ RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
# Install Cassandra drivers: # Install Cassandra drivers:
ARG INSTALL_CASSANDRA=false ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
apk --update add cassandra-cpp-driver \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
;fi echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
else \
WORKDIR /usr/src apk add --update --no-cache cassandra-cpp-driver libuv gmp \
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ && apk add --update --no-cache cassandra-cpp-driver-dev gmp-dev --virtual .build-sec \
git clone https://github.com/datastax/php-driver.git \ && cd /usr/src \
&& cd php-driver/ext \ && git clone https://github.com/datastax/php-driver.git \
&& phpize \ && cd php-driver/ext \
&& mkdir -p /usr/src/php-driver/build \ && phpize \
&& cd /usr/src/php-driver/build \ && mkdir -p /usr/src/php-driver/build \
&& ../ext/configure > /dev/null \ && cd /usr/src/php-driver/build \
&& make clean >/dev/null \ && ../ext/configure > /dev/null \
&& make >/dev/null 2>&1 \ && make clean > /dev/null \
&& make install \ && make > /dev/null 2>&1 \
&& docker-php-ext-enable cassandra \ && make install \
&& docker-php-ext-enable cassandra \
&& apk del .build-sec; \
fi \
;fi ;fi
# Install MongoDB drivers: # Install MongoDB drivers:

View File

@ -389,6 +389,41 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \
docker-php-ext-install sockets \ docker-php-ext-install sockets \
;fi ;fi
###########################################################################
# CASSANDRA:
###########################################################################
ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
else \
apt-get install libgmp-dev -yqq && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb -o libuv1-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb -o libuv1.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb -o cassandra-cpp-driver.deb && \
dpkg -i libuv1.deb && \
dpkg -i libuv1-dev.deb && \
dpkg -i cassandra-cpp-driver.deb && \
dpkg -i cassandra-cpp-driver-dev.deb && \
rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \
cd /usr/src && \
git clone https://github.com/datastax/php-driver.git && \
cd /usr/src/php-driver/ext && \
phpize && \
mkdir /usr/src/php-driver/build && \
cd /usr/src/php-driver/build && \
../ext/configure > /dev/null && \
make clean > /dev/null && \
make > /dev/null 2>&1 && \
make install && \
echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini; \
fi \
;fi
########################################################################### ###########################################################################
# GEARMAN: # GEARMAN:
########################################################################### ###########################################################################

View File

@ -239,21 +239,24 @@ RUN if [ ${INSTALL_GEARMAN} = true ]; then \
# Install Cassandra drivers: # Install Cassandra drivers:
ARG INSTALL_CASSANDRA=false ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
apk --update add cassandra-cpp-driver \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
;fi echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
else \
WORKDIR /usr/src apk add --update --no-cache cassandra-cpp-driver libuv gmp \
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ && apk add --update --no-cache cassandra-cpp-driver-dev gmp-dev --virtual .build-sec \
git clone https://github.com/datastax/php-driver.git \ && cd /usr/src \
&& cd php-driver/ext \ && git clone https://github.com/datastax/php-driver.git \
&& phpize \ && cd php-driver/ext \
&& mkdir -p /usr/src/php-driver/build \ && phpize \
&& cd /usr/src/php-driver/build \ && mkdir -p /usr/src/php-driver/build \
&& ../ext/configure --with-php-config=/usr/bin/php-config7.1 > /dev/null \ && cd /usr/src/php-driver/build \
&& make clean >/dev/null \ && ../ext/configure > /dev/null \
&& make >/dev/null 2>&1 \ && make clean > /dev/null \
&& make install \ && make > /dev/null 2>&1 \
&& docker-php-ext-enable cassandra \ && make install \
&& docker-php-ext-enable cassandra \
&& apk del .build-sec; \
fi \
;fi ;fi
# Install Phalcon ext # Install Phalcon ext

View File

@ -520,28 +520,32 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \
ARG INSTALL_CASSANDRA=false ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
apt-get install libgmp-dev -y && \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.28.0/libuv1-dev_1.28.0-1_amd64.deb -o libuv1-dev.deb && \ echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.28.0/libuv1_1.28.0-1_amd64.deb -o libuv1.deb && \ else \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.12.0/cassandra-cpp-driver-dev_2.12.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \ apt-get install libgmp-dev -yqq && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.12.0/cassandra-cpp-driver_2.12.0-1_amd64.deb -o cassandra-cpp-driver.deb && \ curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb -o libuv1-dev.deb && \
dpkg -i libuv1.deb && \ curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb -o libuv1.deb && \
dpkg -i libuv1-dev.deb && \ curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \
dpkg -i cassandra-cpp-driver.deb && \ curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb -o cassandra-cpp-driver.deb && \
dpkg -i cassandra-cpp-driver-dev.deb && \ dpkg -i libuv1.deb && \
rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \ dpkg -i libuv1-dev.deb && \
cd /usr/src && \ dpkg -i cassandra-cpp-driver.deb && \
git clone https://github.com/datastax/php-driver.git && \ dpkg -i cassandra-cpp-driver-dev.deb && \
cd /usr/src/php-driver/ext && \ rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \
phpize && \ cd /usr/src && \
mkdir /usr/src/php-driver/build && \ git clone https://github.com/datastax/php-driver.git && \
cd /usr/src/php-driver/build && \ cd /usr/src/php-driver/ext && \
../ext/configure > /dev/null && \ phpize && \
make clean >/dev/null && \ mkdir /usr/src/php-driver/build && \
make >/dev/null 2>&1 && \ cd /usr/src/php-driver/build && \
make install && \ ../ext/configure > /dev/null && \
echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \ make clean >/dev/null && \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini \ make >/dev/null 2>&1 && \
make install && \
echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini; \
fi \
;fi ;fi
########################################################################### ###########################################################################