Metadata-Version: 2.5
Name: slurm-factory
Version: 0.1.40
Summary: Slurm builder project by Vantage Compute - builds Slurm packages in Docker containers
Project-URL: Homepage, https://github.com/vantagecompute/slurm-factory
Project-URL: Documentation, https://docs.vantagecompute.ai/developer/slurm-factory/
Project-URL: Repository, https://github.com/vantagecompute/slurm-factory
Author-email: James Beedy <james@vantagecompute.ai>
License: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: boto3>=1.35.0
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: rich>=14.1.0
Requires-Dist: typer>=0.19.2
Provides-Extra: dev
Requires-Dist: black>=25.9.0; extra == 'dev'
Requires-Dist: codespell>=2.4.0; extra == 'dev'
Requires-Dist: mypy>=1.18.2; extra == 'dev'
Requires-Dist: pyright>=1.1.410; extra == 'dev'
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
Requires-Dist: pytest>=8.4.2; extra == 'dev'
Requires-Dist: ruff>=0.14.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.12.20250915; extra == 'dev'
Description-Content-Type: text/markdown

<div align="center">
<a href="https://www.vantagecompute.ai/">
  <img src="https://vantage-compute-public-assets.s3.us-east-1.amazonaws.com/branding/vantage-logo-text-black-horz.png" alt="Vantage Compute Logo" width="100"/>
</a>

# Slurm Factory

