This lesson is being piloted (Beta version)

Setting up the ATLAS Environment

Overview

Teaching: 30 min
Exercises: 30 min
Questions
  • What is a “release”?

  • How can I configure my laptop to use “ATLAS code”?

Objectives
  • Setup your working environment with Docker

  • Load the ATLAS release through an image

Setting up “ATLAS”

Your collaborators in ATLAS produce a lot of amazing and powerful code that allows you to perform complex tasks and carry out amazing analyses. This code is generally referred to as “athena”. You can browse this code by clicking on the previous link. However, to be able to use this code you have to “get access” to it. This is done by building a basic version of athena and producing a bunch of libraries and header files which are subsequently bundled into what is referred to as a release.

You will learn much more about the structure of this release when we learn about CMake on the second day of the workshop. However, for now, you can view this “release” as a pre-requisite to be able to write code to analyze ATLAS data (and Monte Carlo simulation!).

There are a few ways to get access to this pre-compiled codebase. For the majority of this workshop we will be working at the UChicago Analysis Facility to do this and working in an AnalysisBase release container. We will also be using Docker, you will learn more about the details of Docker later in the week of the bootcamp and what is presented here is only the minimal setup which will allow you to work through the tutorial.

Via CVMFS

One common way to setup the analysis release is to use the CernVM File System which is available on nearly all clusters within the collaboration. In this case, you use the setupATLAS alias command to initialize the asetup (“athena(a) setup”) command which is subsequently used to create the surrounding ATLAS coding environment by giving you access to the precompiled base release. Type the following instructions on the command line of the facility, this would typically look something like:

 -bash-4.2$ setupATLAS
 lsetup               lsetup <tool1> [ <tool2> ...] (see lsetup -h):
  lsetup agis          ATLAS Grid Information System
  lsetup asetup        (or asetup) to setup an Athena release
  lsetup atlantis      Atlantis: event display
 ...
 -bash-4.2$ asetup AnalysisBase,21.2.186,here
 Using AnalysisBase/21.2.186 [cmake] with platform x86_64-centos7-gcc8-opt
   at /cvmfs/atlas.cern.ch/repo/sw/software/21.2
 Test area: /home/jhaley/bootcamp2021
 -bash-4.2$

Via Docker

General information about Docker and details of installation can be found here: Docker Installation Depending on the operating system you are using on the local machine, links to specific instructions on the Docker website can be found below.

This is achieving precisely the same goal as what we are achieving with CVMFS in this bootcamp. The primary benefit is that using Docker allows you to comfortably use your laptop for all of your work. So, cluster down? (No Problem!), poor internet connection? (No Problem), … you can now work all the time!

It is usually recommended that you DO NOT use Windows. It has caused problems in the past, very few individuals use this OS within the HEP community as most tools are designed for Unix-based systems. If you do have a Windows machine, consider making your computer a dual-boot machine - Link to Directions

However, the support for Docker on Windows and has proven to be a viable option in recent Windows updates. Please follow the instructions below to try this setup.

Download Docker for Windows instructions.

Docker Desktop for Windows is the Community Edition (CE) of Docker for Microsoft Windows. To download Docker Desktop for Windows, head to Docker Hub.

Please read the relevant information on these pages, it should take no more than 5 minutes.


Download Docker for MacOS instructions.

Docker is a full development platform for creating containerized apps, and Docker Desktop for Mac is the best way to get started with Docker on a Mac. To download Docker Desktop for MacOS, head to Docker Hub.

Please read the relevant information on these pages, it should take no more than 5 minutes.
Another common way to install packages on Mac OSX is via the homebrew package manager. In the case of docker, you can easily install docker by setting up homebrew and executing brew cask install docker.


Downloading and installing Docker for Linux may be slightly more difficult but please contact the organisers or tutors as soon as possible so they can help with any problems.

Here are the instructions for two popular Linux distributions:

  • CentOS
  • Ubuntu

  • Instructions for other Linux distributions can be found on the Docker docs pages.

    Be sure to read the Docker documentation on post-installation steps for Linux and managing Docker as a non-root user. This will allow you to edit files when you have started up the Docker container from your image.

    If something doesn’t work

    Docker is a standard industry tool. The directions above should “just work”. That said, if you spend one hour working by yourself and still find that you are having issues with the basic setup, ASK SOMEONE!!! We have created a Discord server (Link to Discord) where you can dynamically ask tutors and other participants questions. This pertains to setting up Docker as well as every other portion of the bootcamp.

    And more broadly, this is a very good general rule of thumb to get into. If you are struggling with something, particularly if it is technical, don’t needlessly waste your time thinking that “this is a stupid question, so I’m not allowed to ask”. There will be something to help you and that is what collaboration is all about anyways. So do one of the following :

    • Ask the person sitting next to you
    • Ask that helpful person on your analysis team or working group
    • Ask a Skype channel, Mattermost or Discord chat
    • Ask a mailing list

    When you are done, just be sure to say “thank you”. #teamworkmakesthedreamwork

    Download an ATLAS AnalysisBase Release

    Start by downloading the Docker image for the release you want using the docker pull. The Docker images get managed by Docker behind the scenes (Again, more details in the Docker session), so you don’t have to worry about that yourself:

    >docker pull atlas/analysisbase:21.2.186
    

    The image should be around 4GB in size, so make sure you have the space available on your hard drive.

    Latest Release

    These instructions will use a numbered release, which should be your default to work with.

    If you want to use the absolutely latest, bleeding edge version you can replace atlas/analysisbase:21.2.186 with atlas/analysisbase or atlas/analysisbase/latest. However, doing so is not recommended for this bootcamp. Though some times it can be fun to live on the edge, so go ahead, try to pull the very latest ATLAS AnalysisBase image.

    Starting the Release

    Let’s now test to see whether this worked. Now that you have pulled the release image, you can use it to setup the ATLAS environment release. This is done using the docker run command.

    docker run --rm -it atlas/analysisbase:21.2.186 bash
    

    This will change the look of command prompt and you should now see something similar to [bash][atlas]:workdir > or [bash][atlas]:~ > as your prompt depending on where you are within the container. If you list the files in the top directory of the container, you should see one file called release_setup.sh. Sourcing this file will load the release that is contained within the image. Try

    source /release_setup.sh
    

    If this worked properly and you have setup docker correctly, then you should see the following

    [bash][atlas]:~ > source /release_setup.sh 
    Configured GCC from: /opt/lcg/gcc/8.3.0-cebb0/x86_64-centos7/bin/gcc
    Configured AnalysisBase from: /usr/AnalysisBase/21.2.186/InstallArea/x86_64-centos7-gcc8-opt
    [bash][atlas AnalysisBase-21.2.186]:~ > 
    

    Key Points

    • A software release (e.g. AnalysisBase) is necessary to analyze ATLAS data.

    • You will learn much more about the details of an ATLAS release on Tuesday!

    • The UChicago Analysis facility will serve for all ATLAS work throughout this tutorial.

    • Docker serves as a “portal” for all ATLAS work, that is to say we can do the same work as in the facility. It can be thought of a “virtual machine”.

    • You will learn much more about Docker on Wednesday!