Problem/Motivation

#3058853: Drupal 8.x on Postgresql 12 showed we have a new failure on Postgresql 12, we currently test against 9.1 (and 9.5 manually).

Proposed resolution

1. Add db/pgsql-12.1 environment with postgresql-contrib package with pg_tgrm extension
2. Add "testing_fake" schema to all pgsql containers.

Remaining tasks

  • Manual testing/Review

Manual testing

Setup inside a drupalci vagrant VM

  1. Clone drupalci_environments
  2. Apply the patch inside of it
  3. cd ~/drupalci_environments/db/pgsql-12.1
  4. docker build . (if successful, this will return a line like "Successfully built 7d7cfc3ec4ac")
  5. docker tag 7d7cfc3ec4ac drupalci/pgsql-12.1 (7d7cfc3ec4ac comes from the previous line)
  6. Pull some other containers like drupalci/pgsql-9.5 and drupalci/pgsql-9.1

Manually Test schema and extension output

Needs drupalci/pgsql-9.1 and drupalci/pgsql-9.5 pulled first.

for IMAGE in 9.1 9.5 12.1 ; do
docker run -d  drupalci/pgsql-${IMAGE} ;
sleep 20;
docker exec -ti $(docker ps -q) psql -d drupaltestbot -c 'SELECT nspname FROM pg_catalog.pg_namespace;' ;
docker exec -ti $(docker ps -q) psql -d drupaltestbot -c 'CREATE EXTENSION pg_trgm;' ;
docker rm -f $(docker ps -q) ;
done

The output for those exec commands should look like this given 9.1 (-), 9.5 (-1), and 12.1 (+)

      nspname       
--------------------
 pg_toast
 pg_temp_1
 pg_toast_temp_1
 pg_catalog
 public
 information_schema
+ drupal
-(6 rows)
-(6 rows)
+(7 rows)

and

- ERROR:  could not open extension control file "/usr/share/postgresql/9.1/extension/pg_tgrm.control": No such file or directory
- ERROR:  could not open extension control file "/usr/share/postgresql/9.5/extension/pg_tgrm.control": No such file or directory
+ CREATE EXTENSION

Manually test drupalci itself

  1. Comment out ~/testrunner/src/DrupalCI/Build/Environment/Environment::pull() from line 365 to 381 because the new image cannot be pulled from docker hub.
  2. Create a development.yml file. This development.yml should run some of the test groups like Database and uses the pgsql-12.1 environment. Example attached in comment #17.
  3. Change directory to ~/testrunner
  4. Watch them all fail when running ./drupalci run /path/to/development.yml because of the 12.1 issue.

Release notes snippet

drupalci now has a PostgreSQL 12.1 database environment. This environment has the pg_tgrm extension available to install. This functionality should not be relied upon as an available dependency when developing database features in Drupal core or contrib. All PostgreSQL database environments on drupalci now include a schema within the drupaltestbot database called "testing_fake" to be used for testing only.

Comments

catch created an issue. See original summary.

mradcliffe’s picture

Project: DrupalCI: Drupal.org Testing Infrastructure » DrupalCI: Environments
Component: Code » Database Containers
Issue summary: View changes

I think this goes in the drupalci_environments project.

Didn't you mention to me about some concern with adding too many environments (based on infrastructure resources), @Mixologic? Recalling my comment #9 in #3019693: Upgrade test running to Postgres 9.5 we only added 9.5 because of that concern.

I don't think we can switch to 12.1 by default because of Drupal 8 minimum requirements.

I haven't looked at what RHEL, Ubuntu, and Debian have locked in on since my comment #25 in #2846994: Increase minimum version requirement for Postgres to 10 and require the pg_trgm extension, but that should probably be narrowed down for Drupal 9. And then the correct container added and then switched to. Once Drupal 8 is EOL we can remove the 9.1 and 9.5 containers.

I also updated the issue summary with instructions based on what I did last time.

catch’s picture

I don't think we can switch to 12.1 by default because of Drupal 8 minimum requirements.

If it's a choice between only testing with the most recent version or only testing with the oldest version, I think we should test with the most recent version.

Mixologic’s picture

We can add more environments now, there was a time when every environment was a checkbox and people in issues would check them all. Now they have to add them one by one, so its less of an issue.

mradcliffe’s picture

