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

R desktop gui #122

Closed
Thell opened this issue Apr 29, 2015 · 6 comments
Closed

R desktop gui #122

Thell opened this issue Apr 29, 2015 · 6 comments

Comments

@Thell
Copy link

Thell commented Apr 29, 2015

This isn't an issue. It was mentioned to me by @eddelbuettel to possibly make a wiki entry regarding an image I was playing with that runs RStudio preview on the desktop but IMO it wasn't even close to being generalized enough so....

I'm running Ubuntu Gnome 15.04 and docker master with a docker group instead of sudo...

The containers need to have access to the xhost...

xhost local:docker

R base gui
( interactive plotting works as expected too. )

docker run --rm -it -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
rocker/r-base /usr/bin/R --gui=tk

R-base ESS - Dockerfile

# To use:
#  build:
#   docker build -t $USER/r-base-ess-desktop .
#  run:
#   docker run --rm -it \
#    -e DISPLAY=unix$DISPLAY \
#    -e NO_AT_BRIDGE=1 \
#    -v /tmp/.X11-unix:/tmp/.X11-unix \
#    --device /dev/snd \
#    --device /dev/dri \
#    --name ess
#    $USER/r-base-ess-desktop

FROM rocker/r-base

RUN apt-get update -qq && apt-get install -qqy \
    dbus-x11 \
    emacs24 \
    ess \
    libcanberra-gtk-module \
    libcanberra-gtk3-module

CMD ["emacs"]

Other simple tk interfaces seem to be equally as easy. No xvfb needed. When playing with RStudio it is more involved and quite a bit more stuff is needed to make use of the full IDE, I'm guessing that is also true for the ESS example, but it is just an example. :)

If these types of things are a fit for the wiki, would a page along the lines of 'Rocker Desktop' work?

@cboettig
Copy link
Member

I think a wiki page on how to do display forwarding would be of valuable,
particularly if it flushed out a few use cases.

For instance, I run the r-base images like this all the time in terminal
mode, just so I can have graphics work on a container (to be specific, I've
aliased "R" to a docker run command that forwards the display port)

It would be good to document what platforms it has been tested on though at
least. Users tend to expect docker to be pretty host-agnostic, which
clearly isn't the case when you start linking all these host-specific
elements.

On Wed, Apr 29, 2015 at 12:43 PM Thell notifications@github.com wrote:

This isn't an issue. It was mentioned to me by @eddelbuettel
https://github.com/eddelbuettel to possibly make a wiki entry regarding
an image I was playing with that runs RStudio preview on the desktop but
IMO it wasn't even close to being generalized enough so....

I'm running Ubuntu Gnome 15.04 and docker master with a docker group
instead of sudo...

The containers need to have access to the xhost...

xhost local:docker

R base gui

( interactive plotting works as expected too. )

docker run --rm -it -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
rocker/r-base /usr/bin/R --gui=tk

R-base ESS - Dockerfile

To use:

build:

docker build -t $USER/r-base-ess-desktop

run:

docker run --rm -it \

-e DISPLAY=unix$DISPLAY \

-e NO_AT_BRIDGE=1 \

-v /tmp/.X11-unix:/tmp/.X11-unix \

--device /dev/snd \

--device /dev/dri \

--name ess

$USER/r-base-ess-desktop

FROM rocker/r-base

RUN apt-get update -qq && apt-get install -qqy
dbus-x11
emacs24
ess
libcanberra-gtk-module
libcanberra-gtk3-module

CMD ["emacs"]

Other simple tk interfaces seem to be equally as easy. No xvfb needed.
When playing with RStudio it is more involved and quite a bit more stuff is
needed to make use of the full IDE, I'm guessing that is also true for the
ESS example, but it is just an example. :)

If these types of things are a fit for the wiki, would a page along the
lines of 'Rocker Desktop' work?


Reply to this email directly or view it on GitHub
#122.

@Thell
Copy link
Author

Thell commented Apr 29, 2015

Users tend to expect docker to be pretty host-agnostic, which
clearly isn't the case when you start linking all these host-specific
elements.

That's exactly what I was thinking regarding 'generalized'. Perhaps even the simple R-base gui version isn't truly general enough... I have no clue how this would work on Mac or Windows. These types of setups do make working with 'rgl' nice and easy though. :)

@cboettig
Copy link
Member

Looks like on Ubuntu >= 15.04 you now need to deal with XAuthority permissions as well to get this to work, as described here: http://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker-container/25280523#25280523

Also, I've made a very brief page on the Wiki to address this, please edit as you see fit.

@Thell
Copy link
Author

Thell commented Jun 10, 2015

@cboettig Interesting. I've not had a need to mess with anything but xhost local:docker. Sometimes, rarely, I do get a qxcbconnection xcb error with video garbage on menu items.

@Thell
Copy link
Author

Thell commented Dec 19, 2015

@cboettig I finally got around to posting some dockerfiles particularly a RStudio Desktop Preview dockerfile that gives what I believe to be everything required to use all of the builtin features of RStudio with only a few additional things (ccache, clang-format, some cli utils).

The user.dockerfile takes advantage of dockers new build variables ability, and in the /scripts are some helpers to really make builds faster. (a full build of all of my normal containers used to take just over an hour with squid, and now takes ~20 minutes without it and ~ 8 minutes with. 😃

I've been using this setup for a couple of months now and through each update of RStudio Preview and have been real happy with it.

@Thell Thell closed this as completed Dec 19, 2015
@Thell
Copy link
Author

Thell commented Dec 19, 2015

wrong button... still want further discussion, ideas and such

@Thell Thell reopened this Dec 19, 2015
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

2 participants