diff --git a/_data/htc-guide-menu.yml b/_data/htc-guide-menu.yml
index b48c06ac..90d0275b 100644
--- a/_data/htc-guide-menu.yml
+++ b/_data/htc-guide-menu.yml
@@ -85,56 +85,55 @@
- text: "Overview"
url: "/uw-research-computing/software-overview-htc"
icon: ""
- - text: "Quickstart"
- url: "/uw-research-computing/software-overview-htc#quickstart"
- icon: ""
- text: "Containers "
icon: ""
links:
- - text: "Build a software environment with containers "
+ - text: "What are containers?"
+ url: "/uw-research-computing/software-overview-htc#container-overview"
+ icon: ""
+ - text: "Using software in Apptainer containers"
icon: ""
links:
- - text: "What are containers?"
- url: "/uw-research-computing/software-overview-htc#containers"
+ - text: "Use Apptainer containers"
+ url: "/uw-research-computing/apptainer-htc"
icon: ""
- - text: "Apptainer/Singularity"
+ - text: "More about Apptainer containers"
url: "/uw-research-computing/apptainer-build"
- icon: ""
+ icon: "bi bi-book"
links:
- text: "Practice: Build a container"
url: "/uw-research-computing/apptainer-htc-advanced-example"
icon: "bi bi-clipboard-check"
- - text: "Docker"
- url: "/uw-research-computing/docker-build"
+ - text: "Convert Docker images to Apptainer/Singularity images"
+ url: "/uw-research-computing/htc-docker-to-apptainer"
icon: ""
- links:
- - text: "Explore and test Docker containers"
- url: "/uw-research-computing/docker-test"
- icon: ""
- - text: "Recipes repository"
- url: "https://github.com/CHTC/recipes/tree/main/software"
- icon: ""
- - text: "Convert Docker images to Apptainer/Singularity images"
- url: "/uw-research-computing/htc-docker-to-apptainer"
+ - text: "Using software in Docker containers"
+ icon: ""
+ links:
+ - text: "Use Docker containers"
+ url: "/uw-research-computing/docker-jobs"
+ icon: ""
+ - text: "More about Docker containers"
+ url: "/uw-research-computing/docker-build"
+ icon: "bi bi-book"
+ - text: "Reference: Explore and test Docker containers"
+ url: "/uw-research-computing/docker-test"
+ icon: "bi bi-book"
+ - text: "Recipes repository"
+ url: "https://github.com/CHTC/recipes/tree/main/software"
+ icon: ""
+ - text: "Other Modes of Software Use"
+ icon: ""
+ links:
+ - text: "Compile software in an interactive job"
+ url: "/uw-research-computing/inter-submit"
icon: ""
- - text: "Use Apptainer containers"
- url: "/uw-research-computing/apptainer-htc"
+ - text: "Licensed software and modules"
+ url: "/uw-research-computing/licensed-software"
icon: ""
- - text: "Use Docker containers"
- url: "/uw-research-computing/docker-jobs"
+ - text: "Use software available in modules"
+ url: "/uw-research-computing/htc-modules"
icon: ""
- - text: "Compile software in an interactive job"
- url: "/uw-research-computing/inter-submit"
- icon: ""
- - text: "Licensed software and modules"
- url: "/uw-research-computing/licensed-software"
- icon: ""
- - text: "Use software available in modules"
- url: "/uw-research-computing/htc-modules"
- icon: ""
- - text: "HTC modules transition to EL9"
- url: "/uw-research-computing/htc-modules-transition-to-el9"
- icon: ""
- text: "Workflows"
icon: "bi bi-diagram-2"
diff --git a/_uw-research-computing/alphafold.md b/_uw-research-computing/alphafold.md
new file mode 100644
index 00000000..4309b542
--- /dev/null
+++ b/_uw-research-computing/alphafold.md
@@ -0,0 +1,139 @@
+---
+highlighter: none
+layout: markdown-page
+title: Using Alphafold on CHTC's HTC System
+---
+
+
+Second -- to access the database:
+You should be able to submit jobs and use this option in the submit file:
+ requirements = (HasGpulabData == true)
+And when the job starts, you can access the database at:
+ /gpulab_data/alphafold
+
+Software that is packaged in a \"container\" can
+be run on the HPC cluster. This guide assumes that you are starting with
+an existing Docker container and shows how to use it to run a job on the HPC cluster.
+
+Note that you may need to install a version of MPI to your container
+when it is initially created. See the [notes](#notes) about this below.
+
+The two steps to run a container on the HPC cluster:
+1. [Convert the container to a Singularity image file](#image)
+2. [Run a job that uses the container](#command)
+
+
+Notes about MPI and Containers
+==================
+
+There are two ways to run a Singularity container integrated with MPI: `hybrid`
+mode and `bind` mode.
+
+In `hybrid` mode, the container has its own copy of MPI **that is compatible
+with a version of MPI already installed on the cluster**.
+
+In `bind` mode, the code in the container has been compiled with MPI that
+exists outside the container and there is no MPI installation in the container itself.
+Again, **the version of MPI used needs to be compatible with one already installed
+on the cluster.**
+
+This will be relevant in how the job is executed later on: [Using Singularity Container Images](#command)
+
+
+
+**1. Convert Container to Singularity Format**
+===================
+
+We assume that there is a Docker container (either found
+or created by you) online that you want to use. To use this container
+on the HPC cluster, it needs to be converted to a Singularity-format
+image file. To do this:
+
+1. Log in to one of the HPC cluster log in nodes.
+1. Start an interactive job:
+ ```
+ [alice@login]$ srun -n4 -N1 -p int --pty bash
+ ```
+
+1. Once the interactive job starts, you'll need to unset a shell environment
+variable that prevents download of the Docker container.
+ ```
+ [alice@int]$ unset HTTPS_PROXY
+ ```
+
+1. Then, save the Docker container to a Singularity image.
+ ```
+ [alice@int]$ singularity build /software/alice/name.simg docker://user/image:version
+ ```
+ {:.term}
+
+ For example, if user \"Alice\" wanted to use the [\"Fenics\" container
+ provided on DockerHub](https://hub.docker.com/r/fenicsproject/stable),
+ and save it to a file named `fenics.simg`, she would run:
+
+ ```
+ [alice@int]$ singularity build /software/alice/fenics.simg docker://fenicsproject/stable:latest
+ ```
+ {:.term}
+
+ > This command will by default, pull the initial Docker container from
+ > Docker Hub. If your Docker container is stored elsewhere, or you are
+ > starting with a Singularity image, contact CHTC staff for specific instructions.
+
+1. Once the Singularity command completes, type `exit` to leave the interactive job.
+
+
+
+**2. Using Singularity Container Images**
+===================
+
+To use a Singularity container in a job, the SLURM submit file will remain mostly the
+same; what will change is the job's primary command at the end of the
+file. This command will run your primary program inside the container
+file you\'ve downloaded. The main MPI command will still be part of the
+singularity command:
+
+``` {.sub}
+#!/bin/sh
+#SBATCH options
+
+module load MPI/version
+mpirun -np ## singularity exec /path/to/container/file command-to-run
+```
+
+For example, if Alice wanted to run a script she had written
+(`poisson.py`) inside the downloaded fenics container, using 40 cores, she would use the
+following command at the end of her submit file:
+
+``` {.sub}
+mpirun -np 40 singularity exec /software/alice/fenics.simg ./poisson.py
+```
+
+The example shown above uses the "hybrid" model for running MPI, which assumes
+that there is a copy of MPI installed **in the container** that matches what already
+exists on the cluster.
+
+If your container does **not** have it's own copy of MPI installed, you need
+to use the "bind" model for running MPI which requires an additional flag and
+the location of the main MPI directory:
+
+
+``` {.sub}
+#!/bin/sh
+#SBATCH options
+
+module load MPI/version
+mpirun -np ## singularity exec --bind /path/to/cluster/MPI/dir/ /path/to/container/file command-to-run
+```
+
+On CHTC's cluster, the GCC based version of OpenMPI is installed at the path:
+` /software/chtc/easybuild/v2/software/OpenMPI/4.0.5-GCC-9.3.0/`
+So the command(s) to run the "Alice" example above would be:
+
+``` {.sub}
+MPI_DIR=/software/chtc/easybuild/v2/software/OpenMPI/4.0.5-GCC-9.3.0/
+mpirun -np 40 singularity exec --bind $MPI_DIR /software/alice/fenics.simg ./poisson.py
+```
+
+More details on the difference between using the "hybrid" and "bind" model
+for MPI and Singularity is here: https://sylabs.io/guides/3.8/user-guide/mpi.html
diff --git a/_uw-research-computing/apptainer-build.md b/_uw-research-computing/apptainer-build.md
index bd41b78d..9ddeb0e2 100644
--- a/_uw-research-computing/apptainer-build.md
+++ b/_uw-research-computing/apptainer-build.md
@@ -10,30 +10,15 @@ guide:
---
This guide describes the general process for creating an Apptainer container.
-Specifically, we discuss the components of the "definition file" and how that file is used to construct or "build" the container itself.
+Specifically, we discuss the components of the "definition file" and how that file is used to construct or "build" the container itself. For a more step-by-step description of
+how to build a container, see [Use Custom Software in Jobs Using Apptainer](apptainer-htc.html).
-For instructions on using and building Apptainer containers
-
-* on the High Throughput system: [Using Apptainer Containers](apptainer-htc.html).
-* on the High Performance system: [Using Apptainer Containers on HPC](apptainer-hpc.html).
{% capture content %}
-[The Apptainer Definition File](#the-apptainer-definition-file)
-
-* [Header section](#header-section)
-* [Files section](#files-section)
-* [Post section](#post-section)
-* [Environment section](#environment-section)
-* [Labels section](#labels-section)
-* [Help section](#help-section)
-
-[The Apptainer Container Image](#the-apptainer-container-image)
-
-* [Building the container](#building-the-container)
-* [Converting a Docker image to an Apptainer container image](#converting-a-docker-image-to-an-apptainer-container-image)
-* [Testing the container interactively](#testing-the-container-interactively)
-
-[Special Considerations for Building Your Container](#special-considerations-for-building-your-container)
+* [The Apptainer definition file](#the-apptainer-definition-file)
+* [Creating a definition file](#creating-a-definition-file)
+* [The Apptainer container image](#the-apptainer-container-image)
+* [Special considerations for building your container](#special-considerations-for-building-your-container)
{% endcapture %}
{% include /components/directory.html title="Table of Contents" %}
@@ -236,7 +221,38 @@ For example,
For an existing container, you can inspect the help text with the command `apptainer run-help my-container.sif`.
-## The Apptainer Container Image
+## Creating a definition file
+
+Here is general process for creating your own definition file for building your custom container:
+
+1. **Consult your software's documentation**
+
+ Determine the requirements for installing the software you want to use.
+ In particular you are looking for (a) the operating systems it is compatible with and (b) the prerequisite libraries or packages.
+
+2. **Choose a base container**
+
+ The base container should at minimum use an operating system compatible with your software.
+ Ideally the container you choose also has many of the prerequisite libraries/programs already installed.
+
+3. **Customize your definition file**
+
+ In addition to examples in this guide, see our [Advanced Apptainer Example - SUMO](apptainer-htc-advanced-example.html) guide for an example of how to customize
+ a definition file for your software.
+
+Remember that the `.def` file contains the *instructions* for creating your container and is not itself the container.
+To use the software defined within the `.def` file, you will need to first "build" the container and create the `.sif` file, as described in the following sections.
+
+> ### 📝 Reference: CHTC's "Recipes" Repository
+{:.tip-header}
+
+> To see multiple examples of Apptainer definition files for different
+> softwares, check out the software section of CHTC's "recipes" repository:
+> * [CHTC software recipes](https://github.com/CHTC/recipes/tree/main/software)
+{:.tip}
+
+
+## The Apptainer container image
The actual container image, which can be executed by Apptainer as a stand-alone operating system, is stored in a `.sif` file.\*
The instructions for constructing the `.sif` file are provided by the `.def` definition file, as described above.
@@ -367,3 +383,12 @@ Usage: units [options] ['from-unit' 'to-unit']
{:.term}
If this does not address the issue, examine the error messages and consult the program documentation for how configure the program to use an alternate location for cache or temporary directories.
+
+
+## Related Pages
+
+* [Advanced Apptainer Example - SUMO](apptainer-htc-advanced-example.html)
+* [Convert Docker Images to Apptainer Images](htc-docker-to-apptainer.html)
+* [Use Custom Software in Jobs Using Apptainer](apptainer-htc.html)
+* [Using Apptainer Containers on HPC](apptainer-hpc.html)
+
diff --git a/_uw-research-computing/apptainer-htc.md b/_uw-research-computing/apptainer-htc.md
index baed8da9..2e227b40 100644
--- a/_uw-research-computing/apptainer-htc.md
+++ b/_uw-research-computing/apptainer-htc.md
@@ -1,296 +1,255 @@
---
highlighter: none
layout: guide
-title: Use Apptainer Containers
+title: Use Custom Software in Jobs Using Apptainer
guide:
category: Software
tag:
- htc
---
-## Introduction
+Linux containers are a way to build a self-contained environment that
+includes software, libraries, and other tools. This guide shows how to
+submit jobs that use Apptainer containers.
-HTCondor supports the use of Apptainer (formerly known as Singularity) environments for jobs on the High Throughput Computing system.
+## Introduction
-Similar to Docker containers, Apptainer environments allow users to prepare portable software and computing environments that can be sent to many jobs.
-This means your jobs will run in a more consistent environment that is easily reproducible by others.
+HTCondor supports the use of Apptainer (formerly known as Singularity) container environments for jobs on the High Throughput Computing system.
Container jobs are able to take advantage of more of CHTC's High Throughput resources because the operating system where the job is running does not need to match the operating system where the container was built.
{% capture content %}
-
-[Quickstart](#quickstart)
-
-* [Use an existing container](#use-an-existing-container)
-* [Build your own container](#build-your-own-container)
-
-[Create a Definition File](#create-a-definition-file)
-
-[Start an Interactive Build Job](#start-an-interactive-build-job)
-
-[Build Your Container](#build-your-container)
-
-[Test Your Container](#test-your-container)
-
-[Move the Container .sif File to Staging](#move-the-container-sif-file-to-staging)
-
-[Use an Apptainer Container in HTC Jobs](#use-an-apptainer-container-in-htc-jobs)
-
+* [Introduction](#introduction)
+* [Start Here](#start-here)
+* [Use an Apptainer Container in HTC Jobs](#use-an-apptainer-container-in-htc-jobs)
+* [Build your own apptainer container](#build-your-own-apptainer-container)
+ * [Create a Definition File](#create-a-definition-file)
+ * [Start an Interactive Build Job](#start-an-interactive-build-job)
+ * [Build Your Container](#build-your-container)
+ * [Test Your Container](#test-your-container)
+ * [Move the Container .sif File to Staging](#move-the-container-sif-file-to-staging)
+* [Suggestions for testing](#suggestions-for-testing)
+* [More details about HTCondor and Apptainer](#more-details-about-htcondor-and-apptainer)
+* [Related pages](#related-pages)
{% endcapture %}
{% include /components/directory.html title="Table of Contents" %}
-## Quickstart
+## Start Here
-### Use an existing container
+To run a job using an Apptainer container, you will need access to an Apptainer
+image file, usually with the suffix `.sif`.
-If you or a group member have already created the Apptainer `.sif` file, or are using a container from reputable sources such as the [OSG](https://portal.osg-htc.org/documentation/htc_workloads/using_software/available-containers-list/), follow these steps to use it in an HTCondor job.
+**If you have an existing `.sif` file**, go straight to [Use an Apptainer Container in HTC Jobs](#use-an-apptainer-container-in-htc-jobs).
-#### 1. Add the container `.sif` file to your submit file
+**If you do not have an existing `.sif` container**, you can create one in two ways:
+- _If you have no container to start from:_ [Build your own Apptainer container](#build-your-own-apptainer-container)
+- _If you have an existing Docker container image_: [Convert Docker Images to Apptainer Images](htc-docker-to-apptainer.html)
-If the `.sif` file is **in a `/home` directory**:
+Once you have created the `.sif` file by using one of the above methods
+ready, circle back to [Use an Apptainer Container in HTC Jobs](#use-an-apptainer-container-in-htc-jobs).
-```
-container_image = path/to/my-container.sif
-```
+For more details about using Apptainer, see [Suggestions for testing](#suggestions-for-testing) and [More details about HTCondor and Apptainer](#more-details-about-htcondor-and-apptainer).
-If the `.sif` file is **in a `/staging` directory**:
+## Use an Apptainer Container in HTC Jobs
-```
-container_image = file:///staging/path/to/my-container.sif
-```
+If you or a group member have already created the Apptainer `.sif` file, or are using a container from reputable sources such as the [OSG](https://portal.osg-htc.org/documentation/htc_workloads/using_software/available-containers-list/), add one of these options to your HTCondor submit file
+to add it to your HTC job:
+
+* **Option 1: If the `.sif` file is in a `/home` directory**:
+
+ ```
+ container_image = path/to/my-container.sif
+ ```
+* **Option 2: If the `.sif` file is in a `/staging` directory**:
+
+ ```
+ container_image = file:///staging/path/to/my-container.sif
+ ```
+
+* **Option 3: If the `.sif` file is in a `/staging` directory AND you are using `want_campus_pools` or `want_ospool`**:
+
+ ```
+ container_image = osdf:///chtc/staging/path/to/my-container.sif
+ ```
-If the `.sif` file is **in a `/staging` directory AND you are using `want_campus_pools` or `want_ospool`**:
+The full submit file otherwise looks like normal, for example:
```
-container_image = osdf:///chtc/staging/path/to/my-container.sif
-```
-
-[Jump to more information](#use-an-apptainer-container-in-htc-jobs)
-
-#### 2. Test your container job
+# apptainer.sub
-As always with the High Throughput system, submit a single test job and confirm that your job behaves as expected.
-If there are issues with the job, you may need to modify your executable, or even (re)build your own container.
+# Provide HTCondor with the name of your .sif file
+container_image = file:///staging/path/to/my-container.sif
-### Build your own container
+executable = myExecutable.sh
-If you need to create your own container for the software you want to use, follow these steps.
-For more information on any particular step, jump to the corresponding section later in this guide.
+# Include other files that need to be transferred here.
+# transfer_input_files = other_job_files
-
+log = job.log
+error = job.err
+output = job.out
-#### 1. Create a definition file
+requirements = (HasCHTCStaging == true)
-The definition (`.def`) file contains the instructions for what software to install while building the container.
-CHTC provides example definition files in the `software` folder of our [Recipes GitHub repository](https://github.com/CHTC/recipes). Choose from one of the existing examples, or create your own using the instructions later in this guide.
+# Make sure you request enough disk for the container image in addition to your other input files
+request_cpus = 1
+request_memory = 4GB
+request_disk = 10GB
-[Jump to more information](#create-a-definition-file)
+queue
+```
-#### 2. Start an interactive build job
+More details about how HTCondor integrates with Apptainer are in [More details about HTCondor and Apptainer](#more-details-about-htcondor-and-apptainer).
-Start an interactive build job ([an example submit file `build.sub` is provided below](#build-submit-file)).
-Be sure to include your `.def` file in the `transfer_input_files` line, or else create the file once the interactive job starts using a command line editor.
+## Build your own Apptainer container
-Then submit the interactive build job with
+If you need to build your own Apptainer container (`.sif` file), the
+process looks like this:
-```
-condor_submit -i build.sub
-```
-{:.term}
+TBD: graphic
-[Jump to more information](#start-an-interactive-build-job)
+1. **Create a definition file.** The definition file describes a starting software environment in the first two lines and then what to add to it.
+1. **Start an interactive job for building.** We require that you build containers while in an interactive build job.
+1. **Build the container.** To build a container, Apptainer uses the instructions in the `.def` file to create a `.sif` file. The `.sif` file is the compressed collection of all the files that comprise the container.
+1. **(Optional): Test the container.** Once the image (`.sif` file) is created, it is important to test it to make sure you have all software, packages, and libraries installed correctly.
+1. **Move the container to a persistent location.** We recommend placing the image file into your `/staging` folder
-#### 3. Build your container
+### Create a definition file
-While in an interactive build job, run the command
+To create your own container using Apptainer, you will need to create a definition (`.def`) file. CHTC provides example definition files in the `software` folder of our [Recipes GitHub repository](https://github.com/CHTC/recipes/tree/main/software).
-```
-apptainer build my-container.sif image.def
-```
-{:.term}
+
-If the container build finishes successfully, then the container image (`.sif`) file is created.
-This file is used for actually executing the container.
+We strongly recommend that you use one of the existing examples as the starting point for creating your own container.
-[Jump to more information](#build-your-container)
+For the purposes of this guide, we will call
+the definition file `image.def`.
-#### 4. Test your container
+> ### 📖 Learn More About Definition Files
+{:.tip-header}
-While still in the interactive build job, run the command
+> For more details about the definition file see:
+> [The Apptainer Definition File](apptainer-build.html#the-apptainer-definition-file)
+{:.tip}
-```
-apptainer shell -e my-container.sif
-```
-{:.term}
+### Start an interactive build job
-This command will start the container and log you into it, allowing you to test your software commands.
+Building a container can be a computationally intense process, so
+we require that you build containers while in an interactive build job.
-Once you are done testing the container, enter
+On the High Throughput system, you can run the following commands to start an
+interactive job that includes your definition file:
```
-exit
+chtc-submit-apptainer-build -build image.def
+condor_submit -i apptainer-build.sub
```
{:.term}
-**once** to exit the container.
+Note that this submit file assumes you have a definition file named `image.def` in the same directory as the submit file.
-[Jump to more information](#test-your-container)
+### Build your container
-#### 5. Move the container .sif file to staging
+Once the interactive build job starts, confirm that your `image.def` was transferred to the current directory, by running the `ls` command.
-Once you are satisfied that your container is built correctly, copy your `.sif` file to your staging directory.
+To build your container, run this command:
```
-mv my-container.sif /staging/$USER
+apptainer build my-container.sif image.def
```
{:.term}
-Once the file has transferred, exit the interactive job with
+Feel free to rename the `.sif` file as you desire; for the purposes of this guide we are using `my-container.sif`.
+
+As the command runs, a variety of information will be printed to the terminal regarding the container build process.
+Unless something goes wrong, this information can be safely ignored.
+Once the command has finished running, you should see `INFO: Build complete: my-container.sif`.
+Using the `ls` command, you should now see the container file `my-container.sif`.
```
-exit
+ls
```
{:.term}
-[Jump to more information]()
-
-Once you've built the container, use the instructions [above](#use-an-existing-container) to use the container in your HTCondor job.
-
-## Create a Definition File
-
-To create your own container using Apptainer, you will need to create a definition (`.def`) file.
-For the purposes of this guide, we will call the definition file `image.def`.
-
-CHTC provides example definition files in the `software` folder of our [Recipes GitHub repository](https://github.com/CHTC/recipes). We strongly recommend that you use one of the existing examples as the starting point for creating your own container.
-
-If the software you want to use is not in the CHTC Recipes repository, you can create your own container. Here is general process for creating your own definition file for building your custom container:
-
-1. **Consult your software's documentation**
-
- Determine the requirements for installing the software you want to use.
- In particular you are looking for (a) the operating systems it is compatible with and (b) the prerequisite libraries or packages.
-
-2. **Choose a base container**
-
- The base container should at minimum use an operating system compatible with your software.
- Ideally the container you choose also has many of the prerequisite libraries/programs already installed.
-
-3. **Create your own definition file**
-
- The definition file contains the installation commands needed to set up your software.
- We encourage you to read our [Building an Apptainer Container](apptainer-build.html) guide to learn more about the components of the Apptainer definition file.
- An advanced example of a definition file is provided in our [Advanced Apptainer Example - SUMO](apptainer-htc-advanced-example.html) guide.
-
-### A simple definition file
-
-As a simple example, here is the `.def` file that uses an existing container with python installed inside (`python:3.11`, [from DockerHub](https://hub.docker.com/_/python)),
-and furthermore installs the desired packages `cowsay` and `tqdm`:
-
-```
-Bootstrap: docker
-From: python:3.11
+> ### Troubleshooting Tip: Killed Jobs
+{:.tip-header}
+>
+> Apptainer `.sif` files can be fairly large, especially if you have a complex software stack.
+> If your interactive job abruptly fails during the build step, you may need to increase the value of `request_disk` in the submit file generated by `chtc-submit-apptainer-build`
+> In this case, the `.log` file should have a message about the reason the interactive job was interrupted.
+{:.tip}
-%post
- python3 -m pip install cowsay tqdm
-```
+> ### Troubleshooting Tip: Error Messages
+{:.tip-header}
+>
+> If the build command fails, examine the output for error messages that may explain why the build was unsuccessful.
+Typically there is an issue with a package installation, such as a typo or a missing but required dependency.
+Sometimes there will be an error during an earlier package installation that doesn't immediately cause the container build to fail.
+But, when you test the container, you may notice an issue with the package.
+>
+> If you are having trouble finding the error message, edit the definition file and remove (or comment out) the installation commands that come after the package in question.
+Then rebuild the image, and now the relevant error messages should be near the end of the build output.
+{:.tip}
-Remember that the `.def` file contains the *instructions* for creating your container and is not itself the container.
-To use the software defined within the `.def` file, you will need to first "build" the container and create the `.sif` file, as described in the following sections.
+For more information on building Apptainer containers, see our [Building an Apptainer Container](apptainer-build.html) guide.
-[Jump back to Quickstart](#quickstart-build-definition-file)
+### Test your container
-## Start an Interactive Build Job
+Once your container builds successfully, we highly encourage you to immediately test the container while still in the interactive build session.
-Building a container can be a computationally intense process.
-As such, we require that you only build containers while in an interactive build job.
-On the High Throughput system, you can use the following submit file `build.sub`:
+To test your container, use the command
-
```
-# build.sub
-# For building an Apptainer container
-
-universe = vanilla
-log = build.log
-
-# If you have additional files in your /home directory that are required for your container, add them to the transfer_input_files line as a comma-separated list.
-transfer_input_files = image.def
-
-requirements = (HasCHTCStaging == true)
-
-+IsBuildJob = true
-request_cpus = 4
-request_memory = 16GB
-request_disk = 16GB
-
-queue
+apptainer shell -e my-container.sif
```
+{:.term}
-Note that this submit file assumes you have a definition file named `image.def` in the same directory as the submit file.
+You should see your command prompt change to `Apptainer>`.
-Once you've created the submit file, you can submit an interactive job with the command
+When you are finished running commands inside the container, run the command `exit` to exit the container.
```
-condor_submit -i build.sub
+exit
```
{:.term}
-> Apptainer `.sif` files can be fairly large, especially if you have a complex software stack.
-> If your interactive job abruptly fails during the build step, you may need to increase the value of `request_disk` in your submit file.
-> In this case, the `.log` file should have a message about the reason the interactive job was interrupted.
-
-[Jump back to Quickstart](#quickstart-build-interactive)
-
-## Build Your Container
+Your prompt should change back to something like `[username@build4000 ~]$`.
-Once the interactive build job starts, confirm that your `image.def` was transferred to the current directory.
+For more details about testing, see [Suggestions for testing](#suggestions-for-testing).
-To build a container, Apptainer uses the instructions in the `.def` file to create a `.sif` file. The `.sif` file is the compressed collection of all the files that comprise the container.
+### Move the container .sif file to staging
-To build your container, run this command:
+Since Apptainer `.sif` files are routinely more than 1GB in size, we recommend that you transfer `my-container.sif` to your `/staging` directory.
+It is usually easiest to move the container file directly to staging while still in the interactive build job:
```
-apptainer build my-container.sif image.def
+mv my-container.sif /staging/$USER
```
{:.term}
-Feel free to rename the `.sif` file as you desire; for the purposes of this guide we are using `my-container.sif`.
-
-As the command runs, a variety of information will be printed to the terminal regarding the container build process.
-Unless something goes wrong, this information can be safely ignored.
-Once the command has finished running, you should see `INFO: Build complete: my-container.sif`.
-Using the `ls` command, you should now see the container file `my-container.sif`.
-
-If the build command fails, examine the output for error messages that may explain why the build was unsuccessful.
-Typically there is an issue with a package installation, such as a typo or a missing but required dependency.
-Sometimes there will be an error during an earlier package installation that doesn't immediately cause the container build to fail.
-But, when you test the container, you may notice an issue with the package.
-
-If you are having trouble finding the error message, edit the definition file and remove (or comment out) the installation commands that come after the package in question.
-Then rebuild the image, and now the relevant error messages should be near the end of the build output.
-
-Once the image is built, it is important to test it to make sure you have all software, packages, and libraries installed correctly.
-
-For more information on building Apptainer containers, see our [Building an Apptainer Container](apptainer-build.html) guide.
+If you do not have a `/staging` directory, you can skip this step and the `.sif` file will be automatically transferred back to the login server when you exit the interactive job.
-[Jump back to Quickstart](#quickstart-build-build)
+We encourage you to request a `/staging` directory, especially if you plan on running many jobs using this container.
+See our [Managing Large Data in Jobs](file-avail-largedata.html) guide for more information on using staging.
-## Test Your Container
+At this point, you can use the container in jobs, as described [above](#use-an-apptainer-container-in-htc-jobs).
-Once your container builds successfully, we highly encourage you to immediately test the container while still in the interactive build session.
+## Suggestions for testing
-To test your container, use the command
+As always with the High Throughput system, we recommend submitting a single test
+job and confirming that your job behaves as expected.
+If there are issues with the job, you may need to modify your executable, or even (re)build your own container.
+In an interactive job, run:
```
apptainer shell -e my-container.sif
```
{:.term}
-You should see your command prompt change to `Apptainer>`.
-
The `shell` command logs you into a terminal "inside" the container, with access to the libraries, packages, and programs that were installed in the container following the instructions in your `image.def` file.
(The `-e` option is used to prevent this terminal from trying to use the host system's programs.)
@@ -309,33 +268,41 @@ export PATH=/opt/my-program/bin:$PATH
Consult the "Special Considerations" section of our [Building an Apptainer Container](apptainer-build.html#special-considerations-for-building-your-container) guide for additional information on setting up and testing your container.
-When you are finished running commands inside the container, run the command `exit` to exit the container.
-Your prompt should change back to something like `[username@build4000 ~]$`.
+Also see the section [below](#more-details-about-htcondor-and-apptainer) for how to fully emulate the behavior of an
+HTCondor job interactively.
-[Jump back to Quickstart](#quickstart-build-test)
+## More details about HTCondor and Apptainer
-## Move the Container .sif File to Staging
+From the user's perspective, a container job is practically identical to a regular job.
+The main difference is that instead of running on the execute point's default operation system, the job is run inside the container.
-Since Apptainer `.sif` files are routinely more than 1GB in size, we recommend that you transfer `my-container.sif` to your `/staging` directory.
-It is usually easiest to move the container file directly to staging while still in the interactive build job:
+When you submit a job to HTCondor using a submit file with `container_image` set, HTCondor automatically handles the process of obtaining and running the container. You do not need to include any `apptainer` commands in your `executable` file. The process looks roughly like
+
+- Claim machine that satisifies submit file requirements
+- Pull (or transfer) the container image
+- Transfer input files, executable to working directory
+- Run the executable script inside the container, as the submit user, with key directories mounted inside (such as the working directory, /staging directories, etc.)
+- Transfer output files back to the submit server
+
+For testing purposes, you can replicate the behavior of a container job with the following command.
+First, start an interactive job.
+Then run this command but change `my-container.sif` and `myExecutable.sh` to the names of the `.sif` and `.sh` files that you are using:
```
-mv my-container.sif /staging/$USER
+apptainer exec \
+ --scratch /tmp \
+ --scratch /var/tmp \
+ --workdir $(pwd) \
+ --pwd $(pwd) \
+ --bind $(pwd) \
+ --no-home \
+ --containall \
+ my-container.sif \
+ /bin/bash myExecutable.sh 1> job.out 2> job.err
```
{:.term}
-If you do not have a `/staging` directory, you can skip this step and the `.sif` file will be automatically transferred back to the login server when you exit the interactive job.
-We encourage you to request a `/staging` directory, especially if you plan on running many jobs using this container.
-See our [Managing Large Data in Jobs](file-avail-largedata.html) guide for more information on using staging.
-
-[Jump back to Quickstart](#quickstart-build-move)
-
-## Use an Apptainer Container in HTC Jobs
-
-Now that you have the container image saved in the form of the `.sif` file, you can use it as the environment for running your HTCondor jobs.
-In your submit file, specify the image file using the `container_image` command.
-HTCondor will automatically transfer the `.sif` file and automatically execute your `executable` file inside of the container; you do not need to include any `apptainer` commands in your `executable` file.
-
+The container image can be placed in multiple locations in CHTC and still used in the job.
If the `.sif` file is located on the login server, you can use
```
@@ -350,41 +317,7 @@ Therefore, we recommend using
container_image = file:///staging/path/to/my-container.sif
```
-The full submit file otherwise looks like normal, for example:
-
-```
-# apptainer.sub
-
-# Provide HTCondor with the name of your .sif file and universe information
-container_image = file:///staging/path/to/my-container.sif
-
-executable = myExecutable.sh
-
-# Include other files that need to be transferred here.
-# transfer_input_files = other_job_files
-
-log = job.log
-error = job.err
-output = job.out
-
-requirements = (HasCHTCStaging == true)
-
-# Make sure you request enough disk for the container image in addition to your other input files
-request_cpus = 1
-request_memory = 4GB
-request_disk = 10GB
-
-queue
-```
-
-Then use `condor_submit` with the name of your submit file:
-
-```
-condor_submit apptainer.sub
-```
-{:.term}
-
-If you are using `want_campus_pools` or `want_ospool` as described in our [Scale Beyond Local HTC Capacity](scale-htc.html) guide, then you should instead use
+If you are using `want_campus_pools` or `want_ospool` as described in our [Scale Beyond Local HTC Capacity](scale-htc.html) guide, then you should instead use:
```
container_image = osdf:///chtc/staging/path/to/my-container.sif
@@ -392,36 +325,11 @@ container_image = osdf:///chtc/staging/path/to/my-container.sif
to enable transferring of the `.sif` file via the [OSDF](https://osg-htc.org/services/osdf.html) to compute capacity beyond CHTC.
-[Jump back to Quickstart](#quickstart-use-submit)
-
-> From the user's perspective, a container job is practically identical to a regular job.
-> The main difference is that instead of running on the execute point's default operation system, the job is run inside the container.
->
-> When you submit a job to HTCondor using a submit file with `container_image` set, HTCondor automatically handles the process of obtaining and running the container.
-> The process looks roughly like
->
-> - Claim machine that satisifies submit file requirements
-> - Pull (or transfer) the container image
-> - Transfer input files, executable to working directory
-> - Run the executable script inside the container, as the submit user, with key directories mounted inside (such as the working directory, /staging directories, etc.)
-> - Transfer output files back to the submit server
->
-> For testing purposes, you can replicate the behavior of a container job with the following command.
-> First, start an interactive job.
-> Then run this command but change `my-container.sif` and `myExecutable.sh` to the names of the `.sif` and `.sh` files that you are using:
->
-> ```
-> apptainer exec \
-> --scratch /tmp \
-> --scratch /var/tmp \
-> --workdir $(pwd) \
-> --pwd $(pwd) \
-> --bind $(pwd) \
-> --no-home \
-> --containall \
-> my-container.sif \
-> /bin/bash myExecutable.sh 1> job.out 2> job.err
-> ```
-> {:.term}
->
+## Related Pages
+- [Building an Apptainer Container](apptainer-build)
+- [Convert Docker Images to Apptainer Images](htc-docker-to-apptainer.html)
+- [Advanced Apptainer Example - SUMO](apptainer-htc-advanced-example)
+- [Using Apptainer Containers on HPC](apptainer-hpc.html)
+- [Use Custom Software in Jobs Using Docker](docker-jobs)
+- [Overview: How to Use Software](software-overview-htc)
diff --git a/_uw-research-computing/conda-installation.md b/_uw-research-computing/conda-installation.md
index 148fa53b..578ae77b 100644
--- a/_uw-research-computing/conda-installation.md
+++ b/_uw-research-computing/conda-installation.md
@@ -14,19 +14,22 @@ published: true
## Quickstart: Conda
-### Option A (recommended)
+### Option A - Container (recommended)
-Build a container with Conda packages installed inside:
+Build a container with Conda packages installed inside. Start by reviewing
+the container build instructions for either Apptainer or Docker. Then, when
+following the build instructions, use the example recipes for either a
+`.def` or `Dockerfile`, respectively.
-1. [How to build your own container](software-overview-htc.html#build-your-own-container)
-2. [Example container recipes for Conda](https://github.com/CHTC/recipes/tree/main/software/Conda)
-3. [Use your container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
+1. How to build your own container: [Apptainer](apptainer-htc#use-an-apptainer-container-in-htc-jobs) / [Docker](docker-build)
+2. Tips and tricks, container recipes: [Example container recipes for Conda](https://github.com/CHTC/recipes/tree/main/software/Conda)
+3. Use your container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
-### Option B
+
-Create your own portable copy of your Conda packages:
+### Option B - "Packed" Conda Env
-1. Follow the instructions in [our guide](conda-installation.html#option-b-create-your-own-portable-copy)
+Create your own portable copy of your Conda packages:
> This approach may be sensitive to the operating system of the execution point.
> We recommend building a container instead, but are keeping these instructions as a backup.
diff --git a/_uw-research-computing/docker-build.md b/_uw-research-computing/docker-build.md
index 2563c50a..016aa80f 100644
--- a/_uw-research-computing/docker-build.md
+++ b/_uw-research-computing/docker-build.md
@@ -7,14 +7,20 @@ guide:
- htc
---
-Linux containers are a way to build a self-contained environment that
-includes software, libraries, and other tools. CHTC currently supports
-running jobs inside [Docker](https://www.docker.com/what-docker)
-containers. This guide describes how to build a Docker image
-that you can use for running jobs in CHTC. For information on using
-this image for jobs, see our [Docker Jobs guide](docker-jobs.html).
+This guide describes how to build a Docker image
+that you can use for running jobs in CHTC or sharing a common
+software environment with collaborators. For information on using
+a Docker container image in jobs, see our [Docker Jobs guide](docker-jobs.html).
-# Overview
+{% capture content %}
+- [Overview](#overview)
+- [Step by Step Build Instructions](#step-by-step-build-instructions)
+- [Examples]($examples)
+- [Related pages](#related-pages)
+{% endcapture %}
+{% include /components/directory.html title="Table of Contents" %}
+
+## Overview
**Note that all the steps below should be run on your own computer, not
in CHTC.**
@@ -29,28 +35,23 @@ called a "Dockerfile". This file has commands that allow you to:
You can then "build" an image from this
file, test it locally, and push it to DockerHub, where
-HTCondor can then use the image to build containers to run jobs in.
+HTCondor can then use the image to run jobs in.
Different versions of the image can be labeled with different version
"tags".
-This guide has:
-
-1. [Step by Step Instructions](#a-step-by-step-instructions)
-2. [Examples](#b-examples)
-
-# A. Step by Step Instructions
+## Step by Step Build Instructions
-## 1. Set Up Docker on Your Computer
+### 1. Set Up Docker on Your Computer
{% include install_docker.md %}
-## 2. Explore Docker Containers (optional)
+### 2. Explore Docker Containers (optional)
If you have never used Docker before, we recommend exploring a pre-existing container
and testing out installation steps interactively before creating a Dockerfile. See the
first half of this guide: [Exploring and Testing a Docker Container](docker-test.html)
-## 3. Create a Dockerfile
+### 3. Create a Dockerfile
A Dockerfile is a plain text file with keywords that add elements to a
Docker image. There are many keywords that can be used in a Dockerfile (documented on
@@ -62,14 +63,14 @@ subset of these keywords following this basic outline:
- Additions: What needs to be added? Folders? Data? Other software?
- Environment: What variables (if any) are set as part of the software installation?
-### Create the file
+#### Create the file
Create a blank text file named `Dockerfile`. If you are planning on making
multiple images for different parts of your workflow,
you should create a separate folder for each
new image with the a ``Dockerfile`` inside each of them.
-Choose a base image with FROM
+Choose a base image with FROM
Usually you don't want to start building your image from scratch.
Instead you'll want to choose a "base" image to add things to.
@@ -125,7 +126,7 @@ Here are some base images you might find useful to build off of:
- [Tensorflow](https://hub.docker.com/r/tensorflow/tensorflow)
- [PyTorch](https://hub.docker.com/r/pytorch/pytorch)
-Install packaged software with RUN
+Install packaged software with RUN
The next step is the most challenging. We need to add commands to the
Dockerfile to install the desired software. There are a few standard ways to
@@ -196,7 +197,7 @@ RUN install2.r --error rjags
```
{:.file}
-Set up the environment with ENV
+Set up the environment with ENV
Your software might rely on certain environment variables being set correctly.
@@ -222,7 +223,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
```
{:.file}
-## 4. Build, Name, and Tag the Image
+### 4. Build, Name, and Tag the Image
So far we haven't actually created the image -- we've just been
listing instructions for *how* to build the image in the Dockerfile.
@@ -280,14 +281,14 @@ If you get errors, try to determine what you may need to add or change
to your Dockerfile and then run the build command again. Debugging a Docker
build is largely the same as debugging any software installation process.
-## 5. Test Locally
+### 5. Test Locally
This page describes how to interact with your new Docker image on your
own computer, before trying to run a job with it in CHTC:
- [Exploring a Docker Container on Your Computer](docker-test.html)
-## 6. Push to DockerHub
+### 6. Push to DockerHub
Once your image has been successfully built and tested, you
can push it to DockerHub so that it will be available to run jobs in
@@ -332,18 +333,25 @@ It should ask for your DockerHub username and password.
> It's also a good idea to archive a copy of the Dockerfile used to generate a
> container image along with the file archive of the container image itself.
-## 7. Running Jobs
+### 7. Running Jobs
Once your Docker image is on Docker Hub, you can use it to run
jobs on CHTC's HTC system. See this guide for more details:
-- [Running Docker Jobs in CHTC](docker-jobs.html)
+- [Use Custom Software in Jobs Using Docker](docker-jobs.html)
-# B. Examples
+## Examples
-This section holds various example `Dockerfile` that cover more advanced use cases.
+This section holds various example `Dockerfile` that cover more advanced use cases.
+There are even more examples in our CHTC Recipes repository:
-## Installing a Custom Python Package from GitHub
+
+
+### Installing a Custom Python Package from GitHub
Suppose you have a custom Python package hosted on GitHub, but not available
on PyPI.
@@ -358,7 +366,7 @@ RUN pip3 install git+https://github.com//
where you would replace `` and `` with your
desired targets.
-## QIIME
+### QIIME
This `Dockerfile` installs [QIIME2](https://qiime2.org/) based on
[these instructions](https://docs.qiime2.org/2017.11/install/native/).
@@ -380,3 +388,8 @@ RUN cd /tmp \
&& conda update conda \
&& conda create -n qiime2-2017.10 --file https://data.qiime2.org/distro/core/qiime2-2017.10-conda-linux-64.txt
```
+
+## Related Pages
+
+- [Use Custom Software in Jobs Using Docker](docker-jobs.html)
+- [Explore and Test Docker Containers](docker-test.html)
\ No newline at end of file
diff --git a/_uw-research-computing/docker-jobs.md b/_uw-research-computing/docker-jobs.md
index da0ac45f..6e01f5d3 100644
--- a/_uw-research-computing/docker-jobs.md
+++ b/_uw-research-computing/docker-jobs.md
@@ -1,7 +1,7 @@
---
highlighter: none
layout: guide
-title: Running HTC Jobs Using Docker Containers
+title: Use Custom Software in Jobs Using Docker
alt_title: Use Software Installed in a Docker Container
guide:
category: Software
@@ -13,25 +13,38 @@ Linux containers are a way to build a self-contained environment that
includes software, libraries, and other tools. This guide shows how to
submit jobs that use Docker containers.
-# Overview
+{% capture content %}
+- [Start Here](#start-here)
+- [Use a Docker Container in a Job](#use-a-docker-container-in-a-job)
+- [Tips for HTCondor integration](#tips-for-htcondor-integration)
+- [Find an existing Docker container image](#find-an-existing-docker-container-image)
+- [Build your own Docker container image](#build-your-own-docker-container-image)
+- [Testing Docker containers](#testing-docker-containers)
+- [Related pages](#related-pages)
+{% endcapture %}
+{% include /components/directory.html title="Table of Contents" %}
-Typically, software in CHTC jobs is installed or compiled locally by
-individual users and then brought along to each job, either using the
-default file transfer or our SQUID web server. However, another option
-is to use a *container* system, where the software is installed in a
-*container image*. Using a container to handle software can be
-advantageous if the software installation 1) has many dependencies, 2)
-requires installation to a specific location, or 3) "hard-codes" paths
-into the installation.
+## Start Here
-CHTC has capabilities to access and start containers and
-run jobs inside them. This guide shows how to do this for
-[Docker](https://www.docker.com/what-docker) containers.
+To run a job using a Docker container, you will need access to a Docker container
+image that has been built and placed onto the
+[DockerHub](https://hub.docker.com/) website or another Docker registry service
+like [https://quay.io/] or a GitLab registry.
+
+If you have an existing Docker container with your software installed
+inside, go straight to [Use a Docker Container in a Job](#use-a-docker-container-in-a-job)
+and [Tips for HTCondor integration](#tips-for-HTCondor-integration)
-# 1. Use a Docker Container in a Job
+If you do not have an existing Docker container you can:
+* **Find one:** [Find an existing Docker container image](#find-an-existing-docker-container-image)
+* **Create one:** [Create a Docker Container Image](#create-a-docker-container-image).
+Once you have a container image
+ready, circle back to [Use a Docker Container in a Job](#use-a-docker-container-in-a-job).
+
+## Use a Docker Container in a Job
Jobs that run inside a Docker container will be almost exactly the same
-as "vanilla" HTCondor jobs. The main change is indicating which Docker
+as normal HTCondor jobs. The main change is indicating which Docker
container to use and an optional "container universe" option:
```
@@ -56,10 +69,22 @@ queue
```
In the above, change the address of the Docker container image as
-needed based on the container you are using. More information on finding
-and making container is below.
+needed based on the container you are using.
+
+> ### 💻 Non Docker Hub Registries
+{:.tip-header}
-## Integration with HTCondor
+> If your container is hosted on a Docker registry other than
+> DockerHub, just add the registry prefix before the container
+> repository name. For example, for a container hosted in
+> the Red Hat repository `quay.io`, the option should be:
+>
+> ```
+> container_image = docker://quay.io/user/repo:tag
+> ```
+{:.tip}
+
+## Tips for HTCondor integration
When your job starts, HTCondor will pull the indicated image from
DockerHub, and use it to run your job. You do not need to run any
@@ -68,21 +93,22 @@ Docker commands yourself.
Other pieces of the job (your executable and input files) should be just
like a non-Docker job submission.
-The only additional change may be that your
-executable no longer needs to install or unpack your software, since it
-will already be present in the Docker container.
-
-# 2. Choose or Create a Docker Container Image
+
-To run a Docker job, you will first need access to a Docker container
-image that has been built and placed onto the
-[DockerHub](https://hub.docker.com/) website. There are two primary ways
-to do this.
+We recommend using container tags. Importantly, whenever you make a significant change
+to your container, you will want to use a new tag name to ensure that your jobs are getting an
+updated version of the container, and not an 'old' version that has been cached by DockerHub
+or CHTC.
-## A. Pre-existing Images
+## Find an existing Docker container image
The easiest way to get a Docker container image for running a job is to
-use a public or pre-existing image on DockerHub. You can find images by
+use a public or pre-existing image on DockerHub or another registry. You can find images by
getting an account on DockerHub and searching for the software you want
to use.
@@ -94,31 +120,32 @@ Sample images:
An image supported by a group will be continuously updated and the
versions will be indicated by "tags". We recommend choosing a specific
-tag (or tags) of the container to use in CHTC.
+tag (or tags) of the container to use in CHTC.
-## B. Build Your Own Image
+## Build your own Docker container image
You can also build your own Docker container image and upload it to
DockerHub. See [this link to our guide on building containers](docker-build.html) or the [Docker
documentation](https://docs.docker.com/engine/getstarted/) for more
information.
-Similarly, we recommend using container tags. Importantly, whenever you make a significant change
-to your container, you will want to use a new tag name to ensure that your jobs are getting an
-updated version of the container, and not an 'old' version that has been cached by DockerHub
-or CHTC.
-
-# 3. Testing
+## Testing Docker containers
-If you want to test your jobs, you have two options:
+If you want to test your jobs or container, you have two options:
* We have a guide on exploring and testing Docker containers on your own computer here:
* [Exploring and Testing Docker Containers](docker-test.html)
* You can test a container interactively in CHTC by using a normal Docker job submit file and using the
-interactive flag with `condor_submit`:
- ```
- [alice@submit]$ condor_submit -i docker.sub
- ```
- {: .cmd}
- This should start a session inside the indicated Docker container and connect you to it using ssh. Type `exit` to end the interactive job. *Note*: Files generated during your interactive job with Docker will not be transfered back to the submit node. If you have a directory on `staging`, you can transfer the files there instead; if you have questions about this, please contact a facilitator.
-
+ interactive flag with `condor_submit`:
+ ```
+ [alice@ap]$ condor_submit -i docker.sub
+ ```
+ {:.term}
+ This should start a session inside the indicated Docker container and connect you to it using ssh. Type `exit` to end the interactive job. *Note*: Files generated during your interactive job with Docker will not be transfered back to the submit node. If you have a directory on `staging`, you can transfer the files there instead; if you have questions about this, please contact a facilitator.
+
+## Related Pages
+
+- [Build a Docker Container Image](docker-build)
+- [Explore and Test Docker Containers](docker-test)
+- [Use Custom Software in Jobs Using Apptainer](apptainer-htc)
+- [Overview: How to Use Software](software-overview-htc)
diff --git a/_uw-research-computing/docker-test.md b/_uw-research-computing/docker-test.md
index b60629fe..3f1e4293 100644
--- a/_uw-research-computing/docker-test.md
+++ b/_uw-research-computing/docker-test.md
@@ -12,16 +12,24 @@ Linux containers are a way to build a self-contained environment that
includes software, libraries, and other tools. This guide shows how to
explore and test a Docker container on your own computer.
-A. Overview
-============
+{% capture content %}
+- [Overview](#overview)
+- [Set up Docker on your computer](#set-up-docker-on-your-computer)
+- [Explore Docker containers](#explore-docker-containers)
+- [Simulate a CHTC docker job](#simulate-a-chtc-docker-job)
+- [Related pages](#related-pages)
+{% endcapture %}
+{% include /components/directory.html title="Table of Contents" %}
+
+## Overview
**Note that all the steps below should be run on your own computer, not
in CHTC.**
This guide has two sections:
-* [Explore Docker Containers](#b-explore-docker-containers)
-* [Simulate a CHTC Docker Job](#c-simulate-a-chtc-docker-job)
+* [Explore Docker containers](#explore-docker-containers)
+* [Simulate a CHTC docker job](#simulate-a-chtc-docker-job)
If you've never used Docker before, and/or are getting ready to build your own
container image, we recommend starting with the first part of the
@@ -31,15 +39,13 @@ If you've explored Docker already or built your own image and you want to test i
will work successfully in CHTC's HTC system,
you can follow the directions in the second section.
-A. Set Up Docker on Your Computer
-=================================
+## Set up Docker on your computer
{% include install_docker.md %}
-B. Explore Docker Containers
-============================
+## Explore Docker containers
-## 1. Get a Docker Container Image
+### 1. Get a Docker Container Image
We need to have a local copy of the Docker container image in order to
test it. You can see what container images you already have on your
@@ -70,7 +76,7 @@ $ docker pull username/image:tag
If you run `docker image ls` again, you should see the container you downloaded
listed.
-## 2. Explore the Container Interactively
+### 2. Explore the Container Interactively
To actually explore a container, run this command:
@@ -100,7 +106,7 @@ self-contained file system, separate from your computer. Try running commands w
your own container, try following a few of the installation instructions for the software
you want to use and see what happens.
-## 3. Exit the Container
+### 3. Exit the Container
Once you're done exploring, type `exit` to leave the container.
@@ -115,7 +121,7 @@ running container is shut down and removed (although the container image will st
on your computer, which you can see if you type `docker image ls` again).
-# C. Simulate a CHTC Docker Job
+## Simulate a CHTC Docker Job
The directions above were about simply exploring a container. If you want to
simulate what happens in a CHTC job more specifically, we'll want to do a few things:
@@ -124,7 +130,7 @@ simulate what happens in a CHTC job more specifically, we'll want to do a few th
- have a list of commands to run or a script you want to use as the executable.
- use some extra options when running the container.
-## 1. Create Working Directory
+### 1. Create Working Directory
For testing, we need a folder on your computer to stand in for the
working directory that HTCondor creates for running your job. Create a folder
@@ -147,7 +153,7 @@ $ cd %HOMEPATH%\Desktop\folder
```
{:.term}
-## 2. Plan What to Run
+### 2. Plan What to Run
Once the container starts, you have a few options for testing your job:
@@ -165,7 +171,7 @@ Once the container starts, you have a few options for testing your job:
container, you can run this in the container.
* Example: Running GROMACS from a container
-## 3. Start the Docker Container
+### 3. Start the Docker Container
We'll use a similar `docker run` command to start the Docker container,
with a few extra options to better emulate how containers are run in
@@ -206,7 +212,7 @@ inside.
> * `-w /scratch`: when the container starts, make `/scratch` the working directory
-## 4. Test the job
+### 4. Test the job
Your command line prompt should have changed to look like this:
@@ -256,3 +262,7 @@ your Docker job to run on CHTC.
* [Docker Jobs](docker-jobs.html)
+## Related Pages
+
+- [Use Custom Software in Jobs Using Docker](docker-jobs.html)
+- [Build a Docker Container Image](docker-build.html)
\ No newline at end of file
diff --git a/_uw-research-computing/julia-jobs.md b/_uw-research-computing/julia-jobs.md
index b63c743b..a412799c 100644
--- a/_uw-research-computing/julia-jobs.md
+++ b/_uw-research-computing/julia-jobs.md
@@ -13,15 +13,19 @@ published: true
## Quickstart: Julia
-### Option A (recommended)
+### Option A - Container (recommended)
-Build a container with Julia & packages installed inside:
+Build (or find) a container with Julia & packages installed inside.
+Start by reviewing
+the container build instructions for either Apptainer or Docker. Then, when
+following the build instructions, use the example recipes for either a
+`.def` or `Dockerfile`, respectively.
-1. [How to build your own container](software-overview-htc.html#build-your-own-container)
-2. [Example container recipes for Julia](https://github.com/CHTC/recipes/tree/main/software/Julia)
-3. [Use your container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
+1. How to build your own container: [Apptainer](apptainer-htc#use-an-apptainer-container-in-htc-jobs) / [Docker](docker-build)
+2. Tips and tricks, container recipes: [Example container recipes for Julia](https://github.com/CHTC/recipes/tree/main/software/Julia)
+3. Use your container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
-### Option B
+### Option B - Portable Binary
Use a portable copy of Julia and create your own portable copy of your Julia packages:
diff --git a/_uw-research-computing/matlab-jobs.md b/_uw-research-computing/matlab-jobs.md
index 9ba6c479..4b21aba4 100644
--- a/_uw-research-computing/matlab-jobs.md
+++ b/_uw-research-computing/matlab-jobs.md
@@ -13,11 +13,20 @@ published: true
## Quickstart: Matlab
-Build a container with Matlab & toolboxes installed inside:
+Build a container with Matlab & toolboxes installed inside.
+Start by reviewing
+the container build instructions for either Apptainer or Docker. Then, when
+following the build instructions, use the example recipes for either a
+`.def` or `Dockerfile`, respectively.
-1. [How to build your own container](software-overview-htc.html#build-your-own-container)
-2. [Example container recipes for Matlab](https://github.com/CHTC/recipes/tree/main/software/Matlab)
-3. [Use your container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
+
+### Useful links
+
+1. How to build your own container: [Apptainer](apptainer-htc#use-an-apptainer-container-in-htc-jobs)
+2. Tips and tricks, container recipes: [Example container recipes for Matlab](https://github.com/CHTC/recipes/tree/main/software/Matlab)
+3. Use your container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
+
+### Needed submit file option
> **Note**: Because Matlab is a licensed software, you **must** add the following line to your submit file:
>
diff --git a/_uw-research-computing/python-jobs.md b/_uw-research-computing/python-jobs.md
index 611a57f7..4b226075 100644
--- a/_uw-research-computing/python-jobs.md
+++ b/_uw-research-computing/python-jobs.md
@@ -13,15 +13,19 @@ published: true
## Quickstart: Python
-### Option A (recommended)
+### Option A - Own Container (recommended)
-Build a container with Python & packages installed inside:
+Build a container with Python & packages installed inside. Start by reviewing
+the container build instructions for either Apptainer or Docker. Then, when
+following the build instructions, use the example recipes for either a
+`.def` or `Dockerfile`, respectively.
-1. [How to build your own container](software-overview-htc.html#build-your-own-container)
-2. [Example container recipes for Python](https://github.com/CHTC/recipes/tree/main/software/Python/)
-3. [Use your container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
-#### Option B
+1. How to build your own container: [Apptainer](apptainer-htc#use-an-apptainer-container-in-htc-jobs) / [Docker](docker-build)
+2. Tips and tricks, container recipes: [Example container recipes for Python](https://github.com/CHTC/recipes/tree/main/software/Python/)
+3. Use your container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
+
+#### Option B - Existing Container
Use an existing container with a base installation of Python:
@@ -29,7 +33,7 @@ Use an existing container with a base installation of Python:
[OSG Base Containers](https://portal.osg-htc.org/documentation/htc_workloads/using_software/available-containers-list/#base)
or
[DockerHub Python Containers](https://hub.docker.com/_/python).
-2. [Use the container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
+2. Use the container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
diff --git a/_uw-research-computing/r-jobs.md b/_uw-research-computing/r-jobs.md
index f51e8992..3a3deea4 100644
--- a/_uw-research-computing/r-jobs.md
+++ b/_uw-research-computing/r-jobs.md
@@ -13,15 +13,20 @@ published: true
## Quickstart: R
-#### Option A (recommended)
+### Option A - Your Container (recommended)
-Build a container with R & packages installed inside:
+Build a container with R & packages installed inside. Start by reviewing
+the container build instructions for either Apptainer or Docker. Then, when
+following the build instructions, use the example recipes for either a
+`.def` or `Dockerfile`, respectively.
-1. [How to build your own container](software-overview-htc.html#build-your-own-container)
-2. [Example container recipes for R](https://github.com/CHTC/recipes/tree/main/software/R/)
-3. [Use your container in your HTC jobs](software-overview-htc.html#use-an-existing-container)
-#### Option B
+1. How to build your own container: [Apptainer](apptainer-htc#use-an-apptainer-container-in-htc-jobs) / [Docker](docker-build)
+2. Tips and tricks, container recipes: [Example container recipes for R](https://github.com/CHTC/recipes/tree/main/software/R/)
+3. Use your container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
+
+
+### Option B - Existing Container
Use an existing container with a base installation of R:
@@ -29,7 +34,7 @@ Use an existing container with a base installation of R:
[OSG R containers](https://portal.osg-htc.org/documentation/htc_workloads/using_software/available-containers-list/#:~:text=R%20(opensciencegrid/osgvo%2Dr))
or
[Rocker R containers](https://rocker-project.org/images/).
-2. [Use the container in your HTC jobs](#use-an-existing-container)
+2. Use the container in your HTC jobs: [Apptainer](software-overview-htc.html#use-an-existing-container) / [Docker](docker-jobs.html#use-a-docker-container-in-a-job)
diff --git a/_uw-research-computing/software-overview-htc.md b/_uw-research-computing/software-overview-htc.md
index e1b56088..5672fa98 100644
--- a/_uw-research-computing/software-overview-htc.md
+++ b/_uw-research-computing/software-overview-htc.md
@@ -16,19 +16,39 @@ This guide introduces how to build software in a container (our recommended stra
{% capture content %}
-[Quickstart](#quickstart)
-
-[Recipes](#recipes)
-
-[Containers](#containers)
+- [Start here](#start-here)
+- [Quickstart by software type](#quickstart-by-software-type)
+- [What approach should I use?](#what-approach-should-i-use)
+- [Container Overview](#container-overview)
+- [Related pages](#related-pages)
{% endcapture %}
{% include /components/directory.html title="Table of Contents" %}
-## Quickstart
+## Start Here
+
+For most CHTC users, we recommend using a container for your software environment.
+A container is a portable, self-contained operating system and can be easily executed on different computers. When building the container you can choose the operating system you want to use, and can install programs as if you were the owner of the computer.
-Click the link in the table below to jump to the instructions for the language/program/software that you want to use.
-More information is provided in the [CHTC Recipes Repository](https://github.com/CHTC/recipes) and the [Containers](#containers) sections.
+
+
+In general, if you have not used containers before, we recommend using Apptainer
+containers.
+
+
+
+* For more specific guidance about *your* software, see: [Quickstart by software type](#quickstart-by-software-type)
+* For more guidance in whether jumping right into Apptainer is best for you:
+ [What approach should I use?](#what-approach-should-i-use)
+* To learn more about containers in general see: [Containers](#container-overview)
+
+## Quickstart by software type
+
+Click the link in the table below to jump to the instructions for the language/program/software that you want to use, and then click on "More Information."
@@ -52,23 +72,45 @@ More information is provided in the [CHTC Recipes Repository](https://github.com
----
+## What approach should I use?
-## Recipes
+We recommend using containers for jobs in CHTC for a number of reasons, detailed
+[below](#why-use-containers).
-CHTC provides specific examples for software and workflows for use on our systems in our "Recipes" repository on Github:
-[https://github.com/CHTC/recipes](https://github.com/CHTC/recipes).
+There are two container implementations we support, Docker and Apptainer.
-Links to specific recipes are used in the [Software](#software) section for certain softwares and coding languages.
+
----
+We recommend using Apptainer as a first choice because you can build the container
+on our servers and it has some features that allow it to be used on a greater variety
+of computing nodes.
+
+However, there are many good reasons to use Docker (or Apptainer) depending on your
+circumstances. Here is a list of things to consider when deciding which path to take.
-## Containers
+* If your software has an existing Docker or Apptainer/Singularity implementation, use that.
+* If you or your group have an existing Docker container, use Docker.
+* If you already know how to use Docker or Apptainer/Singularity, use whichever you are familiar with.
+* If you want to create a container that can run both on CHTC and your own computer, use Docker.
+* If you want to create a container that you and collaborators can use on your own computers and CHTC, use Docker.
+* If you want to keep your container more private, use Apptainer.
-Many of the recipes in our Recipes repository involve building your own container.
-In this section, we provide a brief introduction into how to use containers for setting up your own software to run on the High Throughput system.
+In certain cases, it is reasonable to use a non-container option for software installation, especially when using a package manager like `conda`.
-### What is a Container?
+If you are not sure what to choose, talk to the facilitation team! That's why we're here.
+
+
+## Container overview
+
+In this section, we provide a brief introduction into what containers are,
+why we recommend them, and a big picture view of how to use them on our High Throughput system.
+
+### What is a container?
*"A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another."*
-- [Docker](https://www.docker.com/resources/what-container/)
@@ -95,7 +137,58 @@ While there are some caveats, containers are useful for deploying software on sh
> When we talk about building or moving or distributing a container, we're actually talking about the file(s) that constitute the container.
> When a container is "running" or "executed", the container image is used to create the run time environment for executing the programs installed inside of it.
-### Container Technologies
+### Why use containers?
+
+We recognize that learning about containers is its own challenge! However, we have found
+in the long run, that containers provide the best long-term user experience when running
+jobs in CHTC, including:
+
+- a consistent environment no matter what computer your job runs on
+- a consistent environment with stable software versions (good for reproducibility)
+- ability to fully customize the software installation
+
+Our goal is to make finding or building your container as easy as possible, so you
+can have most of these benefits, without too much pain.
+
+### Using containers on CHTC
+
+If you have a container, adding it to your job is easy! It's just one more line
+in the submit file. The challenge is usually getting a container that has what you need.
+There are typically two ways of doing so:
+
+1. Find an existing container
+1. Build your own container image
+
+If building your own container, the process will include:
+
+1. Writing a build file, called either a `Dockerfile` or definition (`.def`) file.
+ * Consult your software's documentation
+ * Choose an existing base container
+ * Add the details needed for your software
+ * Leverage CHTC's [recipes repository](https://github.com/CHTC/recipes)
+1. (If using Apptainer: starting an interactive session on a CHTC build server)
+1. Running a command to "build" the container image, using your build file as the
+template for doing so
+1. Running a command to put the container in a location where you can use it in your jobs.
+
+These guides talk about how to do the above steps for either Apptainer or Docker.
+- [Use Custom Software in Jobs Using Apptainer](apptainer-htc)
+- [Use Custom Software in Jobs Using Docker](docker-jobs)
+
+> A common question is whether the software installation process is repeated each time a container is used.
+> The answer is "no".
+> The software installation process only occurs when the container is actually being built.
+> Once the container has been built, no changes can be made to the container when being used (on CHTC systems).
+
+### Container build recipes
+
+If you need to create your own build file, CHTC provides many specific examples
+in our "Recipes" repository on Github:
+[https://github.com/CHTC/recipes](https://github.com/CHTC/recipes).
+
+Links to specific recipes are used in the [Software](#software) section for certain softwares and coding languages.
+
+### Container technologies
There are two container technologies supported by CHTC: [Docker](https://www.docker.com/) and [Apptainer](https://apptainer.org/).
Here we briefly discuss the advantages of each.
@@ -126,118 +219,10 @@ On the HTC system, you can provide the name of your Apptainer file in your submi
and HTCondor will use a copy of it to create the software environment for executing your job.
You can use Apptainer to build the container image file on CHTC servers, so there is no need to install the container software on your own computer.
-### Use an Existing Container
-
-If you or a colleague have already built a container for use on CHTC, it is fairly straightforward to modify your jobs to use the container environment as discussed below.
-#### Use a Docker container
-*Full Guide*: [Running HTC Jobs Using Docker Containers](docker-jobs.html)
+## Related Pages
-If the container you want to use is hosted on Docker Hub, find the container "address" and provide it in your submit file.
-The address typically has the convention of `user/repository:tag`, though official repositories such as Python are just `repository:tag`.
-In your submit file, use
-
-```
-container_image = docker://user/repository:tag
-```
-{:.sub}
-
-If the container you want to use is hosted in a different container registry, there should still be a container "address" to use,
-but now there will be a website prefix.
-
-```
-container_image = docker://registry_address/user/repository:tag
-```
-{:.sub}
-
-For example, to use a container from the [NVIDIA Container Registry](https://catalog.ngc.nvidia.com/containers) (`nvcr`),
-you would have `docker://nvcr.io/nvidia/repository:tag`.
-
-[Back to Top](#top)
-
-#### Use an Apptainer container
-
-*Full Guide*: [Use Apptainer Containers](apptainer-htc.html)
-
-For historical reasons, the Apptainer container file has the file extension `.sif`.
-The syntax for giving HTCondor the name of the container file depends on where it is located on the CHTC system.
-
-If the `.sif` file is in a **`/home` directory**:
-
-```
-container_image = path/to/my-container.sif
-```
-{:.sub}
-
-If the `.sif` file is in a **`/staging` directory**:
-
-```
-container_image = file:///staging/path/to/my-container.sif
-```
-{:.sub}
-
-If the `.sif` file is **in a `/staging` directory AND you are using `want_campus_pools` or `want_ospool`**:
-
-```
-container_image = osdf:///chtc/staging/path/to/my-container.sif
-```
-{:.sub}
-
-[Back to Top](#top)
-
-### Build Your Own Container
-
-You can build your own container with the operating system and software that you want to use.
-The general process is the same whether you are using Docker or Apptainer.
-
-1. **Consult your software's documentation**
-
- Determine the requirements for installing the software you want to use.
- In particular you are looking for (a) the operating systems it is compatible with and (b) the prerequisite libraries or packages.
-
-2. **Choose a base container**
-
- The base container should at minimum use an operating system compatible with your software.
- Ideally the container you choose also has many of the prerequisite libraries/programs already installed.
-
-3. **Create your own definition file**
-
- The definition file contains the installation commands needed to set up your software.
- (The structure of the container "definition" file differs between Docker and Apptainer, but it is fairly straightforward to translate between the two.)
-
-4. **Build the container**
-
- Once the definition file has been written, you must "build" the container.
- The computer you use to build the container will run through the installation commands, almost as if you were actually installing the software on that computer,
- but will save the results into the container file(s) for later use.
-
-5. **Distribute the container**
-
- To use the container on CHTC servers, you'll need to distribute the container to right location.
- For Docker containers, this means "pushing" the container to Docker Hub or similar container registry.
- For Apptainer containers, this typically means copying the container `.sif` file to the [/staging system](file-avail-largedata.html).
-
-You can then use the container following the [instructions above](#use-an-existing-container).
-
-> A common question is whether the software installation process is repeated each time a container is used.
-> The answer is "no".
-> The software installation process only occurs when the container is actually being built.
-> Once the container has been built, no changes can be made to the container when being used (on CHTC systems).
-
-#### Build your own Docker container
-
-Please follow the instructions in our guide [Build a Docker Container Image](docker-build.html) to build your own container using Docker.
-As mentioned above, you will need to have Docker installed on your own computer.
-This is so that you can push the completed container to Docker Hub.
-
-*You are unable to push containers from CHTC to Docker Hub, so please do not build Docker containers using CHTC!*
-
-#### Build your own Apptainer container
-
-Please follow the instructions in our guide [Use Apptainer Containers](apptainer-htc.html) to build your own container using Apptainer.
-You can use CHTC servers to build the container, so there is no need to install any software on your computer.
-
-[Back to Top](#top)
-
----
+- [Use Custom Software in Jobs Using Apptainer](apptainer-htc)
+- [Use Custom Software in Jobs Using Docker](docker-jobs)
+- [Using Apptainer Containers on HPC](apptainer-hpc.html)