Status: Active » Needs review
StatusFileSize
new40.21 KB

The main changes for 12 is that the default directories for clusters _really_ want to be the MAJOR version rather than MAJOR.MINOR now. And drupalci expects MAJOR.MINOR for the data directory. With a bit of kludging, we can make it work for both in startup.sh and postgresql.conf.

However, I'm having trouble getting my local drupalci instance to work with. composer so I'm not able to test this patch.

Git commit info:
        34bb006 (HEAD, origin/HEAD, origin/8.9.x, drupal/8.9.x, 8.9.x) Issue #3095713 by bnjmnm, Meenakshi.g, lauriii, xjm, dww: Create classy directory with README, in the templates and css directories for all themes subtheming Classy
Checkout complete.
chown -fR www-data:www-data /var/www/html
---------------- Finished replicate in 1.719 seconds ---------------- 
----------------   Starting checkout_core   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/checkout_core
chown -fR www-data:www-data /var/www/html
---------------- Finished checkout_core in 0.113 seconds ---------------- 
----------------   Starting composer.core_install   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/composer.core_install
Running Composer within the environment.
sudo -u www-data /usr/local/bin/composer config -g discard-changes true
sudo -u www-data /usr/local/bin/composer config -g discard-changes true
sudo -u www-data /usr/local/bin/composer install --prefer-dist --no-suggest --no-interaction --no-progress --working-dir /var/www/html
> Drupal\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 109 installs, 0 updates, 0 removals
As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.
Installing 'unzip' may remediate them.
  - Installing composer/installers (v1.7.0): Loading from cache
  - Installing drupal/core-project-message (8.9.x-dev): Symlinking from composer/Plugin/ProjectMessage
  - Installing drupal/core-vendor-hardening (8.9.x-dev): Symlinking from composer/Plugin/VendorHardening
  - Installing wikimedia/composer-merge-plugin (v1.4.1): Loading from cache
  - Installing doctrine/cache (v1.6.2): Loading from cache
    Cleaning: doctrine/cache
  - Installing doctrine/collections (v1.4.0): Loading from cache
    Cleaning: doctrine/collections
  - Installing doctrine/inflector (v1.2.0): Loading from cache
    Cleaning: doctrine/inflector
  - Installing zendframework/zend-stdlib (3.2.1): Loading from cache
    Cleaning: zendframework/zend-stdlib
  - Installing zendframework/zend-escaper (2.6.1): Loading from cache
    Cleaning: zendframework/zend-escaper
  - Installing zendframework/zend-feed (2.12.0): Loading from cache
    Cleaning: zendframework/zend-feed
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing zendframework/zend-diactoros (1.8.7): Loading from cache
  - Installing typo3/phar-stream-wrapper (v3.1.3): Loading from cache
  - Installing symfony/polyfill-ctype (v1.12.0): Loading from cache
  - Installing twig/twig (v1.42.3): Loading from cache
    Cleaning: twig/twig
  - Installing symfony/yaml (v3.4.35): Loading from cache
    Cleaning: symfony/yaml
  - Installing symfony/polyfill-mbstring (v1.12.0): Loading from cache
  - Installing symfony/translation (v3.4.35): Loading from cache
    Cleaning: symfony/translation
  - Installing symfony/validator (v3.4.35): Loading from cache
    Cleaning: symfony/validator
  - Installing symfony/serializer (v3.4.35): Loading from cache
    Cleaning: symfony/serializer
  - Installing symfony/routing (v3.4.35): Loading from cache
    Cleaning: symfony/routing
  - Installing paragonie/random_compat (v9.99.99): Loading from cache
    Cleaning: paragonie/random_compat
  - Installing symfony/polyfill-php70 (v1.12.0): Loading from cache
  - Installing symfony/http-foundation (v3.4.35): Loading from cache
    Cleaning: symfony/http-foundation
  - Installing symfony/psr-http-message-bridge (v1.1.2): Loading from cache
    Cleaning: symfony/psr-http-message-bridge
  - Installing symfony/process (v3.4.35): Loading from cache
    Cleaning: symfony/process
  - Installing symfony/polyfill-iconv (v1.12.0): Loading from cache
  - Installing symfony/polyfill-util (v1.12.0): Loading from cache
  - Installing symfony/polyfill-php56 (v1.12.0): Loading from cache
  - Installing symfony/event-dispatcher (v3.4.35): Loading from cache
    Cleaning: symfony/event-dispatcher
  - Installing psr/log (1.1.0): Loading from cache
  - Installing symfony/debug (v3.4.35): Loading from cache
    Cleaning: symfony/debug
  - Installing symfony/http-kernel (v3.4.35): Loading from cache
    Cleaning: symfony/http-kernel
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/dependency-injection (v3.4.35): Loading from cache
    Cleaning: symfony/dependency-injection
  - Installing symfony/console (v3.4.35): Loading from cache
    Cleaning: symfony/console
  - Installing symfony/class-loader (v3.4.35): Loading from cache
    Cleaning: symfony/class-loader
  - Installing symfony-cmf/routing (1.4.1): Loading from cache
    Cleaning: symfony-cmf/routing
  - Installing stack/builder (v1.0.5): Loading from cache
    Cleaning: stack/builder
  - Installing pear/pear_exception (v1.0.0): Loading from cache
    Cleaning: pear/pear_exception
  - Installing pear/console_getopt (v1.4.2): Loading from cache
    Cleaning: pear/console_getopt
  - Installing pear/pear-core-minimal (v1.10.9): Loading from cache
    Cleaning: pear/pear-core-minimal
  - Installing pear/archive_tar (1.4.9): Loading from cache
    Cleaning: pear/archive_tar
  - Installing masterminds/html5 (2.3.0): Loading from cache
    Cleaning: masterminds/html5
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
    Cleaning: guzzlehttp/psr7
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
    Cleaning: guzzlehttp/promises
  - Installing guzzlehttp/guzzle (6.3.3): Loading from cache
  - Installing doctrine/lexer (1.0.2): Loading from cache
  - Installing egulias/email-validator (2.1.11): Loading from cache
    Cleaning: egulias/email-validator
  - Installing easyrdf/easyrdf (0.9.1): Loading from cache
    Cleaning: easyrdf/easyrdf
  - Installing doctrine/annotations (v1.4.0): Loading from cache
  - Installing doctrine/common (v2.7.3): Loading from cache
    Cleaning: doctrine/common
  - Installing composer/semver (1.5.0): Loading from cache
  - Installing asm89/stack-cors (1.2.0): Loading from cache
  - Installing drupal/core (8.9.x-dev): Source already present
  - Installing symfony/css-selector (v3.4.35): Loading from cache
    Cleaning: symfony/css-selector
  - Installing behat/mink (dev-master a534fe7): Loading from cache
    Cleaning: behat/mink
  - Installing symfony/dom-crawler (v3.4.35): Loading from cache
    Cleaning: symfony/dom-crawler
  - Installing symfony/browser-kit (v3.4.35): Loading from cache
    Cleaning: symfony/browser-kit
  - Installing fabpot/goutte (v3.2.3): Loading from cache
    Cleaning: fabpot/goutte
  - Installing behat/mink-browserkit-driver (1.3.3): Loading from cache
    Cleaning: behat/mink-browserkit-driver
  - Installing behat/mink-goutte-driver (v1.2.1): Loading from cache
    Cleaning: behat/mink-goutte-driver
  - Installing instaclick/php-webdriver (1.4.6): Loading from cache
    Cleaning: instaclick/php-webdriver
  - Installing behat/mink-selenium2-driver (1.3.x-dev 0a09c43): Loading from cache
    Cleaning: behat/mink-selenium2-driver
  - Installing symfony/finder (v3.4.35): Loading from cache
    Cleaning: symfony/finder
  - Installing symfony/filesystem (v3.4.35): Loading from cache
    Cleaning: symfony/filesystem
  - Installing seld/phar-utils (1.0.1): Loading from cache
  - Installing seld/jsonlint (1.7.1): Loading from cache
    Cleaning: seld/jsonlint
  - Installing justinrainbow/json-schema (5.2.8): Loading from cache
    Cleaning: justinrainbow/json-schema
  - Installing composer/xdebug-handler (1.3.3): Loading from cache
  - Installing composer/spdx-licenses (1.5.2): Loading from cache
  - Installing composer/ca-bundle (1.2.4): Loading from cache
  - Installing composer/composer (1.9.1): Loading from cache
    Cleaning: composer/composer
  - Installing squizlabs/php_codesniffer (3.5.0): Loading from cache
    Cleaning: squizlabs/php_codesniffer
  - Installing drupal/coder (8.3.6): Cloning 4337ddf58d
    Cleaning: drupal/coder
  - Installing jcalderonzumba/gastonjs (v1.0.2): Loading from cache
    Cleaning: jcalderonzumba/gastonjs
  - Installing jcalderonzumba/mink-phantomjs-driver (v0.3.2): Loading from cache
    Cleaning: jcalderonzumba/mink-phantomjs-driver
  - Installing mikey179/vfsstream (v1.6.8): Loading from cache
    Cleaning: mikey179/vfsstream
  - Installing webmozart/assert (1.5.0): Loading from cache
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing phpdocumentor/type-resolver (0.5.1): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.2): Loading from cache
    Cleaning: phpdocumentor/reflection-docblock
  - Installing phpunit/php-token-stream (2.0.2): Loading from cache
    Cleaning: phpunit/php-token-stream
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/resource-operations (1.0.0): Loading from cache
  - Installing sebastian/recursion-context (3.0.0): Loading from cache
    Cleaning: sebastian/recursion-context
  - Installing sebastian/object-reflector (1.1.1): Loading from cache
    Cleaning: sebastian/object-reflector
  - Installing sebastian/object-enumerator (3.0.3): Loading from cache
    Cleaning: sebastian/object-enumerator
  - Installing sebastian/global-state (2.0.0): Loading from cache
    Cleaning: sebastian/global-state
  - Installing sebastian/exporter (3.1.2): Loading from cache
    Cleaning: sebastian/exporter
  - Installing sebastian/environment (3.1.0): Loading from cache
    Cleaning: sebastian/environment
  - Installing sebastian/diff (2.0.1): Loading from cache
    Cleaning: sebastian/diff
  - Installing sebastian/comparator (2.1.3): Loading from cache
    Cleaning: sebastian/comparator
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing doctrine/instantiator (1.0.5): Loading from cache
    Cleaning: doctrine/instantiator
  - Installing phpunit/phpunit-mock-objects (5.0.10): Loading from cache
    Cleaning: phpunit/phpunit-mock-objects
  - Installing phpunit/php-timer (1.0.9): Loading from cache
    Cleaning: phpunit/php-timer
  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
  - Installing theseer/tokenizer (1.1.3): Loading from cache
    Cleaning: theseer/tokenizer
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
    Cleaning: sebastian/code-unit-reverse-lookup
  - Installing phpunit/php-code-coverage (5.3.2): Loading from cache
    Cleaning: phpunit/php-code-coverage
  - Installing phpspec/prophecy (1.9.0): Loading from cache
    Cleaning: phpspec/prophecy
  - Installing phar-io/version (1.0.1): Loading from cache
    Cleaning: phar-io/version
  - Installing phar-io/manifest (1.0.1): Loading from cache
    Cleaning: phar-io/manifest
  - Installing myclabs/deep-copy (1.7.0): Loading from cache
    Cleaning: myclabs/deep-copy
  - Installing phpunit/phpunit (6.5.14): Loading from cache
    Cleaning: phpunit/phpunit
  - Installing symfony/lock (v3.4.35): Loading from cache
  - Installing symfony/phpunit-bridge (v3.4.35): Loading from cache
    Cleaning: symfony/phpunit-bridge
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
Hardening vendor directory with .htaccess and web.config files.
> Drupal\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
Hardening vendor directory with .htaccess and web.config files.
Cleaning vendor directory.
drupal/drupal: This package is meant for core development,
               and not intended to be used for production sites.
               See: https://www.drupal.org/node/3082474
