Skip to content

Commit 4ae5d86

Browse files
committed
Move xrdp to optional tools
1 parent 9726def commit 4ae5d86

File tree

3 files changed

+56
-58
lines changed

3 files changed

+56
-58
lines changed

Dockerfile

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ RUN \
177177
unzip \
178178
bzip2 \
179179
lzop \
180-
# deprecates bsdtar (https://ubuntu.pkgs.org/20.04/ubuntu-universe-i386/libarchive-tools_3.4.0-2ubuntu1_i386.deb.html)
180+
# deprecates bsdtar (https://ubuntu.pkgs.org/20.04/ubuntu-universe-i386/libarchive-tools_3.4.0-2ubuntu1_i386.deb.html)
181181
libarchive-tools \
182182
zlibc \
183183
# unpack (almost) everything with one command
@@ -318,9 +318,9 @@ ENV LD_LIBRARY_PATH=$CONDA_ROOT/lib
318318
RUN git clone https://github.com/pyenv/pyenv.git $RESOURCES_PATH/.pyenv && \
319319
# Install pyenv plugins based on pyenv installer
320320
git clone https://github.com/pyenv/pyenv-virtualenv.git $RESOURCES_PATH/.pyenv/plugins/pyenv-virtualenv && \
321-
git clone git://github.com/pyenv/pyenv-doctor.git $RESOURCES_PATH/plugins/pyenv-doctor && \
322-
git clone https://github.com/pyenv/pyenv-update.git $RESOURCES_PATH/plugins/pyenv-update && \
323-
git clone https://github.com/pyenv/pyenv-which-ext.git $RESOURCES_PATH/plugins/pyenv-which-ext
321+
git clone git://github.com/pyenv/pyenv-doctor.git $RESOURCES_PATH/.pyenv/plugins/pyenv-doctor && \
322+
git clone https://github.com/pyenv/pyenv-update.git $RESOURCES_PATH/.pyenv/plugins/pyenv-update && \
323+
git clone https://github.com/pyenv/pyenv-which-ext.git $RESOURCES_PATH/.pyenv/plugins/pyenv-which-ext
324324

325325
# Add pyenv to path
326326
ENV PATH=$RESOURCES_PATH/.pyenv/shims:$RESOURCES_PATH/.pyenv/bin:$PATH \
@@ -368,42 +368,13 @@ RUN \
368368

369369
ENV PATH=/opt/node/bin:$PATH
370370

371-
# Install Java Runtime
372-
RUN \
373-
apt-get update && \
374-
# libgl1-mesa-dri > 150 MB -> Install jdk-headless version (without gui support)?
375-
# java runtime is extenable via the java-utils.sh tool intstaller script
376-
apt-get install -y --no-install-recommends openjdk-11-jdk-headless maven scala && \
377-
# Cleanup
378-
clean-layer.sh
379-
380-
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
381-
# TODO add MAVEN_HOME?
371+
# Java - removed
382372

383373
### END RUNTIMES ###
384374

385375
### PROCESS TOOLS ###
386376

387-
### Install xfce UI
388-
RUN \
389-
apt-get update && \
390-
# Install custom font
391-
apt-get install -y xfce4 xfce4-terminal xterm && \
392-
apt-get purge -y pm-utils xscreensaver* && \
393-
apt-get install -y xfce4-clipman && \
394-
# Cleanup
395-
clean-layer.sh
396-
397-
# Install rdp support via xrdp
398-
RUN \
399-
apt-get update && \
400-
apt-get install -y --no-install-recommends xrdp && \
401-
# use xfce
402-
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh && \
403-
# generate /etc/xrdp/rsakeys.ini
404-
cd /etc/xrdp/ && xrdp-keygen xrdp && \
405-
# Cleanup
406-
clean-layer.sh
377+
# Removed XRDP
407378

408379
# Install supervisor for process supervision
409380
RUN \
@@ -422,6 +393,17 @@ RUN \
422393
### END PROCESS TOOLS ###
423394

