Skip to content

Commit cc7c34a

Browse files
kyujin-choachimnol
andauthored
Add support for templated service ports on Python Kernels (#109)
* Add support for service port template * Add .bin to Git LFS * Apply service-defs in Python kernels Co-authored-by: Joongi Kim <[email protected]>
1 parent 26cec7e commit cc7c34a

19 files changed

+116
-7
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*.tar.gz filter=lfs diff=lfs merge=lfs -text
55
*.zip filter=lfs diff=lfs merge=lfs -text
66
*.tgz filter=lfs diff=lfs merge=lfs -text
7+
*.bin filter=lfs diff=lfs merge=lfs -text

python-ff/Dockerfile.19.09-py36-cuda9

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ RUN mkdir -p /tmp && \
2929
chown root:root /tmp && \
3030
chmod 1777 /tmp
3131

32-
COPY ./code-server.${CODE_SERVER_VERSION}.tar.xz /tmp/code-server.tar.xz
33-
# TODO: Bundle ms-python extension with code-server when code-server v2 is released.
34-
# COPY code-server.ext.tar.gz /tmp/code-server.ext.tar.gz
35-
RUN tar xvJf /tmp/code-server.tar.xz -C /usr/local/bin
36-
3732
# Backend.AI specifics
3833
LABEL ai.backend.kernelspec="1" \
3934
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \

python/Dockerfile.3.6-ubuntu18.04

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ LABEL ai.backend.kernelspec="1" \
5353
ai.backend.base-distro="ubuntu16.04" \
5454
ai.backend.runtime-type="python" \
5555
ai.backend.runtime-path="/usr/bin/python3" \
56-
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090"
56+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,vscode:http:8180,jupyterlab:http:8090"
57+
58+
COPY ./service-defs /etc/backend.ai/service-defs
5759
COPY policy.yml /etc/backend.ai/jail/policy.yml
60+
COPY ./vscode-exts.tar.gz /etc/backend.ai/vscode-exts.tar.gz
61+
62+
RUN mkdir -p /etc/backend.ai/vscode-exts && \
63+
tar xvzf /etc/backend.ai/vscode-exts.tar.gz -C /etc/backend.ai/vscode-exts && \
64+
rm -rf /etc/backend.ai/vscode-exts.tar.gz
5865

5966
# vim: ft=dockerfile

python/Dockerfile.3.7-anaconda2018.12

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RUN /opt/conda/bin/python -m ipykernel install \
3333
cat /opt/conda/share/jupyter/kernels/python3/kernel.json
3434

3535
# Backend.AI specifics
36+
COPY ./service-defs /etc/backend.ai/service-defs
3637
LABEL ai.backend.kernelspec="1" \
3738
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
3839
ai.backend.features="batch query uid-match user-input" \

python/Dockerfile.3.7-anaconda2019.07

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ LABEL ai.backend.kernelspec="1" \
4141
ai.backend.base-distro="ubuntu16.04" \
4242
ai.backend.runtime-type="python" \
4343
ai.backend.runtime-path="/opt/conda/bin/python" \
44-
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090"
44+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,vscode:http:8180,jupyterlab:http:8090"
4545

46+
COPY ./service-defs /etc/backend.ai/service-defs
4647
COPY policy.yml /etc/backend.ai/jail/policy.yml
48+
COPY ./vscode-exts.tar.gz /etc/backend.ai/vscode-exts.tar.gz
49+
50+
RUN mkdir -p /etc/backend.ai/vscode-exts && \
51+
tar xvzf /etc/backend.ai/vscode-exts.tar.gz -C /etc/backend.ai/vscode-exts && \
52+
rm -rf /etc/backend.ai/vscode-exts.tar.gz
4753

4854
# vim: ft=dockerfile

python/Dockerfile.3.7-ubuntu18.04

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ RUN python3.7 -m ipykernel install --display-name "Python 3.7 on Backend.AI" &&
5555
cat /usr/local/share/jupyter/kernels/python3/kernel.json
5656

5757
# Backend.AI specifics
58+
COPY ./service-defs /etc/backend.ai/service-defs
5859
LABEL ai.backend.kernelspec="1" \
5960
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
6061
ai.backend.features="batch query uid-match user-input" \

python/Dockerfile.3.8-ubuntu18.04

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ RUN python3.8 -m ipykernel install --display-name "Python 3.8 on Backend.AI" &&
5555
cat /usr/local/share/jupyter/kernels/python3/kernel.json
5656

5757
# Backend.AI specifics
58+
COPY ./service-defs /etc/backend.ai/service-defs
5859
LABEL ai.backend.kernelspec="1" \
5960
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
6061
ai.backend.features="batch query uid-match user-input" \

python/Dockerfile.python2.7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ RUN python -m ipykernel install --display-name "Python 2.7 on Backend.AI" && \
4343
cat /usr/local/share/jupyter/kernels/python2/kernel.json
4444

4545
# Backend.AI specifics
46+
COPY ./service-defs /etc/backend.ai/service-defs
4647
LABEL ai.backend.kernelspec="1" \
4748
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
4849
ai.backend.features="batch query uid-match user-input" \

python/Dockerfile.python2.7-ubuntu18.04

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ COPY custom.css /home/work/.jupyter/custom/custom.css
4848
COPY logo.svg /home/work/.jupyter/custom/logo.svg
4949

5050
# Backend.AI specifics
51+
COPY ./service-defs /etc/backend.ai/service-defs
5152
LABEL ai.backend.kernelspec="1" \
5253
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
5354
ai.backend.features="batch query uid-match user-input" \

python/Dockerfile.python3.6

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ RUN python3 -m ipykernel install --display-name "Python 3.6 on Backend.AI" && \
4545
cat /usr/local/share/jupyter/kernels/python3/kernel.json
4646

4747
# Backend.AI specifics
48+
COPY ./service-defs /etc/backend.ai/service-defs
4849
LABEL ai.backend.kernelspec="1" \
4950
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
5051
ai.backend.features="batch query uid-match user-input" \

0 commit comments

Comments
 (0)