drupal/drupal: This package is meant for core development,
               and not intended to be used for production sites.
               See: https://www.drupal.org/node/3082474
Vendor directory already clean.
---------------- Finished composer.core_install in 4.047 seconds ---------------- 
----------------   Starting composer_contrib   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/composer_contrib
---------------- Finished composer_contrib in 0.008 seconds ---------------- 
----------------   Starting fetch   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/fetch
No files to fetch.
---------------- Finished fetch in 0.010 seconds ---------------- 
----------------   Starting patch   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/patch
No patches to apply.
---------------- Finished patch in 0.008 seconds ---------------- 
----------------   Starting update_build   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/update_build
This build does not contain a modified drupalci.yml file. Using existing assessment stage.
---------------- Finished update_build in 0.010 seconds ---------------- 
----------------   Starting update_dependencies   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/update_dependencies
---------------- Finished update_dependencies in 0.008 seconds ---------------- 
---------------- Finished assemble_codebase in 5.933 seconds ---------------- 
Saving build definition.
---------------- Finished codebase in 5.944 seconds ---------------- 
----------------   Starting assessment   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/assessment
----------------   Starting validate_codebase   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/validate_codebase
----------------   Starting phplint   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/phplint
SyntaxCheck checking for php syntax errors.
---------------- Finished phplint in 0.009 seconds ---------------- 
----------------   Starting phpcs   ----------------
Directory created at /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/phpcs
PHPCS sniffing the project.
Checking for phpcs.xml(.dist) file.
Checking for PHPCS config file: /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/source//core/phpcs.xml*
test -e /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/source//core/phpcs.xml*
Using existing PHPCS config file.
Checking for phpcs tool in codebase.
test -e /var/www/html/vendor/squizlabs/php_codesniffer/scripts/phpcs
Attempting to install drupal/coder ^8.2@stable
sudo -u www-data /usr/local/bin/composer require --dev drupal/coder ^8.2@stable
./composer.json has been updated
> Drupal\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package drupal/core 1.0.0 exists as drupal/core[8.0.0, 8.0.0-beta10, 8.0.0-beta11, 8.0.0-beta12, 8.0.0-beta13, 8.0.0-beta14, 8.0.0-beta15, 8.0.0-beta16, 8.0.0-beta6, 8.0.0-beta7, 8.0.0-beta8, 8.0.0-beta9, 8.0.0-rc1, 8.0.0-rc2, 8.0.0-rc3, 8.0.0-rc4, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.x-dev, 8.1.0, 8.1.0-beta1, 8.1.0-beta2, 8.1.0-rc1, 8.1.1, 8.1.10, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.1.7, 8.1.8, 8.1.9, 8.1.x-dev, 8.2.0, 8.2.0-beta1, 8.2.0-beta2, 8.2.0-beta3, 8.2.0-rc1, 8.2.0-rc2, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.2.6, 8.2.7, 8.2.8, 8.2.x-dev, 8.3.0, 8.3.0-alpha1, 8.3.0-beta1, 8.3.0-rc1, 8.3.0-rc2, 8.3.1, 8.3.2, 8.3.3, 8.3.4, 8.3.5, 8.3.6, 8.3.7, 8.3.8, 8.3.9, 8.3.x-dev, 8.4.0, 8.4.0-alpha1, 8.4.0-beta1, 8.4.0-rc1, 8.4.0-rc2, 8.4.1, 8.4.2, 8.4.3, 8.4.4, 8.4.5, 8.4.6, 8.4.7, 8.4.8, 8.4.x-dev, 8.5.0, 8.5.0-alpha1, 8.5.0-beta1, 8.5.0-rc1, 8.5.1, 8.5.10, 8.5.11, 8.5.12, 8.5.13, 8.5.14, 8.5.15, 8.5.2, 8.5.3, 8.5.4, 8.5.5, 8.5.6, 8.5.7, 8.5.8, 8.5.9, 8.5.x-dev, 8.6.0, 8.6.0-alpha1, 8.6.0-beta1, 8.6.0-beta2, 8.6.0-rc1, 8.6.1, 8.6.10, 8.6.11, 8.6.12, 8.6.13, 8.6.14, 8.6.15, 8.6.16, 8.6.17, 8.6.18, 8.6.2, 8.6.3, 8.6.4, 8.6.5, 8.6.6, 8.6.7, 8.6.8, 8.6.9, 8.7.0, 8.7.0-alpha1, 8.7.0-alpha2, 8.7.0-beta1, 8.7.0-beta2, 8.7.0-rc1, 8.7.1, 8.7.10, 8.7.11, 8.7.2, 8.7.3, 8.7.4, 8.7.5, 8.7.6, 8.7.7, 8.7.8, 8.7.9, 8.7.x-dev, 8.8.0, 8.8.0-alpha1, 8.8.0-beta1, 8.8.0-rc1, 8.8.1, 8.8.x-dev, 8.9.x-dev, 9.0.x-dev, dev-master] but these are rejected by your constraint.
  Problem 2
    - The requested package drupal/core-project-message 1.0.0 exists as drupal/core-project-message[8.8.0, 8.8.0-beta1, 8.8.0-rc1, 8.8.1, 8.8.x-dev, 8.9.x-dev, 9.0.x-dev, dev-master] but these are rejected by your constraint.
  Problem 3
    - The requested package drupal/core-vendor-hardening 1.0.0 exists as drupal/core-vendor-hardening[8.8.0, 8.8.0-alpha1, 8.8.0-beta1, 8.8.0-rc1, 8.8.1, 8.8.x-dev, 8.9.x-dev, 9.0.x-dev, dev-master] but these are rejected by your constraint.


