Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/runtime-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Runtime Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
runtime-test:
name: Slurm ${{ matrix.slurm }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- ubuntu_version: plucky
slurm: 24.11

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run runtime integration tests
run: |
cd tests/runtime
UBUNTU_VERSION=${{ matrix.ubuntu_version }} ./run-tests.sh
env:
UBUNTU_VERSION: ${{ matrix.ubuntu_version }}
BUILDX_CACHE_FROM: type=gha,scope=${{ matrix.ubuntu_version }}
BUILDX_CACHE_TO: type=gha,mode=max,scope=${{ matrix.ubuntu_version }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
singularity-exec.so
*.rpm
.vagrant/
build/
install/
build-*
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Slurm Singularity SPANK Plugin

[![Build](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/build.yml/badge.svg)](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/build.yml) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10719223.svg)](https://doi.org/10.5281/zenodo.10719223)
[![Build](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/build.yml/badge.svg)](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/build.yml) [![Runtime Tests](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/runtime-tests.yml/badge.svg)](https://github.com/GSI-HPC/slurm-singularity-exec/actions/workflows/runtime-tests.yml) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10719223.svg)](https://doi.org/10.5281/zenodo.10719223)

The Singularity SPANK plugin provides the users with an interface to launch an
application within a Linux container. The plug-in adds multiple command-line
Expand Down Expand Up @@ -168,33 +168,6 @@ still find them interesting for reference or to fork from:
Traditional manually maintained Release and Changelog fields.


## Development

Build the required singularity containers with the script [`containers.sh`][97].
(This requires the `singularity` command installed on the host). The containers
generated by the script are stored under `/tmp/*.sif`.

Start a test environment using the included [`Vagrantfile`][96]:

* Installs the `apptainer` package from Fedora EPEL
* Copies the SIF container images to `/tmp`
* Builds, installs and configures the Slurm Singularity plug-in

Start a Vagrant box to build an RPM package:

```sh
./containers.sh && vagrant up el8 && vagrant ssh el8 # for example...

# synced from the host
cd /vagrant

cmake -S . -B build # configure the project and choose a build dir
cmake --build build # build the Singularity SPANK plug-in
sudo cmake --install build # install the binary and configuration files

sudo systemctl enable --now munge slurmctld slurmd
```

## License

```
Expand Down Expand Up @@ -243,8 +216,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

[99]: singularity-exec.conf.in
[98]: slurm-singularity-wrapper.sh
[97]: containers.sh
[96]: Vagrantfile
[95]: https://singularity.hpcng.org/user-docs/master/bind_paths_and_mounts.html#user-defined-bind-paths
[94]: https://singularity.hpcng.org/user-docs/master/cli/singularity_exec.html
[93]: https://singularity.hpcng.org/user-docs/master/cli/singularity.html#options
84 changes: 0 additions & 84 deletions Vagrantfile

This file was deleted.

39 changes: 0 additions & 39 deletions containers.sh

This file was deleted.

21 changes: 18 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,26 @@ bats test_wrapper.bats
- Error handling (missing files, invalid paths, special characters)
- Command construction (argument ordering, bind mount syntax, environment propagation)

## Runtime Integration Tests

Runtime tests verify the plugin works with actual Slurm daemons:

```bash
cd tests/runtime
./run-tests.sh
```

See [runtime/README.md](runtime/README.md) for detailed documentation on the Docker Compose architecture, test flow, and troubleshooting.

## Continuous Integration

GitHub Actions tests on every push/PR with:
- Slurm 23.11 (Ubuntu 24.04 Noble)
- Slurm 24.11 (Ubuntu 25.04 Plucky)
GitHub Actions runs tests on every push/PR:

| Test Type | Slurm Version | Ubuntu Version | Description |
|-----------|---------------|----------------|-------------|
| Build | 23.11 | 24.04 Noble | Compile-time compatibility check |
| Build | 24.11 | 25.04 Plucky | Compile-time compatibility check |
| Runtime | 24.11 | 25.04 Plucky | Full integration tests with live cluster |

## Writing Tests

Expand Down
43 changes: 43 additions & 0 deletions tests/runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Dockerfile for runtime testing of slurm-singularity-exec
# Sets up a complete Slurm cluster with controller and compute nodes

ARG UBUNTU_VERSION=25.04
FROM ubuntu:${UBUNTU_VERSION}

# Install Slurm, Munge, and dependencies
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
slurm-wlm \
slurm-wlm-basic-plugins \
slurmd \
slurmctld \
munge \
cmake \
g++ \
ninja-build \
libslurm-dev \
curl \
sudo \
retry \
&& rm -rf /var/lib/apt/lists/*

# Try to install singularity-container if available (may not be in all Ubuntu versions)
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y singularity-container || true \
&& rm -rf /var/lib/apt/lists/*

# Create necessary directories and files
RUN mkdir -p /var/spool/slurmctld \
/var/spool/slurmd \
/var/spool/slurm \
/var/run/slurm \
/etc/slurm \
/etc/slurm/plugstack.conf.d \
&& chown -R slurm:slurm /var/spool/slurmctld /var/spool/slurmd /var/spool/slurm /var/run/slurm \
&& touch /etc/localtime

# Set working directory
WORKDIR /workspace

# Default command will be overridden in docker-compose
CMD ["/bin/bash"]
Loading