When drush is run interactively from a command line, it inherits the environment's settings, e.g. set in /etc/environment or /var/aegir/.bashrc. This means that when it does a make, it picks up local http_proxy env var, and requests can thus be routed via a local http caching proxy, speeding up builds enormously.
When drush make is run by aegir over ssh, it does so using a non-interactive shell which (because it is non-interactive) does not create an environment, and thus does not get the http_proxy environment var set, and its requests do not hit the proxy. This makes our builds (triggered from jenkins) take 10+ minutes, whereas if it was hitting the proxy it would take < 1 minute. This is bad enough that I'd classify it as a bug, and it seems to be common - yesterday there were only 4 questions asked on #drush and #aegir, all of them about this exact problem!
I was under the impression that drush used wget or curl for its downloads, so I've patched all references in the drush commands that refer to those commands, but they're clearly not being used.
How can drush be made to use a proxy when run this way?
Comments
Comment #1
Synchro commentedMoved to drush queue as suggested by joestewart on irc.
Comment #2
ergonlogicDrush make will use curl if it's installed, which in turn will check for the existence of /var/aegir/.curlrc regardless of whether the shell is interactive or not. Add the following command to your /var/aegir/.curlrc:
proxy = "http://<squid_proxy>:<squid_port>"Since this only really affects Aegir, I'm moving back to that queue. Also, setting as a documentation task and assigning it to myself, since I'll go write up a handbook page about this now.
Comment #3
ergonlogicOkay, first draft is up: http://community.aegirproject.org/handbook/administrator/post-install-co...
Please review and test the procedure.
Comment #4
steven jones commentedThis is awesome, thanks for the write up.