Skip to content

SBGrid Site Installation Administration

One of the primary benefits of an SBGrid software installation is that it is a managed software stack. When installed as a site installation, new titles are added, obsolete versions are removed, and updates happen automatically. This makes software updates and bug fixes available to users by an email request (bugs@sbgrid.org), all without requiring local administrators or system administration expertise. While there are other installation modes available (GUI, default versions, select titles, etc), the site installation is the recommended mode of installation for most sites.

Installation Steps

  1. Create an 'sbgrid' user on the machine that will host your software installation.

    This step is not strictly required, but is highly recommended.

    adduser sbgrid
    

    By default the SBGrid installation manager, sbgrid-cli, will install at /opt/sbgrid. This path typically requires sudo/root to create on Linux and macOS. The sudo requirement can be skipped by using the --target flag to specify an alternate installation location. This is usually preferred as /opt may be on a filesystem with insufficient capacity. The sbgrid user must have write access to this target directory.

  2. Log in as the 'sbgrid' user

    su sbgrid
    
  3. Download the sbgrid-cli application

    sbgrid-cli for linux

    sbgrid-cli for macOS

    To download directly to a server or workstation from the command line:

    On macOS :

  curl -k -LO https://sbgrid.org/downloads/2.12.3/sbgrid-cli_2.12.3-macos.tar.gz

On Linux:

  curl -k -LO https://sbgrid.org/downloads/2.12.3/sbgrid-cli_2.12.3-linux.tar.gz
  1. Untar the archive

    On macOS :

  tar zxf sbgrid-cli_2.12.3-macos.tar.gz

On Linux:

  tar zxf sbgrid-cli_2.12.3-linux.tar.gz
  1. Activate the installation

    Activating the installation will create the required installation directories and core libraries for installing the software. Alternate installation paths can be used with the '--target flag'. The entire software collection will not be installed here - just an initial the core without the titles. Note that "activation" here is different from other tools, such as conda. For SBGrid, this is only necessary at initial installation.

    ./sbgrid-cli activate-site --target <path to software installation location>
    

    where the target path is writable. With --target, activation does not require sudo. The application will prompt for a site name and key which was provided by email. After this is entered and confirmed the software will be installed. A cron task is created for update checks.

    The manual creation of the "/programs" symlink to the target installation directory will be required, but only for machines running the software. /programs is not needed for updates or servers that host the programs as a network share. The '--skip-folder-checking' flag can be used to install without creation of /programs or directly into an existing /programs path.

Post-Install Steps

  1. Once the download has completed, you'll need to add a "/programs" symlink in the root directory of each machine that wants to use the software. Typically, this directory is shared via NFS to each of your computers.

    On Linux:

    ln -s /path/to/sbgrid/install/target /programs

    On macOS, root level symlinks must be defined in the /etc/synthetic.conf file. This is a simple configuration file, More info on synthetic.conf can be found here.

  2. Any user that wishes to use SBGrid needs to configure their shell to initialize the SBGrid shell environment:

    For bash: add source /programs/sbgrid.shrc to ~/.bashrc
    For tcsh: add source /programs/sbgrid.cshrc to ~/.cshrc

  3. Configure your workstations for compatibility: Configure your workstations for compatibility NOTE: XQuartz is required for many applications on macOS

  4. SBGrid installations allow site-level software control for Administrators

sbgrid-cli admin

sbgrid-cli admin mode replaces the sbgrid-admin script installation method used previously to install and automatically update SBGrid site installations. sbgrid-cli admin offers a some advantages:

  • parallel updates for fast, more efficient transfers
  • default version only for limited disk space
  • rolling updates for immediate releases

The sbgrid-cli admin command will:

  • Install all new titles added to SBGrid
  • Update existing versions when newer versions are added to SBGrid
  • Remove obsolete versions that are no longer supported

usage

sbgrid-cli admin installs only default versions of the software. It is usually desirable to add the --all-versions flag to manager all versions of all titles.

sbgrid-cli admin by default only installs for the platform it is run on, i.e. installation of linux packages on linux, macOS packages on macOS. This can be changed with the --linux and --darwin flags to install software for both platforms if needed. This is useful on file servers that may serve both linux and macOS clients.