[![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.12+-blue.svg)](https://python.org)
[![PyPI](https://img.shields.io/pypi/v/slurm-factory.svg)](https://pypi.org/project/slurm-factory/)
[![Docker](https://img.shields.io/badge/Docker-24.0+-blue.svg)](https://docker.com)

Build relocatable, **GPG-signed** Slurm packages using Docker and Spack.

[Documentation](https://docs.vantagecompute.ai/developer/slurm-factory) | [Buildcache](https://slurm-factory-spack-binary-cache.vantagecompute.ai)

</div>

## Quick Start

### Option 1: Install Pre-built Slurm from Buildcache

Use Spack to install GPG-signed pre-built binaries (**no slurm-factory tool needed**). Each OS toolchain has one mirror holding every Slurm version for both `amd64` and `arm64`:

```bash
# Install Spack and the slurm_factory package repository
git clone --depth 1 --branch v1.0.0 https://github.com/spack/spack.git ~/spack
source ~/spack/share/spack/setup-env.sh
git clone --depth 1 https://github.com/vantagecompute/slurm-factory-spack-repo.git ~/slurm-factory-spack-repo
spack repo add ~/slurm-factory-spack-repo/spack_repo/slurm_factory

# Add the mirror for your OS toolchain
TOOLCHAIN=noble  # or: resolute, jammy, rockylinux10, rockylinux9, rockylinux8
spack mirror add slurm-factory "https://slurm-factory-spack-binary-cache.vantagecompute.ai/${TOOLCHAIN}/spack"

# Import the GPG keys, then install the published spec by hash (5-15 min)
spack buildcache keys --install --trust
spack buildcache list --allarch --long slurm@26-05-5-1
spack install --cache-only /<hash>
```

**Full guide:** [Installing Slurm from Buildcache](https://docs.vantagecompute.ai/developer/slurm-factory/installing-slurm-from-buildcache)

### Option 2: Build Custom Slurm with slurm-factory Tool

Install the slurm-factory tool to build custom packages (requires Docker):

```bash
pip install slurm-factory

# Build Slurm 26.05 (the default) with the Ubuntu 24.04 toolchain (GCC 13.3.0)
slurm-factory build-slurm --slurm-version 26.05
```

**Full guide:** [Installing slurm-factory Tool](https://docs.vantagecompute.ai/developer/slurm-factory/installation)

## Supported Versions

### Slurm × Operating System Matrix

Every combination uses **OS-provided compilers** and is published for `amd64` and `arm64`:

| Slurm Version | Release  | Supported Operating Systems                                                  |
|---------------|----------|------------------------------------------------------------------------------|
| **26.05**     | 26.05.5  | Ubuntu 26.04, **Ubuntu 24.04**, Ubuntu 22.04, Rocky 10, Rocky 9, Rocky 8      |

**Default**: Slurm 26.05 on Ubuntu 24.04 (Noble). 26.05 is the only supported series. The [Packages](https://docs.vantagecompute.ai/developer/slurm-factory/packages) page lists what is currently in the cache.

### Operating System Compiler Toolchains

Slurm is built using the default system compiler from each OS distribution:

| OS | Toolchain | GCC Version | GLIBC | Use Case |
|----|-----------|-------------|-------|----------|
| **Ubuntu 24.04** | **noble** | **13.3.0** | **2.39** | **Recommended, modern stable** |
| Ubuntu 26.04 | resolute | 15.2.0 | 2.42 | Latest toolchain |
| Ubuntu 22.04 | jammy | 11.4.0 | 2.35 | LTS, wide compatibility |
| Rocky Linux 10 | rockylinux10 | 14.3.1 | 2.39 | RHEL 10 compatible |
| Rocky Linux 9 | rockylinux9 | 11.5.0 | 2.34 | RHEL 9 compatible |
| Rocky Linux 8 | rockylinux8 | 8.5.0 | 2.28 | RHEL 8 compatible |

## GPG Package Signing

All published packages and tarballs are **cryptographically signed with GPG** for security and integrity.

### Why GPG Signing?

- **Authenticity**: Verify packages were built by Vantage Compute
- **Integrity**: Detect tampering or corruption during download
- **Security**: Prevent man-in-the-middle attacks
- **Trust Chain**: Establish provenance for production deployments

### GPG Key Information

```text
Key ID: DFB92630BCA5AB71
Fingerprint: FDEA 9066 7641 5052 64EF  D114 DFB9 2630 BCA5 AB71
Owner: Vantage Compute Corporation (Slurm Factory Spack Cache Signing Key)
Email: info@vantagecompute.ai
```

### Importing GPG Keys

Keys are imported from the buildcache:

```bash
# Import and trust the signing keys
spack buildcache keys --install --trust

# Packages are verified during installation
spack install --cache-only /<hash>
```

## Features

- **GPG-Signed Packages**: Spack binaries and tarballs are cryptographically signed
- **10-15x Faster**: pre-built packages install in 5-15 minutes vs 45-90 minutes
- **Relocatable**: deploy to any path, no host dependencies
- **CDN Distribution**: CloudFront-distributed buildcache for fast global access
- **6 OS Toolchains**: Ubuntu 22.04/24.04/26.04, Rocky Linux 8/9/10
- **Slurm 26.05**: the current upstream series (26.05.5)
- **amd64 and arm64**: every combination is built natively for both architectures
- **OS-Native Compilers**: uses system-provided GCC for maximum compatibility
- **Clean Builds**: Docker isolation, no system pollution

## Build Options

### Build from Source with slurm-factory

```bash
# Default build (CPU-only, Ubuntu 24.04 toolchain)
slurm-factory build-slurm --slurm-version 26.05

# GPU support (CUDA/ROCm)
slurm-factory build-slurm --slurm-version 26.05 --gpu

# Different OS toolchain
slurm-factory build-slurm --slurm-version 26.05 --toolchain jammy

# Reuse the remote Spack buildcache for dependencies
slurm-factory build-slurm --slurm-version 26.05 --buildcache

# Build, push the Spack packages, then sign and upload the tarball
slurm-factory build-slurm --slurm-version 26.05 --publish=all \
  --signing-key "$GPG_KEY_ID" \
  --gpg-private-key "$GPG_PRIVATE_KEY" \
  --gpg-passphrase "$GPG_PASSPHRASE"
```

Built tarballs land in `~/.slurm-factory/builds/<toolchain>/<slurm_version>/`.

### Download Pre-built Tarball

Download a complete Slurm installation as a tarball with GPG signature verification:

```bash
# Set versions
SLURM_VERSION=26.05
TOOLCHAIN=noble     # or: resolute, jammy, rockylinux10, rockylinux9, rockylinux8
ARCHITECTURE=amd64  # or: arm64
CLOUDFRONT_URL=https://slurm-factory-spack-binary-cache.vantagecompute.ai
TARBALL="slurm-${SLURM_VERSION}-${TOOLCHAIN}-${ARCHITECTURE}-software.tar.gz"

# Download tarball and signature
wget "${CLOUDFRONT_URL}/${TOOLCHAIN}/${SLURM_VERSION}/${ARCHITECTURE}/${TARBALL}"
wget "${CLOUDFRONT_URL}/${TOOLCHAIN}/${SLURM_VERSION}/${ARCHITECTURE}/${TARBALL}.asc"

# Import GPG key and verify the signature
gpg --keyserver keyserver.ubuntu.com --recv-keys DFB92630BCA5AB71
gpg --verify "${TARBALL}.asc" "${TARBALL}"

# Extract and load
sudo mkdir -p /opt/slurm-factory
sudo tar -xzf "${TARBALL}" -C /opt/slurm-factory
module use /opt/slurm-factory/view/assets/modules
module load slurm
```

## Package Structure

Every build produces a relocatable tarball holding a single Spack view:

```text
slurm-26.05-noble-amd64-software.tar.gz
└── view/
    ├── bin/ sbin/ lib/ ...        # Slurm, OpenMPI, PMIx and runtime libraries
    ├── etc/slurm/plugstack.conf.d/ # Pyxis SPANK plugin config
    └── assets/modules/slurm/       # Lmod module (relocatable)
```

Configuring the cluster (`slurm.conf`, users, services) is left to you; see the [Deployment](https://docs.vantagecompute.ai/developer/slurm-factory/deployment) guide.

## Buildcache Structure

The public buildcache is organized by OS toolchain:

```text
https://slurm-factory-spack-binary-cache.vantagecompute.ai/
├── source/                       # Source mirror used by builds
└── <toolchain>/                  # resolute, noble, jammy, rockylinux10, rockylinux9, rockylinux8
    ├── spack/                    # Spack binary mirror: Slurm 26.05, both architectures (GPG-signed)
    └── <slurm_version>/          # 26.05
        └── <arch>/               # amd64, arm64
            ├── slurm-<slurm_version>-<toolchain>-<arch>-software.tar.gz      # Complete tarball
            └── slurm-<slurm_version>-<toolchain>-<arch>-software.tar.gz.asc  # GPG signature
```

### Mirror Architecture

One Spack mirror per toolchain (`<toolchain>/spack`) holds Slurm and all of its dependencies, including build dependencies, for every Slurm version and both architectures. This allows:

- **Better caching**: dependencies are shared across Slurm versions within a toolchain
- **OS compatibility**: packages are built with native system compilers
- **Reduced storage**: no duplication of common packages within a toolchain

A tarball name always holds the newest release of its series (for example `slurm-26.05-...` is 26.05.5), so tarballs are served with a short cache lifetime.

## Requirements

- Python 3.12+
- Docker 24.0+ (for building from source)
- 50GB disk space
- 4+ CPU cores (8+ recommended)
- 16GB RAM (32GB+ recommended)

For buildcache installs: only Spack required (no Docker needed)

## Documentation

**[docs.vantagecompute.ai/developer/slurm-factory](https://docs.vantagecompute.ai/developer/slurm-factory/)**

- [Overview](https://docs.vantagecompute.ai/developer/slurm-factory/): architecture and features
- [Installation](https://docs.vantagecompute.ai/developer/slurm-factory/installation): setup and quick start
- [Examples](https://docs.vantagecompute.ai/developer/slurm-factory/examples): common use cases
- [Buildcache Guide](https://docs.vantagecompute.ai/developer/slurm-factory/slurm-factory-spack-build-cache): GPG signing and distribution
- [CLI Reference](https://docs.vantagecompute.ai/developer/slurm-factory/cli-reference): CLI commands
- [Python Reference](https://docs.vantagecompute.ai/developer/slurm-factory/python-reference): Python modules
- [Releasing](https://docs.vantagecompute.ai/developer/slurm-factory/releasing): `just release` and tags

## Development

```bash
# Install from source
git clone https://github.com/vantagecompute/slurm-factory.git
cd slurm-factory
just env

# Lint, typecheck and run the tests
just check

# Build the docs site
just docs-build
```

## License

Apache License 2.0. See the [LICENSE](LICENSE) file.

## Support

- Issues: [github.com/vantagecompute/slurm-factory/issues](https://github.com/vantagecompute/slurm-factory/issues)
- Docs: [docs.vantagecompute.ai/developer/slurm-factory](https://docs.vantagecompute.ai/developer/slurm-factory/)
- Website: [vantagecompute.ai](https://www.vantagecompute.ai)

---

Built by [Vantage Compute](https://www.vantagecompute.ai).