Installation failed, reverting ./composer.json to its original content.
Unable to install generic drupal/coder.
Unable to install Coder tools for Drupal standards sniff.
Adjusting paths in report file: /var/lib/drupalci/workspace/local-bdad595494a5878bc39a9dcf82e19613/ancillary/phpcs/checkstyle.xml
---------------- Finished phpcs in 10.027 seconds ---------------- 
daffie’s picture

After talking to @mixologic on Slack he agreed that we could add the extension pg_trgm to the PostgreSQL database. This is to be able to testing for the issue: #2988018: [PP-1] Performance issues with path alias generated queries on PostgreSQL . He also agreed to add a non-public schema to PostgreSQL. This is to be able to testing for the issue: #1060476: Multiple issues when PostgreSQL is used with non-public schema. We agreed to only add this to a new testbot, so that there will be no change of somebody writing code that will require the extension or the non-public to be there. If they do all other testbots will fail. Both issues will be postponed on this issue.

mradcliffe’s picture

Status: Needs review » Needs work

Changing status to Needs work based on #6.

Also replicate build step is the problem with how I was testing because of composer. Using COMPOSER_ROOT_VERSION=8.9.x-dev or whatever should resolve that if I can hack it into the composer command for testing.

mradcliffe’s picture

Status: Needs work » Needs review
StatusFileSize
new40.37 KB
new1.05 KB