examples

sbgrid-cli admin commands are typically run periodically from cron and don't produce output by default.

  • To install all default versions of all titles, add new titles when available, update all installed when available and remove obsolete versions, run:
sbgrid-cli admin
  • To do the same but to include all versions of all titles, usually desired.
sbgrid-cli admin --all-versions
  • Add the crontab entry. This can be done from sbgrid-cli with this command:
sbgrid-cli crontab
  • Full auto mode via cron - all versions, all titles mac and linux, 4 processes. This is the recommended installation configuration for NFS servers that serve linux and macOS workstation. For HPC sites and clusters, the --darwin flag can be omitted.
sbgrid-cli crontab --all-versions --darwin --linux -j 4

Crontab examples

Add these to crontab manually with crontab -e

  • Updates only - update the titles that have been explicitly installed, no new additions
*/15 * * * * /programs/x86_64-linux/sbgrid_installer/latest/sbgrid-cli update --all-titles --linux --darwin --yes --quiet
  • Run a daily cleanup to preserve space. This removes obsolete versions, no updates or new installations.
* 1 * * * /programs/x86_64-linux/sbgrid_installer/latest/sbgrid-cli clean --yes --quiet

For more info on cron configuration, see https://www.man7.org/linux/man-pages/man5/crontab.5.html

Migrating from sbgrid-admin legacy script

To migrate an existing site-install that uses our older legacy sbgrid-admin script, use the sbgrid-cli migrate-admin command as your sbgrid user. This will convert the legacy sbgrid-admin installation.

This process does not require downtime. It is best to update the installation after migration with sbgrid-cli admin --all-versions. Include --darwin or --linux if needed.

sbgrid@computer $  sbgrid-cli migrate-admin

Will produce

warn: The RSYNC_ARGS in your sbgridrc will not be copied over to the new configuration file.
warn: (in most cases sbgrid-cli doesn't require any custom arguments for rsync, so this should be fine)
info: Retrieving package metadata...
info: (1/9) Checking connection...
info: Checking services...
info: Checking sbgrid.org (HTTPS) ...
info: Checking sbgrid.org (HTTP) ...
info: (2/9) Checking rsync credentials...
info: (3/9) Calling activate API endpoint...
info: Site activation credentials provided, skipping API activation
info: (4/9) Initializing installation directories...
info: Please note that a link from the default installation directory /opt/sbgrid to the install target is required to run the software.
A link from /programs to /opt/sbgrid is also required.
info: (5/9) Synchronizing...
info: (6/9) Synchronizing...
info: (7/9) Installing sbgrid-installer@2.5.7 (x86_64-linux)...
info: Installation complete for sbgrid-installer@2.5.7 (x86_64-linux)
info: (8/9) Saving installation sitename file...
info: (9/9) Setting up your installation...
info: Setting all packages to installed & synchronizing your installation...
info: (1/2) Installing the admin cron job...
info: Cron job successfully installed to the current user's crontab
info: (2/2) Setting up your installation...
info: Migration to sbgrid-cli complete. The legacy configuration file has been renamed to /home/sbgrid/.sbgridrc_migrated

When migrating from an sbgrid-admin "site" installation to a sbgrid-cli installation, the symlinks are likely to be already in place and the info about creating them can usually be ignored The default crontab is added by this process. You can set that with the crontab -l command. This will check for updates every 15 minutes for the default software versions.

sbgrid@computer $ crontab -l
*/15 * * * * /programs/x86_64-linux/sbgrid_installer/latest/sbgrid-cli admin

To check for updates for all versions (recommended), run sbgrid-cli crontab --all-versions which will create a crontab with the proper --all-versions flag.

sbgrid@computer $ crontab -l
*/15 * * * * /programs/x86_64-linux/sbgrid_installer/latest/sbgrid-cli admin --all-versions

Add the relevant --darwin or --linux flags to the crontab command if your installation should include software for macOS on linux or vice-versa, i.e. for an SBGrid installation shared across Mac and Linux workstations.