Docker images with STAR software (i.e. libraries, root4star, starsim, etc.) and
all of their run-time dependencies can be built using the Dockerfiles provided
in this directory. Here we assume that the context directory for Docker builds
is the root of this repository, i.e. star-sw
.
Here is a quick example on how one can run a BFC macro using a pre-built image:
docker pull starbnl/star-test-data
docker run --name star-test-data --volume /star-test-data starbnl/star-test-data
docker run --volumes-from star-test-data starbnl/star-sw root4star -b -l -q \
'bfc.C(10, "pp2017,StiCA,btof,mtd,pp2pp,fmsDat,fmsPoint,fpsDat,BEmcChkStat,QAalltrigs,CorrX,OSpaceZ2,OGridLeak3D,-hitfilt", "/star-test-data/quick/st_physics_18069061_raw_2000021.daq")'
Keep reading if the above commands do not make much sense to you.
A straightforward interface for building all Docker images is implemented in a single bash script. The options accepted by the script are expected to be self explanatory.
path/to/star-sw/scripts/build_star-sw.sh -h
Usage: build_star-sw.sh
[<star-cvs_branch_or_tag [=master]> ]
[-t Debug|Release|RelWithDebInfo]
[-b <star_base_image [=centos7]>]
star-base
We provide Dockerfiles to build images with all dependencies required to compile the STAR software. The Linux releases indicated below can be used as base layers:
- CentOS 7.4.1708 Dockerfile (gcc 4.8.5)
- Ubuntu 16.04 Dockerfile (gcc 5.4.0)
- Ubuntu 18.04 Dockerfile (gcc 7.4.0)
Currently, several essential components are installed from source rather than being installed using a system's package manager. The manually built dependencies include:
- ROOT 5.34.38
- CERNLIB 2006
- Eigen 3.3.4
The following command is an example for how to produce local star-base
images:
docker build -t star-base -f docker/Dockerfile.star-base-<os-release> /path/to/star-sw
with <os-release>
being one of the following [centos7, ubuntu16, ubuntu18].
star-sw
The images actually containing the STAR software (star-sw
) inherit from the
star-base
ones. They are built with a command similar to the following one:
docker build -t star-sw -f docker/Dockerfile.star-sw /path/to/star-sw
star-test-data
A small image with a few raw data (.daq) files is available for download from the Docker hub. Each data file contains a small number of events and suitable for quick tests. First, download the image by issuing the command
docker pull starbnl/star-test-data
To list all files inside the container do
docker run starbnl/star-test-data find /star-test-data
Then share the internal volume so it can be mounted inside other containers as
docker run --name star-test-data --volume /star-test-data starbnl/star-test-data
Finally, one can use the data files in a typical BFC job like this
docker run --volumes-from star-test-data star-sw \
root4star -b -l -q 'bfc.C(10, "pp2017,StiCA,btof,mtd,pp2pp,fmsDat,fmsPoint,fpsDat,BEmcChkStat,QAalltrigs,CorrX,OSpaceZ2,OGridLeak3D,-hitfilt", "/star-test-data/quick/st_physics_18069061_raw_2000021.daq")'
One can build locally modified code inside a docker container, e.g. to use
star-base-ubuntu16
do
docker run -it --rm \
-v /path/to/star-cvs:/tmp/star-cvs \
-v /path/to/star-sw:/tmp/star-sw \
-v /path/to/star/data:/tmp/data \
-w /tmp star-base-centos7 bash
# At this point you should be in `/tmp` inside the container
mkdir star-build && cd star-build
cmake /tmp/star-sw -DSTAR_SRC=/tmp/star-cvs -DCMAKE_INSTALL_PREFIX=/tmp/star-install -DCERNLIB_ROOT=/cern/2006 -DSTAR_PATCH=gcc540
make -j4
make install
source /tmp/star-install/bin/thisstar.sh
source /usr/local/bin/thisroot.sh
cd /tmp/star-install
root4star -b '/tmp/star-install/StRoot/macros/bfc.C(3, "bfc,chain,options", "/tmp/data/st_physics_file.daq")'