Here's a patch that implements @daffie's requests in #6. The schema is named "drupal", which is distinct from the "public" schema, and only in the drupaltestbot database. It installs the extension, but does not create the extension. Drupal core tests can be written against these two things in #1060476: Multiple issues when PostgreSQL is used with non-public schema and #2988018: [PP-1] Performance issues with path alias generated queries on PostgreSQL respectively.

Manual Tests for schema and extension:

for IMAGE in 9.5 12.1 ; do
docker run -d  drupalci/pgsql-${IMAGE} ;
sleep 20;
docker exec -ti $(docker ps -q) psql -d drupaltestbot -c 'SELECT nspname FROM pg_catalog.pg_namespace;' ;
docker exec -ti $(docker ps -q) psql -d drupaltestbot -c 'CREATE EXTENSION pg_trgm;' ;
docker rm -f $(docker ps -q) ;
done

The output for those exec commands should look like this given 9.5 (-) and 12.1 (+)

      nspname       
--------------------
 pg_toast
 pg_temp_1
 pg_toast_temp_1
 pg_catalog
 public
 information_schema
+ drupal
-(6 rows)
+(7 rows)

and

- ERROR:  could not open extension control file "/usr/share/postgresql/9.5/extension/pg_tgrm.control": No such file or directory
+ CREATE EXTENSION
mradcliffe’s picture

