root-project / root-docker

Docker recipes for ROOT
30 stars 33 forks source link

No graphics despite following dedicated instructions #41

Closed HealthyPear closed 3 years ago

HealthyPear commented 3 years ago

System information

OS: macos 10.15.7 XQuartz: 2.7.11 (xorg-server 1.18.4) docker: installed with brew cask, output of --version is Docker version 20.10.0, build 7287ab3

Steps followed

  1. got the container by doing docker run -it rootproject/root
  2. followed the instructions found here (Enabling graphics/OSX)

Outcome

   ------------------------------------------------------------------
  | Welcome to ROOT 6.22/06                        https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Nov 27 2020, 15:14:08                 |
  | From tags/v6-22-06@v6-22-06                                      |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0] TBrowser t
(TBrowser &) Name: Browser Title: ROOT Object Browser

After this, I get no GUI window showing an empty TBrowser.

eguiraud commented 3 years ago

Hi, do you start the container with docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$ip:0 rootproject/root ? If yes, what does gROOT->IsBatch() return when called at the ROOT prompt?

HealthyPear commented 3 years ago

Yes, I am in batch mode (in fact .demo doesn't work)

HealthyPear commented 3 years ago

Is there some default -b when launching root from a docker container?

HealthyPear commented 3 years ago

Ah yes, it seems so:

line 29 of the ubunut DockerFile (the distro associated with my container seems to be ubuntu)

CMD ["root", "-b"]

HealthyPear commented 3 years ago

How can I disable batch mode?

HealthyPear commented 3 years ago

Solved it:

just add the command root at the end of the docker run command to override the CMD key in the DockerFile.

Could be good to add this to the instructions maybe?

eguiraud commented 3 years ago

Yes, we have root -b as default command because we can't assume an X11 server is present (e.g. in CI jobs) but we should definitely point it out in the docs (PRs are welcome, otherwise I'll just leave this open as a reminder).

HealthyPear commented 3 years ago

Sure, I can do it.

Is the README the only place to add this modification? I guess the documentation shown on hub.docker is just the README itself?

eguiraud commented 3 years ago

yep, just the README. Thank you very much, much appreciated!

gbrandt1 commented 5 months ago

hello, this doesn't work for me either. i am giving root as explicit CMD but it still comes up in batch mode?

❯ docker run -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix --rm -it --user $(id -u) rootproject/root root

| Welcome to ROOT 6.30/04 https://root.cern | | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers | | Built for linuxx8664gcc on Jan 31 2024, 10:01:37 | | From heads/master@tags/v6-30-04 | | With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 | | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |

root [0] TBrowser b Warning in : The ROOT browser cannot run in batch mode (TBrowser &) Name: Browser Title: ROOT Object Browser root [1] gROOT->IsBatch() (bool) true

gbrandt1 commented 5 months ago

if i docker run into a bash shell and start root explicitly, i even get this:

root [0] gROOT->IsBatch() (bool) false root [1] TBrowser b Warning in : The ROOT browser cannot run in batch mode (TBrowser &) Name: Browser Title: ROOT Object Browser

martamaja10 commented 5 months ago

Hi @gbrandt1, I can indeed reproduce your issue, I'll take a look into it and will get back to you ASAP.

martamaja10 commented 5 months ago

Hi @gbrandt1, after checking it again, I realised it has been intended for a while to only have the batch option allowed in our Docker images (the documentation is outdated, I will fix it now). Therefore, it will not be possible to use the graphics. If you want to use the graphics, please use other ROOT installation methods: https://root.cern/install/.

eguiraud commented 5 months ago

it should be possible to use graphics with these docker images, if it's not it was an unintended regression (if it happened on my watch :) )

gbrandt1 commented 4 months ago

Hi, Thanks for the responses. Indeed I thought it is a bit unusual and antiquated to pass the X11 domain socket into the container to have graphics. The ROOT team may want to consider using a more modern solution like KasmVNC. For example there are many "legacy" applications that can provide their GUI in a broswer based on a baseimage like this:

https://github.com/linuxserver/docker-baseimage-kasmvnc

Kind Regards

martamaja10 commented 4 months ago

Hi again @gbrandt1 and @eguiraud,

I believe I made a mistake while trying to reproduce the issue and got confused by another batch mode discussion I had with some colleagues the other day. Now I followed the instructions from "enabling graphics" section once again both on mac and linux machines (ubuntu 22) and it all works fine for me.

So could you @gbrandt1 provide a bit more context? What OS are you using?

Cheers, Marta

gbrandt1 commented 4 months ago

Hi @martamaja10 I was using a Linux box with a natively installed ubuntu 20.04