diff --git a/Dockerfile b/Dockerfile index 3d0f92e8cd90f0829f379cca224729b649095f28..cf59a322981c12367d284f741f3035ddcfc8ecac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -161,6 +161,7 @@ RUN conda activate $ENV_PREFIX \ && cd ../.. \ && git clone https://github.com/PyCOMPLETE/FillingPatterns.git \ && pip install ./FillingPatterns \ + && python -m pip install -U --index-url https://acc-py-repo.cern.ch/repository/vr-py-releases/simple --trusted-host acc-py-repo.cern.ch pytimber && conda deactivate diff --git a/README.md b/README.md index ef318acf248abc360699b62affd65bfe41532375..71221b37abb9a08e7193cde4bdd3c253d490ed06 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,18 @@ # Introduction We would like to explore the potential of docker in our community. -This repository is there for a first attempt. +This repository is there a first attempt in this direction. ## Main use 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 difficulties to be maintained 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 `jupyter 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 the docker only on Catalina. +I have a Mac laptop and I would like to work locally on my Mac in a UNIX system for the following reasons: +- to work directly on lxplus can be slow (node dependent). 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 our MAD-X mask. +- python C-compiled package can have difficulties to be maintained for Mac/Win, e.g., `cpymad` does not work properly on Mac (I manage to 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 `jupyter lab` and my experience in term of performance and stability is positive. +- I would like to mount `eos` and `afs` without suffering to much +- I would like that the possibility to share my setup not only via a set of wikis but also with a press-one-button solution. With this spirit, one could prepare and share several conda `env`, e.g,. to track particles, to access NXCALS,... +- one can also couple VSCode directly on the container. + +For the moment, I am considering that you have already installed in your Mac (localhost) `afs` - it is quite easy to do so, I tested the docker 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 @@ -22,20 +20,26 @@ You do not need to install `eos` on your Mac. This is installed inside the conta To lauch the docker sterbini/test ```bash -docker run -ti --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/abpcomputing/sandbox/be-abp-docker:$TAG +docker run -it -u 0 -v /afs:/afs -v ~:/home/jovyan/local_host_home -p 8888:8888 --rm --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/abpcomputing/sandbox/be-abp-docker:$commit_tag ``` -where you can find the $TAG you want at https://gitlab.cern.ch/abpcomputing/sandbox/be-abp-docker/container_registry/9443. Probably you want the latest tag. +where you can find the available $commit_tag at https://gitlab.cern.ch/abpcomputing/sandbox/be-abp-docker/container_registry/9443. Probably you want the latest tag. -**At the time of the writing (2021.04.16) the latest tag was fdc1d689.** +**At the time of the writing (2021.05.07) the latest tag was 288bbf2a.** 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 +and then use the `-v` option ```bash -docker run -it -u 0 -v /afs:/afs -v ~:/home/jovyan/local_host_home -p 8889:8888 --rm --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/abpcomputing/sandbox/be-abp-docker:fdc1d689 +docker run -it -u 0 -v /afs:/afs -v ~:/home/jovyan/local_host_home -p 8888:8888 --rm --cap-add SYS_ADMIN --device /dev/fuse gitlab-registry.cern.ch/abpcomputing/sandbox/be-abp-docker:288bbf2a ``` +The volumes you mount are very important, since only the information you save there will survive after you exit the container. + +When the container is starting will try to run the file `/home/jovyan/local_host_home/docker_start.sh`. You can customize it accordingly to your need. You find a template of the file in `/home/jovyan/docker_start.sh`. So please copy it on `/home/jovyan/local_host_home`. + +You can run a jupyter notebook server with `jupy`. + When you are in the docker you have to do: ``` bash