I think we should consider creating the schema in both 9.1 and 9.5 images as well and recreating those images, @Mixologic.

daffie’s picture

@mradcliffe: Thanks for helping.

  1. It installs the extension, but does not create the extension.

    I am not sure if this is enough. My question is has the database user enough privileges. According to the PostgreSQL documentation: "For most extensions this means superuser or database owner privileges are needed." See: https://www.postgresql.org/docs/9.1/sql-createextension.html.

  2. I think we should consider creating the schema in both 9.1 and 9.5 images as well and recreating those images, @Mixologic.

    The problem that @mixologic is worried that somebody will write code that will depend on the drupal schema being there.
    Personaly I am not sure what is the better thing to do in this case. I like to have the drupal schema in all PostgreSQL testbots, but @mixologic has a good point.

mradcliffe’s picture

The drupaltestbot user is the one that owns the database

  1. +++ b/db/pgsql-12.1/Dockerfile
    @@ -0,0 +1,20 @@
    +ENV POSTGRES_PASSWORD drupaltestbotpw
    +ENV POSTGRES_USER drupaltestbot
    

    The drupaltestbot user is the one that owns the cluster and database so CREATE EXTENSION will succeed.

    See the manual testing steps.

  2. +++ b/db/pgsql-12.1/conf/startup.sh
    @@ -0,0 +1,36 @@
    +    psql -d drupaltestbot -c "CREATE SCHEMA IF NOT EXISTS drupal AUTHORIZATION drupaltestbot;"
    

    Maybe the extra schema should be called "do_not_use" or "testing_fake" instead of "drupal"?

    I was worried about calling it drupal too.

