Packaging Guide¶
This guide covers how to build and install RPM and DEB packages for CraneSched.
Overview¶
CraneSched uses CPack to generate packages for easy distribution and installation. The build system supports creating both RPM (for Red Hat-based systems) and DEB (for Debian-based systems) packages.
Package Components¶
Tip
Frontend components are not included in these packages. Please refer to the Frontend Deployment Guide for frontend installation.
CraneSched is divided into two main package components:
- cranectld - Control daemon package (for control nodes)
- craned - Execution daemon package (for compute nodes)
Each package includes:
- Binary executables
- Systemd service files
- Configuration file templates
- PAM security module (for craned package)
Prerequisites¶
Before building packages, ensure you have:
- Built CraneSched - Complete the build process as described in the Rocky Linux 9 or CentOS 7 guides
- CMake 3.24+ - Required for package generation
- RPM tools (for RPM packages):
- DEB tools (for DEB packages):
Building Packages¶
1. Configure and Build¶
Navigate to your build directory and ensure the project is properly configured:
cd CraneSched/build
# For CGroup v1 (default)
cmake -G Ninja ..
# For CGroup v2
cmake -G Ninja .. -DCRANE_ENABLE_CGROUP_V2=true
# Build the project
cmake --build .
Tip
For production deployments, use Release build type:
2. Generate Packages¶
CPack is configured to build both RPM and DEB packages simultaneously:
# Generate both RPM and DEB packages
cpack -G "RPM;DEB"
# Or generate only RPM packages
cpack -G RPM
# Or generate only DEB packages
cpack -G DEB
Info
The default configuration (cpack without -G) generates both RPM and DEB packages.
3. Locate Generated Packages¶
After successful build, packages will be in your build directory:
Expected output (example):
CraneSched-1.1.2-Linux-x86_64-cranectld.rpm
CraneSched-1.1.2-Linux-x86_64-craned.rpm
CraneSched-1.1.2-Linux-x86_64-cranectld.deb
CraneSched-1.1.2-Linux-x86_64-craned.deb
Installing Packages¶
RPM-based Systems¶
Control Node:
Compute Node:
Update existing installation:
DEB-based Systems¶
Control Node:
Compute Node:
Update existing installation:
Package Details¶
cranectld Package¶
Contains files for the control node:
/usr/bin/cranectld # Control daemon binary
/usr/lib/systemd/system/cranectld.service # Systemd service file
/etc/crane/config.yaml.sample # Cluster configuration template
/etc/crane/database.yaml.sample # Database configuration template
Installation Path Differences
The file paths differ depending on the installation method:
When using RPM/DEB packages (cpack):
- Binaries are installed to /usr/bin/ (following FHS standard)
- Example: /usr/bin/cranectld
When using direct installation (cmake --install):
- Binaries are installed to /usr/local/bin/ (default CMAKE_INSTALL_PREFIX)
- Example: /usr/local/bin/cranectld
- You can customize this with cmake --install --prefix=/custom/path
craned Package¶
Contains files for compute nodes:
/usr/bin/craned # Execution daemon binary
/usr/libexec/csupervisor # Per-step execution supervisor
/usr/lib/systemd/system/craned.service # Systemd service file
/etc/crane/config.yaml.sample # Cluster configuration template
/usr/lib64/security/pam_crane.so # PAM authentication module
Installation Path Differences
The file paths differ depending on the installation method:
When using RPM/DEB packages (cpack):
- Binaries are installed to /usr/bin/ (following FHS standard)
- Supervisor is installed to /usr/libexec/
- Examples: /usr/bin/craned, /usr/libexec/csupervisor
When using direct installation (cmake --install):
- Binaries are installed to /usr/local/bin/ (default CMAKE_INSTALL_PREFIX)
- Supervisor is installed to /usr/local/libexec/
- Examples: /usr/local/bin/craned, /usr/local/libexec/csupervisor
- You can customize this with cmake --install --prefix=/custom/path
Post-Installation Actions¶
Both packages include a post-installation script that automatically:
- Creates the
cranesystem user (if not exists) - Creates
/var/cranedirectory with appropriate permissions - Creates
/etc/cranedirectory - Copies sample configuration files to
/etc/crane/config.yaml(if not exists) - Copies database configuration to
/etc/crane/database.yaml(if not exists, cranectld only) - Sets appropriate file ownership and permissions