Skip to content
Snippets Groups Projects

Issue #3293949: Refactor to set the MySQL transaction isolation level (READ COMMITTED)

Files
4
+ 46
39
@@ -4,8 +4,8 @@ services:
privileged: true
default: true
http: false
# depends: mysql
depends: memcached
# depends: mysql
commands:
init: |
set -eux
@@ -25,6 +25,29 @@ services:
zip \
zlib1g > /dev/null 2>&1
# Avoid an error: "Allowed memory size of 134217728 bytes exhausted"
export PHP_INI='/usr/local/etc/php/conf.d/my-php.ini'
echo 'memory_limit = -1' >> "${PHP_INI}"
# Set up the max execution time.
echo 'max_execution_time = 600' >> "${PHP_INI}"
# Set up the max input time.
echo 'max_input_time = 600' >> "${PHP_INI}"
# Set up the max input vars.
echo 'max_input_vars = 100000' >> "${PHP_INI}"
# Check out a branch using the unique Tugboat ID for this repository, to
# ensure we don't clobber an existing branch.
git checkout -b "${TUGBOAT_REPO_ID}"
# Install Memcached libraries.
git clone https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached
cd /usr/src/php/ext/memcached
docker-php-ext-install memcached > /dev/null 2>&1
echo 'memcache.hash_strategy=consistent' >> /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini
# Install APCu libraries.
git clone https://github.com/krakjoe/apcu /usr/src/php/ext/apcu
cd /usr/src/php/ext/apcu
@@ -37,12 +60,6 @@ services:
pecl install uploadprogress > /dev/null 2>&1
docker-php-ext-enable uploadprogress > /dev/null 2>&1
# Install Memcached libraries and etc.
git clone https://github.com/php-memcached-dev/php-memcached /usr/src/php/ext/memcached
cd /usr/src/php/ext/memcached
docker-php-ext-install memcached > /dev/null 2>&1
echo 'memcache.hash_strategy=consistent' >> /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini
# Install graphic libraries.
docker-php-ext-configure gd \
--with-freetype \
@@ -51,26 +68,6 @@ services:
gd \
zip > /dev/null 2>&1
update: |
set -eux
# Avoid an error: "Allowed memory size of 134217728 bytes exhausted"
export PHP_INI='/usr/local/etc/php/conf.d/my-php.ini'
echo 'memory_limit = -1' >> "${PHP_INI}"
# Set up the max execution time.
echo 'max_execution_time = 600' >> "${PHP_INI}"
# Set up the max input time.
echo 'max_input_time = 600' >> "${PHP_INI}"
# Set up the max input vars.
echo 'max_input_vars = 100000' >> "${PHP_INI}"
# Check out a branch using the unique Tugboat ID for this repository, to
# ensure we don't clobber an existing branch.
git checkout -b "${TUGBOAT_REPO_ID}"
# Composer is hungry. You need a Tugboat project with a pretty sizeable
# chunk of memory.
export COMPOSER_MEMORY_LIMIT=-1
@@ -100,21 +97,27 @@ services:
# Set up a drush command.
ln -s "$(pwd)/vendor/bin/drush" /usr/local/bin/
update: |
set -eux
# Install Drupal on the site.
# Use --db-url=mysql://tugboat:tugboat@mysql:3306/tugboat for mysql connection.
export FILES_DIR='sites/default/files'
drush -y \
drush -y si standard \
--db-url="sqlite://${FILES_DIR}/db.sqlite" \
--site-name="Cloud Orchestrator live preview for '${TUGBOAT_PREVIEW_NAME}'" \
--account-pass='admin' \
si standard
--account-pass='admin'
# Set a images/cloud/icons directory.
mkdir -p "${DRUPAL_DOCROOT}/${FILES_DIR}/images/cloud/icons"
# Set a private directory.
export PRIVATE_DIR="${DRUPAL_DOCROOT}/${FILES_DIR}/private"
mkdir -p "${PRIVATE_DIR}"
# Set up a files directory.
chgrp -R www-data "${DRUPAL_DOCROOT}/${FILES_DIR}"
mkdir -p "${DRUPAL_DOCROOT}/${FILES_DIR}"
chown -R www-data:www-data "${DRUPAL_DOCROOT}/${FILES_DIR}"
chmod -R 2775 "${DRUPAL_DOCROOT}/${FILES_DIR}"
chmod -R g+w "${DRUPAL_DOCROOT}/${FILES_DIR}"
@@ -137,17 +140,20 @@ services:
drush -y en admin_toolbar
drush -y en entity_export_csv
drush -y en geocoder
drush -y en memcache memcache_admin
drush -y en simple_oauth
# Enable the themes.
drush -y then bootstrap_cloud
drush -y then rigel
drush -y then claro
drush -y cset system.theme default bootstrap_cloud
drush -y cset system.theme default rigel
drush -y cset system.theme admin claro
# Setup Memcache module.
drush en -y memcache memcache_admin
tee -a "${SETTINGS_FILE}" > /dev/null <<EOF
# The settings must be written after enabling the memcache module.
tee -a "${SETTINGS_FILE}" > /dev/null << EOF
\$databases['default']['default']['init_commands'] = [
'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
];
\$settings['memcache']['servers'] = ['memcached:11211' => 'default'];
\$settings['memcache']['bins'] = ['default' => 'default'];
\$settings['memcache']['key_prefix'] = 'cloud_orchestrator';
@@ -156,6 +162,7 @@ services:
];
\$settings['cache']['default'] = 'cache.backend.memcache';
EOF
chmod 444 "${SETTINGS_FILE}"
# Setup crontab.
DRUSH_QUEUE_RUN_SCRIPT="${DRUPAL_DOCROOT}/modules/contrib/cloud/scripts/drush_queue_run.sh"
@@ -179,9 +186,7 @@ services:
composer install --optimize-autoloader
# Update installed modules.
composer update drupal/admin_toolbar
composer update "drupal/cloud:dev-${TUGBOAT_REPO_ID}" --with-all-dependencies
composer update drupal/memcache
composer update drupal/cloud --with-all-dependencies
# Build and install cloud_dashboard.
export NODE_PATH='/usr/lib/nodejs:/usr/share/nodejs'
@@ -195,7 +200,9 @@ services:
cd "${DRUPAL_DOCROOT}"
drush -y updb
drush cr
# mysql:
# image: tugboatqa/mariadb
memcached:
image: tugboatqa/memcached
Loading