daffie’s picture

@mradcliffe: For both points: Great!

What does now needs to happen? And who do we need for that?

mradcliffe’s picture

Status: Needs review » Needs work

I think I need to fix the patch to not call the schema "drupal" per your point, @daffie. Setting to Needs work.

Steps after something is reviewed. There's no tests here, but the patch gets merged into the dev branch and then into the production branch. @Mixologic runs one of the scripts (or a jenkins job) on the d.o infrastructure, which builds the images and publishes them to docker hub.

mradcliffe’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new40.39 KB
new883 bytes

Quick patch fix. Back to needs review. I added my manual testing instructions in case anybody else wants to run drupalci_testbot locally.

daffie’s picture

Issue summary: View changes
daffie’s picture

It is my first time reviewing a DrupalCI environments issue. Please be patient with me.
The part with manual testing the drupalci_environments part works as described in the IS.
The part with manual testing in the druplci_testbot does not work for me.
I get the following error when running the drupalci command:

Attempting to connect to database server.
SQLSTATE[08006] [7] could not connect to server: Connection refused
        Is the server running on host "172.18.0.16" and accepting
        TCP/IP connections on port 5432?
Could not connect to database server.

I have commented out the lines in ~/testrunner/src/DrupalCI/Build/Environment/Environment::pull().

I do not know what to do with the following line:

This might _also_ need to be done in /opt/lib/drupalci_testbot

By the way, running the drupalci command with other databases/versions works fine.

I do have a couple of other questions:

  1. I have compared the postgresql.conf file with the one from PostgreSQL 9.5. The are more options there.
    Can I ask what the source is where those extra lines come from?
  2. I need to add the line: RUN apt-get -qq install apt-utils or I will get the following
    warning: "debconf: delaying package configuration, since apt-utils is not installed"
  3. Can we add the schema "testing_fake" also to the two other PostgreSQL testbot environments?
  4. How do you move the created PostgreSQL 12.1 docker container/image from drupalci_environments to drupalci_testbot?
  5. All the differences between the patch file and how it is done for PostgreSQL 9.5 look good.
mradcliffe’s picture

Issue summary: View changes
Status: Needs review » Active

drupalci within the VM is located inside PATH, which points to /opt/drupalci/testrunner and not /home/testbot/testrunner. If you're using that, then it won't have the docker pull hack changes. This may also be why the test run completely failed.

I do get a timeout initially, but that is expected behavior for drupalci, which will wait until it can connect to the database server before proceeding:

Attempting to connect to database server.
SQLSTATE[08006] [7] could not connect to server: Connection refused
        Is the server running on host "172.18.0.4" and accepting
        TCP/IP connections on port 5432?
