GetValkyrie / valkyrie

Valkyrie is an opinionated local dev stack that makes features/git based Drupal development easy.
http://www.getvalkyrie.com
GNU General Public License v3.0
45 stars 11 forks source link

Make platform build faster #84

Open ergonlogic opened 9 years ago

ergonlogic commented 9 years ago

Platform builds via drush make can be excruciatingly slow for large platforms. This is largely due to the NFS mounting of ~/platforms. Basically, the projects are downloaded to Drush's package cache (in ~/.drush/cache/download), then copied into a temporary directory (/tmp/make_tmp...), then finally moved into place at their final destination (/var/aegir/platforms/...). That final move operation crosses file-system boundaries, and so rather than being nearly instantaneous, requires copying the entire platform over NFS.

In my tests, this is taking roughly 15 minutes for a recent version of Rune. Moving the cache and temp dirs into ~/platforms might help here, as the copy and move operations would stay on the same FS.

BrianGilbert commented 9 years ago

I've been building my makeiles in the host and then adding the platform in Aegir within the guest, it would be neat if it could trigger the build on the host from the Aegir interface when you use a makefile link..

ergonlogic commented 9 years ago

Building platforms on the host definitely speeds things up. Unfortunately, I don't know how feasible it would be to trigger that from within the VM. That is, the 'aegir' user in the guest would have to SSH into the host for that to work, as far as I can see. This could get pretty complicated.

One way to do this would be to treat the host as a remote server, in which case, we'd need to either create an 'aegir' user on the host (and figure out the file permissions issues that'd entail) or have the 'remote_user' be the host user's account. We'd then need to add the 'aegir' ssh pub key from the guest into the user's authorized_keys.

Assuming we were comfortable with the security implications of that, we'd then need to know the path to the project's platforms directory. So, presumably we'd need to inject that somewhere when provisioning the VM.

This'd also put more of a dependency on the host's version of Drush.

ergonlogic commented 9 years ago

Unfortunately, My attempts to set env vars to allow Drupal to put its cache and temp dirs on the NFS share have only served to slow down the process.

Ideally, we'd reverse the NFS mount direction here. That is, build /var/aegir/platforms/ in the guest, and mount it from the host. This should be supported in a future Vagrant release.