Pandaroot Development inside Docker Container ############################################# TL;DR ===== Onboarding is now faster than ever: - Run ``rklasen/cvmfs`` container - Clone Pandaroot - Open Repo in VSCode - Switch to DevContainer And voila, VSCode behaves as if it's being run inside the container (because it is). You can immedidiately start to compile and run PandaRoot, no further packet installation needed. Why? ==== - Batteries Included (environment is ready out of the box) - Ships with recommended extensions - User can still add their favorite extensions - Less compile time (if pre-built external packages from GSI and FairRoot are used) - Consistent dev environment (host packages, updates or distro don't interfere with container image) How? ==== Most of the info is taken directly from the `official docs `_. .. image:: architecture-containers.png :alt: How it's done Basically it goes like this: - VSCode builds or pulls docker image - VSCode runs and mounts definitions from ``.devcontainer`` file - VSCode attaches to container - VSCode installs VSCode Server inside container, and installs extensions from definitions file - VCSCode attaches to Server inside container Detailed Steps ============== Run the ``cvmfs`` container:: docker run rklasen/cvmfs Clone PandaRoot somewhere and open the repo in VSCode. Remote Containers ================= Install the extension "Remote Containers": .. image:: 1-containers.png :alt: Containers Extension Click the remote containers option in the lower left corner (the yellow arrow thingies): .. image:: 2-reopen-2.png :alt: Click Me Select "reopen in container": .. image:: 2-reopen-3.png :alt: Reopen This can take up to five minutes the first time this is done. Don't worry, it will be faster the next time. The icon in the lower left should have changed: .. image:: 3-container.png :alt: Ready Make ---- Select the dev kit. Since we're now in a purpose-built container, only one is available: .. image:: 4-select-kit.png :alt: Kit After hitting ```` + ```` for building, we're given the choice to select CMake: .. image:: 5-cmake.png :alt: cmake However, configuring fails the first time because CMake doesn't yet know where to configure. We can help it by running the built manually once. Open the integrated terminal with ```` + ```` + ``<`>``, go to ``cd build`` and ``cmake ../``: .. image:: 5-cmake-2.png :alt: CMake Extensions ---------- If you're missing your favorite extension, you can install it in the container per userspace: .. image:: 6-extensions.png :alt: Extensions are nice If you think an extension should be added to the default install, add it to the ``.devcontainer`` file (and submit a MR of course). And bask in glorious ROOTness: ------------------------------ .. image:: 7-root-running.png :alt: I AM ROOT Drawbacks ========= So SSH Access from Container ---------------------------- Your ``.ssh/*`` isn't mounted by default, so you can't access the Gitlab (yet).