Search code examples
gitinstallationtorch

Can't install distlearn through a firewall


BTW, I'm happily running AlexNet on Torch; now I want to install distlearn to expand on the model. I've set my proxy variables as noted, testing them out with direct wget commands. It appears that something in the luarocks execution sequence doesn't properly export the proxy shell variables: with the straightforward command

sudo luarocks install autograd

I get the error

Missing dependencies for autograd:
totem 

Using https://raw.githubusercontent.com/torch/rocks/master/totem-0-0.rockspec... switching to 'build' mode
Cloning into 'torch-totem'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.123]: errno=Connection timed out


Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/totem-0-0.rockspec - Failed cloning git repository.

I've tried downloading the repos (autograd, thrift, dataset, ipc) with git clone, and I now get:

$ luarocks install distlearn
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/torch/rocks/master - Failed downloading https://raw.githubusercontent.com/torch/rocks/master/manifest - /home/hadoop/.cache/luarocks/https___raw.githubusercontent.com_torch_rocks_master/manifest
Warning: Failed searching manifest: Failed fetching manifest for https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master - Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest - /home/hadoop/.cache/luarocks/https___raw.githubusercontent.com_rocks-moonscript-org_moonrocks-mirror_master/manifest

... and ...

$ luarocks install distlearn
Installing https://raw.githubusercontent.com/torch/rocks/master/distlearn-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/distlearn-scm-1.rockspec... switching to 'build' mode

Missing dependencies for distlearn:
ipc 
regress 

Using https://raw.githubusercontent.com/torch/rocks/master/ipc-scm-1.rockspec... switching to 'build' mode

Missing dependencies for ipc:
regress 

Using https://raw.githubusercontent.com/torch/rocks/master/regress-scm-1.rockspec... switching to 'build' mode
Cloning into 'regress'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Connection timed out


Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/ipc-scm-1.rockspec - Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/regress-scm-1.rockspec - Failed cloning git repository.

Am I diving down the wrong rabbit hole? What do I need to fix? Is there more diagnostic information I need to get?


Solution

  • The rockspec code has a built-in, tacit requirement to use git protocol. From behind a firewall, one must use HTTPS. luarocks has no proxy environment variable to configure this from the command line, so the installation fails.

    Fortunately, there is a way to reconfigure git:

    sudo git config --global url."https://".insteadOf git://
    

    This forces all git protocol references to use HTTPS instead. The installation succeeds, and my model code runs to the point of first coding failure.