Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile and installation instructions #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 26 additions & 80 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,70 +1,27 @@
FROM ubuntu:xenial

MAINTAINER Sebastian Gutsche <[email protected]>
MAINTAINER The OSCAR team <[email protected]>

RUN apt-get update -qq \
&& apt-get install -y \
4ti2 \
ant \
ant-optional \
autoconf \
autogen \
bliss \
build-essential \
bzip2 \
clang \
cmake \
curl \
debhelper \
default-jdk \
gfortran \
git \
graphviz \
language-pack-el-base \
language-pack-en \
libbliss-dev \
libboost-dev \
libboost-python-dev \
libcdd-dev \
libcdd0d \
libdatetime-perl \
libflint-dev \
libglpk-dev \
libcurl4-gnutls-dev \
libczmq-dev \
libgmp-dev \
libgmp10 \
libgmpxx4ldbl \
libjson-perl \
libmpfr-dev \
libncurses5-dev \
libnormaliz-dev \
libntl-dev \
libperl-dev \
libppl-dev \
libreadline6-dev \
libsvn-perl \
libterm-readkey-perl \
libterm-readline-gnu-perl \
libtool \
libxml-libxml-perl \
libxml-libxslt-perl \
libxml-perl \
libxml-writer-perl \
libxml2-dev \
libxslt-dev \
libzmq3-dev \
m4 \
make \
nano \
ninja-build \
patch \
pkg-config \
python-dev \
python3-dev \
python3-pip \
sudo \
unzip \
vim \
wget \
xsltproc \
zlib1g-dev

RUN adduser --quiet --shell /bin/bash --gecos "OSCAR user,101,," --disabled-password oscar \
Expand All @@ -85,46 +42,35 @@ RUN mkdir .jupyter \

### Install Julia

ENV JULIA_VERSION julia-1.1.0
ENV JULIA_VERSION julia-1.3.1

RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.1/${JULIA_VERSION}-linux-x86_64.tar.gz \
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.3/${JULIA_VERSION}-linux-x86_64.tar.gz \
&& tar xf ${JULIA_VERSION}-linux-x86_64.tar.gz \
&& rm ${JULIA_VERSION}-linux-x86_64.tar.gz \
&& sudo ln -snf /home/oscar/${JULIA_VERSION}/bin/julia /usr/local/bin/julia

### Install GAP & related

RUN wget -q https://github.com/gap-system/gap/archive/master.zip \
&& unzip -q master.zip \
&& rm master.zip \
&& cd gap-master \
&& ./autogen.sh \
&& ./configure --with-julia=/home/oscar/${JULIA_VERSION} --with-gc=julia \
&& make \
&& make bootstrap-pkg-full \
&& cd pkg \
&& ../bin/BuildPackages.sh \
&& sudo ln -snf /home/oscar/gap-master/gap /usr/local/bin/gap

RUN cd /home/oscar/gap-master/pkg \
&& git clone https://github.com/gap-packages/JupyterKernel.git \
&& cd JupyterKernel \
&& python3 setup.py install --user
### Install Julia packages

ENV PATH /home/oscar/gap-master/pkg/JupyterKernel/bin:${PATH}
ENV JUPYTER_GAP_EXECUTABLE /home/oscar/.julia/gap.sh
ENV GAPROOT /home/oscar/gap-master
RUN julia -e 'import Pkg; Pkg.add( "IJulia" )'
RUN julia -e 'import Pkg; Pkg.add( "AbstractAlgebra" )'
RUN julia -e 'import Pkg; Pkg.add( "Nemo" )'
RUN julia -e 'import Pkg; Pkg.add( "Polymake" )'
RUN julia -e 'import Pkg; Pkg.add( "Singular" )'
RUN julia -e 'import Pkg; Pkg.add( "GAP" )'
RUN julia -e 'import Pkg; Pkg.add( "Hecke" )'
RUN julia -e 'import Pkg; Pkg.add(Pkg.PackageSpec(url="https://github.com/oscar-system/OSCAR.jl", rev="master"))'

COPY Examples Examples

RUN julia -e "import Pkg; Pkg.add( \"IJulia\" )"
RUN julia -e "import Pkg; Pkg.add( \"CxxWrap\" )"
RUN julia -e "import Pkg; Pkg.add( \"AbstractAlgebra\" )"
RUN julia -e "import Pkg; Pkg.add( \"Nemo\" )"
RUN julia -e "import Pkg; Pkg.add( \"Polymake\" )"
RUN julia -e "import Pkg; Pkg.add(Pkg.PackageSpec(url=\"https://github.com/oscar-system/Singular.jl\", rev=\"master\" ))"
RUN julia -e "import Pkg; Pkg.add(Pkg.PackageSpec(url=\"https://github.com/oscar-system/GAP.jl\", rev=\"master\" ))"
RUN julia -e "import Pkg; Pkg.add(Pkg.PackageSpec(url=\"https://github.com/oscar-system/OSCAR.jl\", rev=\"master\" ))"
RUN julia -e "import Pkg; Pkg.add(Pkg.PackageSpec(url=\"https://github.com/thofma/Hecke.jl\", rev=\"master\" ))"
# TODO/FIXME: setup GAP package JupyterKernel

COPY Examples Examples
RUN ln -s $(julia -e 'print(abspath(joinpath(dirname(Base.find_package("GAP")), "..", "gap")))') /home/oscar/gap

RUN cd /home/oscar/gap/pkg \
&& git clone https://github.com/gap-packages/JupyterKernel.git \
&& cd JupyterKernel \
&& python3 setup.py install --user

ENV PATH /home/oscar/gap/pkg/JupyterKernel/bin:${PATH}
ENV JUPYTER_GAP_EXECUTABLE /home/oscar/.julia/gap.sh
ENV GAPROOT /home/oscar/gap
39 changes: 17 additions & 22 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,36 @@ Furthermore Jupyter and the Julia Kernel for Jupyter is installed.
## Usage

To start Julia in the Docker image, execute
```
docker run -it oscarsystem/oscardocker:latest
```

docker run -it oscarsystem/oscardocker:latest

You can then start julia via the command
```
julia
```

julia

and load Singular.jl via
```
using Cxx
using Singular
```

using Singular

or Polymake.jl via
```
using Cxx
using Polymake
```

Please note that for Polymake and Singular to work you need to execute `using Cxx` first. This is due to current portability issues.
using Polymake

For an examples see [here](https://nbviewer.jupyter.org/github/oscar-system/OSCARBinder/blob/master/Singular.ipynb) for Singular and [here](https://nbviewer.jupyter.org/github/oscar-system/OSCARBinder/blob/master/g-vectors_of_random_simplicial_6-polytopes.ipynb)
for Polymake.

## Usage of Jupyter

To start a Jupyter Notebook server, execute the image with
```
docker run -it --net="host" oscarsystem/oscardocker:latest
```

docker run -it --net="host" oscarsystem/oscardocker:latest

and after the container started, execute
```
jupyter notebook --no-browser
```

jupyter notebook --no-browser

inside the container. Then open the URL displayed in your terminal.

## Usage on [mybinder.org](http://mybinder.org)

You can use this Docker image as base for your Binder docker repository. See [here](https://github.com/sebasguts/OSCARBinder) for an example. Please note that the versions are tagged by date.
You can use this Docker image as base for your Binder docker repository. See [here](https://github.com/oscar-system/OSCARBinder) for an example. Please note that the versions are tagged by date.