cms-analysis / HiggsAnalysis-CombinedLimit

CMS Higgs Combination toolkit.
https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/latest
Apache License 2.0
75 stars 380 forks source link

Docker instructions for Mac users #896

Open giacomoortona opened 8 months ago

giacomoortona commented 8 months ago

Hi @clelange, I had a few issues when trying to open any graphic element in the docker standalone version on MacOS. I realised that in order to run properly on Mac, one should first set the DISPLAY variable in the docker run. Would it be possible to update the docker run command to:

docker run --hostname=97e12d678fa2 --user=cmsusr --env=PYTHONPATH=/usr/local/venv/lib::/code/HiggsAnalysis/CombinedLimit/build/lib/python --env=HOME=/home/cmsusr --env=CMSSW_BASE=/code --env=PATH=/usr/local/venv/bin:/usr/local/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/code/HiggsAnalysis/CombinedLimit/build/bin --env=LD_LIBRARY_PATH=/usr/local/venv/lib:/usr/local/venv/lib64:/usr/local/venv/lib:/usr/local/lib:/code/HiggsAnalysis/CombinedLimit/build/lib --env=ROOTSYS=/usr/local/venv --env=CLING_STANDARD_PCH=none --env=USER=cmsusr --env=GEOMETRY=1920x1080 --env=DISPLAY=host.docker.internal:0 --env=CC=/usr/local/venv/bin/gcc --env=CXX=/usr/local/venv/bin/g++ --env=GSL_ROOT_DIR=/usr/local/venv --workdir=/code --restart=no --label='maintainer.email=clemens.lange@cern.ch' --label='maintainer.name=Clemens Lange' --runtime=runc -t -d gitlab-registry.cern.ch/cms-cloud/combine-standalone:latest Afaict, it should not create problems to windows/linux users (although, I couldn't test it). Maybe it would be safer to maintain 2 different run commands?

Then we should instruct Mac users to also run sudo xhost +loclahost on their machines (see: https://gist.github.com/paul-krohn/e45f96181b1cf5e536325d1bdee6c949)

clelange commented 8 months ago

Hi @giacomoortona -- thanks for reporting this issue. While X windows access is possible, we've observed that it's easier for CMS open data users to use VNC instead. Could you try if the instructions at https://gitlab.cern.ch/cms-cloud/root-vnc/-/blob/master/README.md?ref_type=heads work for you? I'll look into updating the image but since I'm travelling this and next week it might take a bit longer. It should not break Linux/Windows but might break VNC.

giacomoortona commented 7 months ago

Hi @clelange, Thank you for your reply.

Maybe it's just my very limited docker knowledge, but it seems to me that there is no VNC server coupled to the combine docker image, am I wrong? In any case this is not urgent, it can definitively wait until you come back.

Thank you, Giacomo

nucleosynthesis commented 5 months ago

@clelange , I know there has been other things to be getting on with but it would indeed be good to know if vnc would be compatible with the docker container

@giacomoortona , we recently produced a container for the v9.2.0 tag as the docs suggest. Could you try again with this container ? Nick

clelange commented 5 months ago

The new (slim) container doesn't include VNC anymore. I can look into adding it though, making the necessary fixes pointed out by @giacomoortona

giacomoortona commented 5 months ago

Hi @clelange, afaict, adding the Display environment variable + xhost should be working on Mac, KDE and maybe elsewhere. Although for reasons I can't yet understand, sometimes container created with my suggested run command get stuck after "docker start". They do work if one uses "docker exec" instead, but you might want to have a look at my suggestion. Maybe there something silly in my command (I tried figuring it out, but with no success so far).