424395
### GUI TOOLS ###
396+
397+
### Install xfce UI
398+
RUN \
399+
apt-get update && \
400+
# Install custom font
401+
apt-get install -y xfce4 xfce4-terminal xterm && \
402+
apt-get purge -y pm-utils xscreensaver* && \
403+
apt-get install -y xfce4-clipman && \
404+
# Cleanup
405+
clean-layer.sh
406+
425407
# Install VNC
426408
RUN \
427409
apt-get update && \
@@ -722,6 +704,8 @@ RUN \
722704
jupyter nbextension enable execute_time/ExecuteTime --sys-prefix && \
723705
jupyter nbextension enable collapsible_headings/main --sys-prefix && \
724706
jupyter nbextension enable codefolding/main --sys-prefix && \
707+
# TODO: Disable pydeck extension, cannot be loaded (404)
708+
jupyter nbextension disable pydeck/extension && \
725709
# Install and activate Jupyter Tensorboard
726710
pip install --no-cache-dir git+https://github.com/InfuseAI/jupyter_tensorboard.git && \
727711
jupyter tensorboard enable --sys-prefix && \
@@ -782,7 +766,7 @@ RUN \
782766
exit 0 ; \
783767
fi && \
784768
$lab_ext_install @jupyterlab/toc && \
785-
769+
786770
# install temporarily from gitrepo due to the issue that jupyterlab_tensorboard does not work with 3.x yet as described here: https://github.com/chaoleili/jupyterlab_tensorboard/issues/28#issuecomment-783594541
787771
#$lab_ext_install jupyterlab_tensorboard && \
788772
pip install git+https://github.com/chaoleili/jupyterlab_tensorboard.git && \
@@ -804,15 +788,13 @@ RUN \
804788
exit 0 ; \
805789
fi \
806790
# Install jupyterlab language server support
807-
# TODO update versions for jupyterlab 3.0 release
808791
&& pip install jupyterlab-lsp==3.7.0 jupyter-lsp==1.3.0 && \
809792
# $lab_ext_install install @krassowski/jupyterlab-lsp@2.0.8 && \
810793
# For Plotly
811794
$lab_ext_install jupyterlab-plotly && \
812795
$lab_ext_install install @jupyter-widgets/jupyterlab-manager plotlywidget && \
813796
# produces build error: jupyter labextension install jupyterlab-chart-editor && \
814797
$lab_ext_install jupyterlab-chart-editor && \
815-
816798
# Install jupyterlab variable inspector - https://github.com/lckr/jupyterlab-variableInspector
817799
# TODO: see issue https://github.com/lckr/jupyterlab-variableInspector/issues/207 with installing it
818800
# $lab_ext_install @lckr/jupyterlab_variableinspector && \
@@ -890,15 +872,7 @@ RUN \
890872
rm ms-python-release.vsix && \
891873
mv extension $HOME/.vscode/extensions/ms-python.python-$VS_PYTHON_VERSION && \
892874
# && code-server --install-extension ms-python.python@$VS_PYTHON_VERSION \
893-
sleep $SLEEP_TIMER \
894-
# Install vscode-java: https://github.com/redhat-developer/vscode-java/releases
895-
&& VS_JAVA_VERSION="0.79.2" && \
896-
wget --retry-on-http-error=429 --waitretry 15 --tries 5 --no-verbose https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/$VS_JAVA_VERSION/vspackage -O redhat.java-$VS_JAVA_VERSION.vsix && \
897-
# wget --no-verbose -O redhat.java-$VS_JAVA_VERSION.vsix https://marketplace.visualstudio.com/_apis/public/gallery/publishers/redhat/vsextensions/java/$VS_JAVA_VERSION/vspackage && \
898-
bsdtar -xf redhat.java-$VS_JAVA_VERSION.vsix extension && \
899-
rm redhat.java-$VS_JAVA_VERSION.vsix && \
900-
mv extension $HOME/.vscode/extensions/redhat.java-$VS_JAVA_VERSION && \
901-
# && code-server --install-extension redhat.java@$VS_JAVA_VERSION \
875+
sleep $SLEEP_TIMER && \
902876
# If light flavor -> exit here
903877
if [ "$WORKSPACE_FLAVOR" = "light" ]; then \
904878
exit 0 ; \
@@ -936,9 +910,7 @@ RUN \
936910

937911
RUN \
938912
# TODO: Fix problem with jupyter extension panel: https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator/issues/125
939-
sed -i 's:notebook/js/mathjaxutils:base/js/mathjaxutils:g' $CONDA_PYTHON_DIR/site-packages/jupyter_nbextensions_configurator/static/nbextensions_configurator/render/render.js && \
940-
# TODO: Disable pydeck extension, cannot be loaded (404)
941-
jupyter nbextension disable pydeck/extension && \
913+
# TODO sed -i 's:notebook/js/mathjaxutils:base/js/mathjaxutils:g' $CONDA_PYTHON_DIR/site-packages/jupyter_nbextensions_configurator/static/nbextensions_configurator/render/render.js && \
942914
apt-get update && \
943915
# TODO: lib contains high vulnerability
944916
apt-get install -y --no-install-recommends libffi-dev && \
@@ -1034,7 +1006,6 @@ RUN \
10341006
# Fielbrowser Branding
10351007
mkdir -p $RESOURCES_PATH"/filebrowser/img/icons/" && \
10361008
cp -f $RESOURCES_PATH/branding/favicon.ico $RESOURCES_PATH"/filebrowser/img/icons/favicon.ico" && \
1037-
# Todo - use actual png
10381009
cp -f $RESOURCES_PATH/branding/favicon.ico $RESOURCES_PATH"/filebrowser/img/icons/favicon-32x32.png" && \
10391010
cp -f $RESOURCES_PATH/branding/favicon.ico $RESOURCES_PATH"/filebrowser/img/icons/favicon-16x16.png" && \
10401011
cp -f $RESOURCES_PATH/branding/ml-workspace-logo.svg $RESOURCES_PATH"/filebrowser/img/logo.svg"

resources/supervisor/programs/xrdp.conf

Lines changed: 0 additions & 7 deletions
This file was deleted.

resources/tools/xrdp.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
# Stops script execution if a command has an error
4+
set -e
5+
6+
INSTALL_ONLY=0
7+
8+
# Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
9+
for arg in "$@"; do
10+
case $arg in
11+
-i|--install) INSTALL_ONLY=1 ; shift ;;
12+
*) break ;;
13+
esac
14+
done
15+
16+
if [ ! -f "/usr/sbin/xrdp" ]; then
17+
echo "Installing XRDP. Please wait..."
18+
cd ${RESOURCES_PATH}
19+
apt-get update
20+
apt-get install -y --no-install-recommends xrdp
21+
# use xfce
22+
sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh
23+
# generate /etc/xrdp/rsakeys.ini
24+
cd /etc/xrdp/ && xrdp-keygen xrdp
25+
else
26+
echo "XRDP is already installed"
27+
fi
28+
29+
# Run
30+
if [ $INSTALL_ONLY = 0 ] ; then
31+
echo "Starting XRDP server"
32+
/usr/sbin/xrdp -nodaemon
33+
sleep 10
34+
fi

0 commit comments

Comments
 (0)