diff --git a/README.md b/README.md index 7b5c567224208d8586dafa71d63743e05bdf1cc5..1656ece369e07e0d633a54dda6246bee28a03d98 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,47 @@ -# -To run the docker +# Introduction + +We would like to explore the potential of docker in our community. +This repoitory is there for a first attempt. + +## Main usse case +I have a Mac laptop and I would like to work locally on my Mac in a UNIX system. +Some of the reasons are +- work directly on lxplus can be slow (dependent on the node). The advantage of lxplus is that it mounts `afs`, `eos`, `cvmfs` and the HTCondor interface. +- work on SWAN can be slow and it does not mount `afs` - this can be problematic for the MAD-X mask. +- python C-compiled package can have difficulty to be maintained also for Mac/Win, e.g., `cpymad` does not work properly on Mac +(I can install it on Mad and run small lattice, but when I try the larger ones, namely LHC, it fails). +I started to use a simple docker as a workaround (the same I used for CAS/JUAS courses), typically I use `jupiter lab` and my experience in term of performance and stability is very positive. +- I would like to mount `eos` and `afs` without suffering to much, and I would like that the possibility to share my setup not only via a set of wikis but also with press-one-button solution. With this spirit, one could prepare and share several `env`, e.g,. to track particles, to access NXCALS,... + +For the moment, I am considering that you have already installed in your Mac (local host) `afs` - it is quite easy to do so, I tested only on Catalina. +You do not need to install `eos` on your Mac. This is installed inside the container (thanks to the help of Fabio Luchetti). + +# To run the docker To lauch the docker sterbini/test ``` -docker run -ti --cap-add SYS_ADMIN --device /dev/fuse sterbini/test +docker run -ti --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/sterbini/be-abp-docker:$TAG ``` -I did n case you want to mount a local folder this has to be **shared** with Docker -(I did it with Docker Desktop on my Mac) +where you can find the $TAG you want at https://gitlab.cern.ch/sterbini/be-abp-docker/container_registry/9245. Probably you want the latest tag. + +**At the time of the writing (2021.03.24) the latest tag was 9ac88918.** + +In case you want to mount a local folder, this has to be **shared** with Docker Docker (I did it with Docker Desktop on my Mac) and then ``` -docker run -v /afs:/afs -ti --cap-add SYS_ADMIN --device /dev/fuse sterbini/test +docker run -v /afs:/afs -ti --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/sterbini/be-abp-docker:$TAG ``` -I took the kerberos configuration from lxplus. - - When you are in the docker you have to do: ``` bash -kinit sterbini +kinit $YOUR_NICE_LOGIN_NAME ``` # To make the docker -You have the docker at - -``` -/Users/sterbini/CERNBox/2021/docker/eos_docker -``` To build the docker @@ -37,21 +49,34 @@ To build the docker docker build . -t sterbini/test ``` -## To export the Xgraphics on mac +## To export the X-graphics on mac From https://medium.com/@mreichelt/how-to-show-x11-windows-within-docker-on-mac-50759f4b65cb - Install the latest XQuartz X11 server and run it - Activate the option ‘Allow connections from network clients’ in XQuartz settings - Quit & restart XQuartz (to activate the setting) -- On the host do -``` + +On the local host (Mac) do + +```bash xhost + 127.0.0.1 ``` -And when you run the docker add -``` + +And when you run the docker by adding + +```bash -e DISPLAY=host.docker.internal:0 ``` -that is + +to the `docker run` that is + +```bash +docker run --rm -e DISPLAY=host.docker.internal:0 -p 8889:8888 -ti --cap-add SYS_ADMIN --device /dev/fuse -e GRANT_SUDO=yes gitlab-registry.cern.ch/sterbini/be-abp-docker:$TAG +``` + +# To be done + ``` -docker run --rm -e DISPLAY=host.docker.internal:0 -p 8889:8888 -ti --cap-add SYS_ADMIN --device /dev/fuse -e GRANT_SUDO=yes sterbini/test +docker run --rm -e DISPLAY=host.docker.internal:0 -p 8889:8888 -ti --cap-add SYS_ADMIN --device /dev/fuse -e GRANT_SUDO=yes gitlab-registry.cern.ch/sterbini/be-abp-docker:$TAG ``` +