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

Run GUI applications? #16

Closed
biocyberman opened this issue Sep 25, 2019 · 5 comments
Closed

Run GUI applications? #16

biocyberman opened this issue Sep 25, 2019 · 5 comments

Comments

@biocyberman
Copy link

Have you guys succeeded with running tensorboard or jupyter nodtebook on SLURM+enroot-driven cluster? If you did, I would like to see an example.

@3XX0
Copy link
Member

3XX0 commented Sep 26, 2019

It's mostly up to the container image, there's nothing specific to SLURM/enroot.
You can checkout the NGC images, they have Tensorboard and Jupyter included: https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/rel_19.08.html#rel_19.08

@biocyberman
Copy link
Author

biocyberman commented Sep 26, 2019

How port forwarding/binding is done with enroot then? I haven't seen any documentation about this. In Docker: https://runnable.com/docker/binding-docker-ports. This port forwarding thing is needed for Jupyter and Tensorboard.

Regarding a GUI application in general, it is not simple in Docker. People makes bridge and wrapper to run GUI programs. I actually tried with a modfied docker image (see below) and ran with x11docker. It works with Docker but not with enroot. The following Dockerfile is for building a x11docker-compatible image.

FROM nvcr.io/nvidia/cuda:9.2-runtime-ubuntu16.04
# Build command:
# docker build -t vle/mate.bio:2019 .
# FROM nvcr.io/nvidia/cuda:10.1-runtime-ubuntu18.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-mark hold iptables && \
    apt-get -y dist-upgrade && apt-get autoremove -y && apt-get clean
RUN apt-get install -y dbus-x11 procps psmisc

# OpenGL / MESA
RUN apt-get install -y mesa-utils mesa-utils-extra libxv1 kmod xz-utils

# Language/locale settings
#   replace en_US by your desired locale setting,
#   for example de_DE for german.
ENV LANG en_US.UTF-8
RUN echo $LANG UTF-8 > /etc/locale.gen
RUN apt-get install -y locales && update-locale --reset LANG=$LANG

# some utils to have proper menus, mime file types etc.
RUN apt-get install -y --no-install-recommends xdg-utils xdg-user-dirs \
    menu menu-xdg mime-support desktop-file-utils

# Mate desktop core
RUN apt-get install -y --no-install-recommends mate-desktop-environment-core

# additional goodies. Last 3 packages are for CST
RUN apt-get install -y fortunes mate-applets mate-notification-daemon \
    mate-system-monitor mate-utils vim emacs wget libglu-dev file xvfb

# Set default python back to 3.5
# RUN update-alternatives --install /usr/bin/python python  /usr/bin/python3.5 1 && \
#    update-alternatives  --set python /usr/bin/python3.5

# startscript to copy dotfiles from /etc/skel
# runs either CMD or image command from docker run
RUN echo '#! /bin/sh\n\
[ -e "$HOME/.config" ] || cp -R /etc/skel/. $HOME/ \n\
exec $* \n\
' > /usr/local/bin/start
RUN chmod +x /usr/local/bin/start

ENTRYPOINT ["/usr/local/bin/start"]
CMD ["mate-session"]

ENV DEBIAN_FRONTEND newt

@3XX0
Copy link
Member

3XX0 commented Sep 26, 2019

There is no port forwarding in enroot, whatever port your application is listening on is the one you should connect to.

GUI applications are outside the scope of enroot, it's up to the container image or the admin to figure out what they need and configure whatever is necessary. I don't know what x11docker tries to do, but there are several way to do it, for example:

@3XX0 3XX0 closed this as completed Oct 30, 2019
@arnoldas500
Copy link

Are GUI applications or the ability to bind ports available at this time with enroot?

@ltalirz
Copy link
Contributor

ltalirz commented Aug 17, 2022

Are GUI applications available at this time with enroot?

Yes, as shown in the linked example, here would be how to run xeyes:

enroot start --env DISPLAY --mount /tmp/.X11-unix:/tmp/.X11-unix ubuntu.sqsh bash
root@host:/# apt update && apt install -y x11-apps
root@host:/# xeyes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants