Skip to content

Commit d5890d7

Browse files
committed
add: julia 1.8 kernelspec
1 parent ac1873f commit d5890d7

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed

julia/Dockerfile.1.8-ubuntu20.04

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
FROM ubuntu:20.04
2+
# Ubuntu 20.04 comes with Python 3.8
3+
ENV DEBIAN_FRONTEND noninteractive
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
ca-certificates \
7+
wget curl git-core \
8+
vim-tiny zip unzip \
9+
python3 python3-pip \
10+
libssl-dev \
11+
libmpdec2 \
12+
proj-bin libproj-dev \
13+
libgeos-dev libgeos++-dev \
14+
mime-support \
15+
gcc g++ \
16+
cmake \
17+
ncurses-term && \
18+
apt-get clean && \
19+
rm -rf /var/lib/apt/lists/
20+
21+
RUN ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color
22+
23+
ENV PYTHONUNBUFFERED=1 \
24+
PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
25+
LANG=C.UTF-8
26+
27+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
28+
python3 -m pip install --no-cache-dir -U setuptools && \
29+
python3 -m pip install --no-cache-dir h5py && \
30+
python3 -m pip install --no-cache-dir Cython && \
31+
python3 -m pip install --no-cache-dir matplotlib bokeh && \
32+
python3 -m pip install --no-cache-dir versioneer && \
33+
python3 -m pip install --no-cache-dir pyproj cartopy==0.19.0.post1 && \
34+
python3 -m pip install --no-cache-dir pandas && \
35+
python3 -m pip install --no-cache-dir seaborn && \
36+
python3 -m pip install --no-cache-dir pillow && \
37+
python3 -m pip install --no-cache-dir networkx cvxpy && \
38+
python3 -m pip install --no-cache-dir scikit-learn scikit-image && \
39+
python3 -m pip install --no-cache-dir pygments && \
40+
python3 -m pip install --no-cache-dir ipython && \
41+
python3 -m pip install --no-cache-dir jupyter && \
42+
python3 -m pip install --no-cache-dir jupyterlab && \
43+
rm -rf /root/.cache && \
44+
rm -f /tmp/*.whl
45+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
46+
47+
# Install jupyter & Julia
48+
ARG JULIA_VERSION
49+
ENV JULIA_VERSION ${JULIA_VERSION:-1.8.5}
50+
ENV JULIA_PATH "/usr/local/julia"
51+
ENV PATH $JULIA_PATH:$JULIA_PATH/bin:$PATH
52+
53+
RUN dpkgArch="$(dpkg --print-architecture)"; \
54+
case "${dpkgArch##*-}" in \
55+
amd64) tarArch='x86_64'; dirArch='x64';; \
56+
armhf) tarArch='arm'; dirArch='arm';; \
57+
i386) tarArch='i686'; dirArch='x86';; \
58+
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \
59+
esac; \
60+
\
61+
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${JULIA_VERSION%[.-]*}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \
62+
\
63+
mkdir "$JULIA_PATH"; \
64+
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \
65+
rm julia.tar.gz
66+
67+
#add IJulia package to make Julia kernel available in jupyter
68+
ENV JULIA_PKG_LOC /opt/julia
69+
ENV JULIA_LOAD_PATH :/opt/julia
70+
ENV JULIA_DEPOT_PATH /opt/julia
71+
RUN mkdir ${JULIA_PKG_LOC}
72+
RUN julia -e 'ENV["JUPYTER"]="jupyter"' && \
73+
julia -e 'ENV["PYTHON"]="python3"' && \
74+
julia -e 'ENV["JULIA_DEPOT_PATH"]="/opt/julia"' && \
75+
julia -e 'using Pkg; Pkg.add("IJulia");'
76+
77+
RUN julia -e 'using Pkg; Pkg.add("Plots"); using Plots;'
78+
RUN julia -e 'using Pkg; Pkg.add("DataFrames");' && \
79+
julia -e 'using Pkg; Pkg.add("RDatasets");' && \
80+
julia -e 'using Pkg; Pkg.add("PyPlot");' && \
81+
julia -e 'using Pkg; Pkg.add("CSV");' && \
82+
julia -e 'using Pkg; Pkg.add("Pandas"); using Pandas;'
83+
84+
SHELL ["/bin/bash", "-c"]
85+
RUN julia -e 'using IJulia' && \
86+
chmod -R 755 /opt/julia/compiled
87+
SHELL ["/bin/sh", "-c"]
88+
# Install ipython kernelspec
89+
COPY kernel.1.8.json /usr/local/share/jupyter/kernels/julia-1.8/kernel.json
90+
COPY logo-32x32.png /usr/local/share/jupyter/kernels/julia-1.8/logo-32x32.png
91+
COPY logo-64x64.png /usr/local/share/jupyter/kernels/julia-1.8/logo-64x64.png
92+
93+
# Backend.AI specifics
94+
LABEL ai.backend.kernelspec="1" \
95+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
96+
ai.backend.features="batch query uid-match user-input" \
97+
ai.backend.resource.min.cpu="1" \
98+
ai.backend.resource.min.mem="512m" \
99+
ai.backend.base-distro="ubuntu20.04" \
100+
ai.backend.runtime-type="python" \
101+
ai.backend.runtime-path="/usr/bin/python3" \
102+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8070,jupyterlab:http:8090"
103+
COPY policy.yml /etc/backend.ai/jail/policy.yml
104+
ENV JULIA_DEPOT_PATH /home/work/.julia:/opt/julia
105+
ENV JULIA_PROJECT /home/work/.julia
106+
# vim: ft=dockerfile
107+

julia/kernel.1.8.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"display_name": "Julia 1.8 on Backend.AI",
3+
"argv": [
4+
"/usr/local/julia/bin/julia",
5+
"-i",
6+
"--startup-file=yes",
7+
"--color=yes",
8+
"/opt/julia/packages/IJulia/e8kqU/src/kernel.jl",
9+
"{connection_file}"
10+
],
11+
"language": "julia",
12+
"env": {}
13+
}

python/Dockerfile.3.10-ubuntu20.04

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
6262
RUN python3.10 -m ipykernel install --display-name "Python 3.10 on Backend.AI" && \
6363
cat /usr/local/share/jupyter/kernels/python3/kernel.json
6464

65+
# Copy Backend.AI multi-node support
66+
COPY ./runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/
67+
6568
# Backend.AI specifics
6669
COPY ./service-defs /etc/backend.ai/service-defs
6770
LABEL ai.backend.kernelspec="1" \

0 commit comments

Comments
 (0)