Skip to content
Snippets Groups Projects
Commit f0bdbfbd authored by Daniela Daniel's avatar Daniela Daniel
Browse files

Converted to Markdown

parent bc48bdef
No related merge requests found
......@@ -3,36 +3,36 @@ documentation updates as a pull request to the `master` branch of the
[singularity docs
repo](https://github.com/singularityware/singularityware.github.io). Thanks!!
===== BioHPC Singularity Installation (Deprecated) =====
# BioHPC Singularity Installation (Deprecated)
BioHPC currently uses a customized Singularity version of Singularity - ''%%singularity/2.4.2-utsw-2018010%%''
BioHPC currently uses a customized Singularity version of Singularity - `singularity/2.4.2-utsw-2018010`
The codebase from this version tracks singularity/release-2.4 on GitHub, but includes 2 PRs developed by DCT that have not yet been merged into mainstream Singularity release:
* PR 1181 - Docker aufs whiteout handling
* PR 1124 - Workaround to inject bind points in to docker containers on systems without overlayfs available (RHEL6.x)
==== Detail of PR Customizations ====
## Detail of PR Customizations
=== PR 1181 ===
### PR 1181
This PR to Singularity implements correct handling of whiteout files when extracting complex Docker containers. When a file is removed in a Dockerfile build script, which was created by a parent layer, the current layer will contain a ''%%.wh.%%'' marker file noting that the parent file should be removed as the current layer is extracted. Prior to PR1181 this was not implemented correctly in Singularity, so some Docker containers such as ''%%nvidia/digits:6.0%%'' would not run correctly. The PR corrects the behaviour to follow Docker.
This PR to Singularity implements correct handling of whiteout files when extracting complex Docker containers. When a file is removed in a Dockerfile build script, which was created by a parent layer, the current layer will contain a `.wh.` marker file noting that the parent file should be removed as the current layer is extracted. Prior to PR1181 this was not implemented correctly in Singularity, so some Docker containers such as `nvidia/digits:6.0` would not run correctly. The PR corrects the behaviour to follow Docker.
PR1181 will be merged into the main Singularity codebase for 3.0.
=== PR1124 ===
### PR1124
BioHPC runs RHEL6.9, which does not include support for OverlayFS. When running a container, Singularity will attempt to bind cluster filesystems into the container, so that tools inside the container can act on data on cluster filesystems. Without overlayfs, the target of the bind must exist in the container. Docker containers have e.g. a ''%%/home%%'', but not a ''%%/home2%%'', so Singularity cannot bind user home directories on BioHPC.
BioHPC runs RHEL6.9, which does not include support for OverlayFS. When running a container, Singularity will attempt to bind cluster filesystems into the container, so that tools inside the container can act on data on cluster filesystems. Without overlayfs, the target of the bind must exist in the container. Docker containers have e.g. a `/home`, but not a `/home2`, so Singularity cannot bind user home directories on BioHPC.
This PR implements a ''%%docker inject binds%%'' feature, that will inject a layer containing bind points defined in ''%%singularity.conf%%'' into any Docker container that is pulled or run using Singularity. This ensures containers work as users expect, without requiring overlayfs
This PR implements a `docker inject binds` feature, that will inject a layer containing bind points defined in `singularity.conf` into any Docker container that is pulled or run using Singularity. This ensures containers work as users expect, without requiring overlayfs
PR1124 may not be merged into Singularity 3.0 - there has not been a lot of interest in this feature in the Singularity community.
==== Singularity Install Procedure ====
## Singularity Install Procedure
Singularity uses setuid binaries for bind mounting and some other small steps, so cannot be installed entirely from the usual moduleadmin account.
<code bash>
```
# As a user
git clone https://git.biohpc.swmed.edu/biohpc/singularity.git
cd singularity
......@@ -42,11 +42,11 @@ git checkout release-2.4-utsw
make
# Make install *must* be run as root, via sudo or other meanse
sudo make install
```
</code>
Modulefile:
<code tcl>
```
#%Module -*- tcl -*-
##
## modulefile
......@@ -63,17 +63,17 @@ module-whatis "URL: http://singularity.lbl.gov/about"
module-whatis "Description: Singularity is a container platform focused on supporting Mobility of Compute. Mobility of Compute encapsulates the development to compute model where developers can work in an environment of their choosing and creation and when the developer needs additional compute resources, this environment can easily be copied and executed on other platforms. Additionally as the primary use case for Singularity is targeted towards computational portability, many of the barriers to entry of other container solutions do not apply to Singularity making it an ideal solution for users (both computational and non-computational) and HPC centers."
prepend-path PATH /cm/shared/apps/singularity/2.4.2-utsw-2018010/bin
</code>
```
==== Setting system-wide options ====
### Setting system-wide options
Singularity system-wide options are configured in ''%%/cm/shared/apps/singularity/2.4.2-utsw-2018010/etc/singularity/singularity.conf%%''
Singularity system-wide options are configured in `/cm/shared/apps/singularity/2.4.2-utsw-2018010/etc/singularity/singularity.conf`
We run with the following changes to this file:
Set bind points for the cluster project, work, archive so they are always available when a user runs a container
<code>
```
# BIND PATH: [STRING]
# DEFAULT: Undefined
# Define a list of files/directories that should be made available from within
......@@ -88,17 +88,17 @@ bind path = /etc/hosts
bind path = /project
bind path = /work
bind path = /archive
```
</code>
Use PR1124 to inject the bind points above, plus $HOME into docker containers so they work on RHEL6.9 without overlayfs
<code>
```
# DOCKER INJECT BINDS: [BOOL]
# DEFAULT: no
# If set, inject the home directory and all bind paths into any docker
# container that is pulled. This allows binds to work on systems where overlay
# is not available, and the bind paths are not present in the docker container.
docker inject binds = yes
```
</code>
Other options are explained well in the configuration file.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment