Closed gforge closed 8 years ago
iTorch did use to be installed (as I remember someone asking me to fix a bug with it earlier). Not entirely sure what's changed, and unfortunately I don't use Jupyter notebooks so I'll need some help on this one. Do you have a solution? If so, then depending on how much extra is installed (i.e. the size of the Docker images), I'll either add it to kaixhin/torch
or create kaixhin/itorch
.
Here's an alternative to the torch\Dockerfile that seems to work. I've simply added pip
and installed through it the jupyter
notebook. It seems to get the right foundations for iTorch to be installed.
# Start with Ubuntu base image
FROM ubuntu:14.04
MAINTAINER Kai Arulkumaran <design@kaixhin.com>
# Install git, apt-add-repository and dependencies for iTorch
RUN apt-get update && apt-get install -y \
git \
software-properties-common \
ipython3 \
libssl-dev \
libzmq3-dev \
python-zmq \
python-pip
RUN pip install notebook
# Run Torch7 installation scripts
RUN git clone https://github.com/torch/distro.git /root/torch --recursive && cd /root/torch && \
bash install-deps > /dev/null && \
./install.sh
# Set ~/torch as working directory
WORKDIR /root/torch
# Export environment variables manually
ENV LUA_PATH='/root/.luarocks/share/lua/5.1/?.lua;/root/.luarocks/share/lua/5.1/?/init.lua;/root/torch/install/share/lua/5.1/?.lua;/root/torch/install/share/lua/5.1/?/init.lua;./?.lua;/root/torch/install/share/luajit-2.1.0-beta1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua'
ENV LUA_CPATH='/root/.luarocks/lib/lua/5.1/?.so;/root/torch/install/lib/lua/5.1/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so'
ENV PATH=/root/torch/install/bin:$PATH
ENV LD_LIBRARY_PATH=/root/torch/install/lib:$LD_LIBRARY_PATH
ENV DYLD_LIBRARY_PATH=/root/torch/install/lib:$DYLD_LIBRARY_PATH
ENV LUA_CPATH='/root/torch/install/lib/?.so;'$LUA_CPATH
Also, in the docker hub you may want to hint that the image should be initiated with a port opened and the notebook with --ip='*', e.g.
> sudo docker run --name=tag -p 8888:8888 -it --rm kaixhin/iTorch
> jupyter notebook --ip="*" --no-browser
This will give you a notebook available at localhost:8888
. As I've just started to explore Torch I'm not that familiar with all its features, looking at this there may be a few more additions worth considering although the iTorch docs indicate that this should suffice.
Looks good to me. Updated the images and readmes - could you please check the latest build of kaixhin/torch
that I just set up?
Works fine. I just realized that if you specify the IP to 0.0.0.0 the following warning disappears:
[W 12:58:14.645 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended. [W 12:58:14.646 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.
I therefore suggest changing the instructions to:
"To use Jupyter/iTorch open up the appropriate port. For example, use docker run -it -p 8888:8888 kaixhin/torch. Then run jupyter notebook --ip="0.0.0.0" --no-browser to open a notebook on localhost:8888."
Another thing that may be worth considering is adding ipywidgets
as this causes an unnecessary warning at start:
[W 12:56:40.753 NotebookApp] ipywidgets package not installed. Widgets are unavailable.
The addition necessary is:
RUN pip install ipywidgets
Thanks for the terrific work with these docker-files.
Thanks for the update - think we can close this issue now :)
For some reason it seems that itorch isn't installed together with torch (I believe that it was installed in earlier versions):
Since the jupyter notebook is one of the most natural ways for interacting with a docker container I believe that it would be beneficial to add itorch to the build or have separate builds that includes the itorch