The new feature of automatically running composer install on the platform works great, unless you have a remote server with a different version of PHP.

The composer install command detects the version of PHP running and uses that to determine dependencies. Therefor, when run, it should run on the same server as the web server, so the PHP versions match.

Patch and branch incoming that changes the drush_shell_cd_and_exec() we added for composer install wiith a d()->web_server->shell_exec() call. This will ensure the command is run on remote servers.

We should document that composer should be installed on every web server used, so it should be installed on each.

Comments

Jon Pugh created an issue. See original summary.

  • Jon Pugh committed b61c7e9 on 2952997-composer-install-remote
    Issue #2952997: Run composer install on remote server.
    
Jon Pugh’s picture

Status: Active » Needs review
helmo’s picture

yes and no ... when you have different php versions there are more things that could break.

With this patch the platform on the master server could be incomplete, as vendor is only populated on the slave. When we run things like cron or other hosting tasks that bootstrap the site it runs on the master server.

Before backups we call provision_drupal_fetch_site() to get the latest modified site data... but I don't think we have something similar for platform files. These were not expected to ever change on the slave.

helmo’s picture

Status: Needs review » Postponed

We should only do this after #2037993: Make remote servers "smart"