Could not connect to database server.
Sleeping 10 seconds to allow service to start.
Attempting to connect to database server.
Database is active.
  1. I have compared the postgresql.conf file with the one from PostgreSQL 9.5. The are more options there.
    Can I ask what the source is where those extra lines come from?

    Good question. I went looking for this before I made the change, and I found the default for the official postgres docker image is stored at /usr/share/postgresql/12/postgresql.conf.sample. It's also listed in the Dockerfile for that image. I then merged the manual config changes from 9.5 into that file, and then manually adjusted the # comment line endings to match so that a diff between the two would be a bit easier to read.

  2. I need to add the line: RUN apt-get -qq install apt-utils or I will get the following

    warning: "debconf: delaying package configuration, since apt-utils is not installed"

    I looked at the Dockerfile for the postgres 12/12.1 image and I didn't find apt-utils usage there. I'm not sure about the importance of apt-utils, but it probably wouldn't hurt to add it. I also got the same warning when I build the pgsql-9.5 image manually.

  3. Can we add the schema "testing_fake" also to the two other PostgreSQL testbot environments?

    I agree. @Mixologic was concerned about messing with the older postgresql containers, but I think adding a schema is pretty standard since forever.

  4. How do you move the created PostgreSQL 12.1 docker container/image from drupalci_environments to drupalci_testbot?

    Locally? We only need to tag the built image: docker tag IMAGE_ID drupalci/pgsql-12.1. On drupal.org? @Mixologic will run a script to build and publish new images to hub.docker.com.

  5. All the differences between the patch file and how it is done for PostgreSQL 9.5 look good.

    Thank you for the review.

Setting to needs work because I think adding the schema to pgsql-9.1 and pgsql-9.5 is a good idea too.

mradcliffe’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new41.97 KB
new1.43 KB

Somehow I changed it to Active instead of Needs work. Anyway, back to Needs review.

This patch addresses adding the schema to 9.1 and 9.5. 9.1 did not support the "IF NOT EXISTS" syntax for "CREATE SCHEMA".

After manually building pgsql-9.1 and pgsql-9.5 images,

Create a container based on each image
Use logs to see that "CREATE SCHEMA" appears after "CREATE DATABASE".

mradcliffe’s picture

StatusFileSize
new41.97 KB
new748 bytes
+++ b/db/pgsql-9.5/conf/startup.sh
@@ -19,6 +19,8 @@ if [ ! -z $(pg_lsclusters | grep -c ' main ') ];
+        # create an additional schema for the database for testing only

Ugh. Fixed.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

@mradcliffe: Thanks for all your help on this issue.

After some problem, I was able to run the testbot with the new PostgreSQL 12.1 database.
All changes look good to me.
For me it is RTBC.

For @mixologic: When building the docker image I got the following error: "debconf: delaying package configuration, since apt-utils is not installed". I was able to fix it by adding the following line: RUN apt-get -qq install apt-utils. Talked about it with @mradcliffe on Slack about it and suggested that we would you to make the decision whether or not it should be added.

andypost’s picture

The #3058853-25: Drupal 8.x on Postgresql 12 commited, so new env could be added

andypost’s picture

mradcliffe’s picture

Status: Reviewed & tested by the community » Needs review

Should we remove the 9.5 image that we added last year?

catch’s picture

Status: Needs review » Reviewed & tested by the community

It's my understanding that it's no longer an issue how many database combinations there are on DrupalCI after the ability to checkbox everything was removed - just having the containers available doesn't increase load. So I think we can independently add and remove things without having to do one in/one out. Tentatively re-RTBCing.

  • 05f2ee3 committed on 3104007-add-pgsql-12
    Issue #3104007: Adds the pgsql12 container
    
Mixologic’s picture

re #23: lets not do all of the pgsql stuff in one issue. If its going to need removal, lets do that in another issue.

I'd also rather not include #18 in this change as it might have an impact on existing containers, so let's also add that to a followup.

Our automated build puts the db containers in a different place than we normally use them, so I'll have to build, and then manually repush to get this out.

Mixologic’s picture

Status: Reviewed & tested by the community » Needs work

Marking 'needs work' as I need to do things before we can mark this closed. (needs deployment?)

gábor hojtsy’s picture

#2846994: Increase minimum version requirement for Postgres to 10 and require the pg_trgm extension proposes to raise PostgreSQL requirements to 9.6 before the beta. We don't have environments higher than PostgreSQL 9.5 now, so that patch cannot be tested currently. Therefore marking the rollout of this a beta requirement.

gábor hojtsy’s picture

Title: Postgresql 12 environment » Postgresql 12 DrupalCI environment needed for core testing
Issue tags: +Needs deployment
daffie’s picture

  • 322f431 committed on 3104007-add-pgsql-12
    Issue #3104007: Add the testing_fake despite me neither understanding...
Mixologic’s picture

Status: Needs work » Fixed

Okay, I deployed this, and set up a test on 9.0.x-dev to run them: https://www.drupal.org/pift-ci-job/1604606

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

andypost’s picture