Skip to content

Installation

Vanessa Sochat edited this page Oct 23, 2017 · 4 revisions

Installation (current)

Note that Python 3 is required for the primary functions with singularity registry (sregistry). You can install with Python 2, but you will hit some bugs. Thus we recommend install with pip (Python 3 and up) or a Singularity container, both described here.

pip install singularity

Installation (dev)

pip install git+git://github.com/singularityware/singularity-python.git

Recommended Install

We provide a Singularity container that serves the software, including python 3 via miniconda and entrypoints for both the shub and sregistry executable.

git clone https://www.github.com/singularityware/singularity-python
cd singularity-python
sudo singularity build sregistry Singularity.container

Quick Start

Local installation will place an executable, shub in your bin folder. The container method will give you a container that you can use as the same executable, and you can specify the client you want to use. The container serves "sregistry" as its main run script, and you can access the second client (shub) by specifying an --app. Thus, given a container called "sregistry":

# Singularity Version 2.4 and up
singularity run sregistry <command> [options]                       # Use sregistry client
singularity run --app shub sregistry <command> [options]            # Use shub client

# Singularity Version < 2.4
singularity run sregistry <command> [options]                      # Use sregistry client
singularity exec sregistry shub <command> [options]                # Use shub client

If you'd like to install with Python 2.7 please do a pull request to address the issue with timezone import. Thank you!

Test your installation

After installation, you should be able to run shub on the command line, without any input args, to see if you have Singularity installed (and test the package):

$ shub
	Please specify one or more containers with --image(s)


      $  shub --help
	usage: shub [-h] [--image IMAGE] [--images IMAGES] [--debug]
		    [--outfolder OUTFOLDER] [--package] [--os] [--oscalc] [--tags]
		    [--tree] [--simtree] [--subtract] [--simcalc] [--size SIZE]

	Singularity Hub command line tool

	optional arguments:
	  -h, --help            show this help message and exit
	  --image IMAGE         full path to singularity image (for use with --package
		                and --tree)
	  --images IMAGES       images, separated by commas (for use with --simtree
		                and --subtract
	  --debug               use verbose logging to debug.
	  --outfolder OUTFOLDER
		                full path to folder for output, stays in tmp (or pwd)
		                if not specified
	  --package             package a singularity container for singularity hub
	  --os                  estimate the operating system of your container.
	  --oscalc              calculate similarity score for your container vs.
		                docker library OS.
          --osplot              plot similarity scores for your container vs. docker
                                library OS.
	  --tags                retrieve list of software tags for an image, itself
		                minus it's base
	  --tree                view the guts of an singularity image (use --image)
	  --simtree             view common guts between two images (use --images)
	  --subtract            subtract one container image from the second to make a
		                difference tree (use --images first,subtract)
	  --simcalc             calculate similarity (number) between images based on
		                file contents.
	  --size SIZE           If using Docker or shub image, you can change size
		                (default is 1024)

Clone this wiki locally