Skip to content

Commit eaa401a

Browse files
committed
update: placeholder login to be more general
1 parent 6b9660c commit eaa401a

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

julia/Dockerfile.1.8-ubuntu20.04

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
4747
# Install jupyter & Julia
4848
ARG JULIA_VERSION
4949
ENV JULIA_VERSION ${JULIA_VERSION:-1.8.5}
50+
ARG JULIA_MAJOR_VERSION
51+
ENV JULIA_MAJOR_VERSION ${JULIA_MAJOR_VERSION:-1.8}
5052
ENV JULIA_PATH "/usr/local/julia"
5153
ENV PATH $JULIA_PATH:$JULIA_PATH/bin:$PATH
5254

@@ -59,7 +61,7 @@ RUN dpkgArch="$(dpkg --print-architecture)"; \
5961
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \
6062
esac; \
6163
\
62-
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${JULIA_VERSION%[.-]*}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \
64+
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${JULIA_VERSION%[.-]*}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \
6365
\
6466
mkdir "$JULIA_PATH"; \
6567
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \
@@ -88,11 +90,11 @@ RUN julia -e 'using IJulia' && \
8890
SHELL ["/bin/sh", "-c"]
8991
# Install ipython kernelspec
9092
COPY replace_placeholder.sh /etc/backend.ai/replace_placeholder.sh
91-
COPY kernel.json /usr/local/share/jupyter/kernels/julia-1.8/kernel.json
92-
RUN /etc/backend.ai/replace_placeholder.sh && \
93+
COPY kernel.json /usr/local/share/jupyter/kernels/julia-${JULIA_MAJOR_VERSION}/kernel.json
94+
RUN /etc/backend.ai/replace_placeholder.sh ${JULIA_MAJOR_VERSION} && \
9395
rm /etc/backend.ai/replace_placeholder.sh
94-
COPY logo-32x32.png /usr/local/share/jupyter/kernels/julia-1.8/logo-32x32.png
95-
COPY logo-64x64.png /usr/local/share/jupyter/kernels/julia-1.8/logo-64x64.png
96+
COPY logo-32x32.png /usr/local/share/jupyter/kernels/julia-${JULIA_MAJOR_VERSION}/logo-32x32.png
97+
COPY logo-64x64.png /usr/local/share/jupyter/kernels/julia-${JULIA_MAJOR_VERSION}/logo-64x64.png
9698

9799
# Backend.AI specifics
98100
LABEL ai.backend.kernelspec="1" \

julia/replace_placeholder.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
path="/opt/julia/packages/IJulia"
33
first_dir=$(ls -1 "$path" | head -1)
4-
file="/usr/local/share/jupyter/kernels/julia-1.8/kernel.json"
4+
if [ -z "$1" ]
5+
then
6+
version="1.5"
7+
else
8+
version=$1
9+
fi
10+
file="/usr/local/share/jupyter/kernels/julia-${version}/kernel.json"
511
old_string="PLACEHOLDER"
6-
sed -i "s/$old_string/$first_dir/g" $file
12+
sed -i "s/$old_string/$first_dir/g" $file

0 commit comments

Comments
 (0)