Skip to content

Commit

Permalink
Updates tested docker and apptainer versions for cluster deployment (i…
Browse files Browse the repository at this point in the history
…saac-sim#1230)

# Description

The cluster workflow succeeded with a newer version of apptainer and
docker. This PR removes the error when not the specific old versions are
used and instead prints a warning once non-tested versions are deployed.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
  • Loading branch information
pascal-roth authored Oct 15, 2024
1 parent e3ea4c5 commit 15a2c50
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
29 changes: 22 additions & 7 deletions docker/cluster/cluster_interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#==
# Functions
#==
# Function to display warnings in red
display_warning() {
echo -e "\033[31mWARNING: $1\033[0m"
}

# Helper function to compare version numbers
version_gte() {
# Returns 0 if the first version is greater than or equal to the second, otherwise 1
[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n 1)" == "$2" ]
}

# Function to check docker versions
# If docker version is more than 25, the script errors out.
check_docker_version() {
# check if docker is installed
if ! command -v docker &> /dev/null; then
Expand All @@ -28,12 +38,17 @@ check_docker_version() {
docker_version=$(docker --version | awk '{ print $3 }')
apptainer_version=$(apptainer --version | awk '{ print $3 }')

# Check if version is above 25.xx
if [ "$(echo "${docker_version}" | cut -d '.' -f 1)" -ge 25 ]; then
echo "[ERROR]: Docker version ${docker_version} is not compatible with Apptainer version ${apptainer_version}. Exiting."
exit 1
# Check if Docker version is exactly 24.0.7 or Apptainer version is exactly 1.2.5
if [ "$docker_version" = "24.0.7" ] && [ "$apptainer_version" = "1.2.5" ]; then
echo "[INFO]: Docker version ${docker_version} and Apptainer version ${apptainer_version} are tested and compatible."

# Check if Docker version is >= 27.0.0 and Apptainer version is >= 1.3.4
elif version_gte "$docker_version" "27.0.0" && version_gte "$apptainer_version" "1.3.4"; then
echo "[INFO]: Docker version ${docker_version} and Apptainer version ${apptainer_version} are tested and compatible."

# Else, display a warning for non-tested versions
else
echo "[INFO]: Building singularity with docker version: ${docker_version} and Apptainer version: ${apptainer_version}."
display_warning "Docker version ${docker_version} and Apptainer version ${apptainer_version} are non-tested versions. There could be issues, please try to update them. More info: https://isaac-sim.github.io/IsaacLab/source/deployment/cluster.html"
fi
}

Expand Down Expand Up @@ -139,7 +154,7 @@ case $command in
fi
# Check if Docker image exists
check_image_exists isaac-lab-$profile:latest
# Check if Docker version is greater than 25
# Check docker and apptainer version
check_docker_version
# source env file to get cluster login and path information
source $SCRIPT_DIR/.env.cluster
Expand Down
13 changes: 5 additions & 8 deletions docs/source/deployment/cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ development machine and the cluster. Such a connection will simplify the file tr
the user cluster password from being requested multiple times.

.. attention::
The workflow has been tested with ``apptainer version 1.2.5-1.el7`` and ``docker version 24.0.7``.
The workflow has been tested with:

- ``apptainer``:
There have been reported binding issues with previous versions (such as ``apptainer version 1.1.3-1.el7``). Please
ensure that you are using the latest version.
- ``Docker``:
The latest versions (``25.x``) cannot be used as they are not compatible yet with apptainer/ singularity.
- ``apptainer version 1.2.5-1.el7`` and ``docker version 24.0.7``
- ``apptainer version 1.3.4`` and ``docker version 27.3.1``

In the case of issues, please try to switch to those versions.

We are waiting for an update from the apptainer team. To track this issue, please check the `forum post`_.

Configuring the cluster parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -211,4 +209,3 @@ The above will, in addition, also render videos of the training progress and sto
.. _apptainer: https://apptainer.org/
.. _documentation: https://www.apptainer.org/docs/admin/main/installation.html#install-ubuntu-packages
.. _SLURM documentation: https://www.slurm.schedmd.com/sbatch.html
.. _forum post: https://forums.docker.com/t/trouble-after-upgrade-to-docker-ce-25-0-1-on-debian-12/139613

0 comments on commit 15a2c50

Please sign in to comment.