Difference between revisions of "HOWTO use the GlueX Singularity Container"

From GlueXWiki
Jump to: navigation, search
(Get a Shell Inside the Container)
Line 87: Line 87:
  
 
  source /group/halld/Software/build_scripts/gluex_env_jlab.csh
 
  source /group/halld/Software/build_scripts/gluex_env_jlab.csh
 +
 +
== gxshell ==
 +
We set up a tool to more easily set up and start a shell session. It requires singularity and cvmfs to be set up. For instructions consult [[HOWTO Install and Use the CVMFS Client]]
 +
 +
Once the software is installed create an alias like
 +
alias gxshell singularity exec --bind /cvmfs/oasis.opensciencegrid.org/gluex/group/halld:/group/halld,/scratch,/home /cvmfs/singularity.opensciencegrid.org/jeffersonlab/gluex_devel:latest gxshell
 +
where you bin all directories that you want to take "into" the container. Binding /cvmfs/oasis.opensciencegrid.org/gluex/group/halld to /group/halld/ ensures that the prebuilt software will be available in the container.
 +
 +
If everything is set up correctly all you have to do is type
 +
gxshell
 +
to start a bash shell within the GlueX container with the software environment set up.

Revision as of 13:56, 15 February 2023

Install Singularity

See the instructions on the Singularity site.

Alternately, RedHat Enterprise 7 has an RPM:

yum install singularity

Or on Ubuntu 16.04 and earlier:

go here and follow the instructions

Or Ubuntu 16.10 and later:

sudo apt-get install singularity-container

Get the Container

Download gluex_centos-7.7.1908_sng3.8_gxi2.20.sif, the container.

At JLab there is no need to download. The file is on the group disk:

 /group/halld/www/halldweb/html/dist/gluex_centos-7.7.1908_sng3.8_gxi2.20.sif

Get the Software and Support Files

Use one of three methods.

1. tarball

This method is not supported at present (December 13, 2018). If you would like to see it revived, contact the Software Working group.

  1. Download the tarball: group.halld.tar.gz. It's 18 GB.
  2. cd <directory that will contain "group">
  3. tar zxvf <directory containing tarball>/group_halld.tar.gz

2. rsync with direct ssh

rsync -ruvt --delete --links scosg16.jlab.org:/cvmfs/oasis.opensciencegrid.org/gluex/group/ <directory that contains "group">/group/

3. rsync through ssh tunnel

  1. Establish the tunnel
    ssh -t -L9001:localhost:9001 login.jlab.org ssh -t -L9001:localhost:22 scosg16
    
  2. In a separate shell instance, do the rsync
    rsync -ruvt --delete --links -e 'ssh -p9001' localhost:/cvmfs/oasis.opensciencegrid.org/gluex/group/ <directory that contains "group">/group/
    

4. Run CVMFS

There are two options here:

Depending on choices made during installation the directory that contains "group" will be something like

/path/to/cvmfs/oasis.opensciencegrid.org/gluex

Get a Shell Inside the Container

singularity shell --cleanenv --bind <directory that contains "group">/group/halld:/group/halld <directory with container>/gluex_centos-7.7.1908_sng3.8_gxi2.20.sif

Set-up the Developer Toolset package (optional)

The standard GCC version is 4.8.5. Perform the following step if you would like to use the GCC 8.3.1 compiler.

scl enable devtoolset-8 bash

or

scl enable devtoolset-8 tcsh

Set-Up the GlueX Environment

For bash:

source /group/halld/Software/build_scripts/gluex_env_jlab.sh

or for tcsh:

source /group/halld/Software/build_scripts/gluex_env_jlab.csh

gxshell

We set up a tool to more easily set up and start a shell session. It requires singularity and cvmfs to be set up. For instructions consult HOWTO Install and Use the CVMFS Client

Once the software is installed create an alias like

alias gxshell singularity exec --bind /cvmfs/oasis.opensciencegrid.org/gluex/group/halld:/group/halld,/scratch,/home /cvmfs/singularity.opensciencegrid.org/jeffersonlab/gluex_devel:latest gxshell

where you bin all directories that you want to take "into" the container. Binding /cvmfs/oasis.opensciencegrid.org/gluex/group/halld to /group/halld/ ensures that the prebuilt software will be available in the container.

If everything is set up correctly all you have to do is type

gxshell

to start a bash shell within the GlueX container with the software environment set up.