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

Synchro’s picture

Project: Drush Make » Drush
Version: 6.x-2.3 » All-versions-4.x-dev
Component: Code » Make

Moved to drush queue as suggested by joestewart on irc.

ergonlogic’s picture

Project: Drush » Provision
Version: All-versions-4.x-dev » 6.x-1.7
Component: Make » Documentation
Assigned: Unassigned » ergonlogic
Category: bug » support

Drush 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.

ergonlogic’s picture

Assigned: ergonlogic » Unassigned
Status: Active » Needs review

Okay, first draft is up: http://community.aegirproject.org/handbook/administrator/post-install-co...

Please review and test the procedure.

steven jones’s picture

Status: Needs review » Fixed

This is awesome, thanks for the write up.

Status: Fixed » Closed (fixed)

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