SlurmStack is a lightweight, automated tool for provisioning a SLURM cluster on OpenStack. Built with Ansible for Rocky Linux 9, this project focuses on providing a minimal, uncomplicated configuration that is easy to modify and run manually. Because it includes a native deployment of slurmrestd, SlurmStack is ideal for setting up a preproduction environment to test or develop services based on the SLURM REST API.
Note
This project is designed for testing and development. Whilst it can be modified for production use, it should not be considered production-ready out of the box.
Consider using Slinky for a more complete production ready solution.
Requirements
- Python 3.11+
- pip
Clone the repository and install the Python/Ansible dependencies:
git clone <repo-url>
cd slurmstack
pip install -e .
ansible-galaxy collection install -r requirements.ymlThe following must be in place within your OpenStack project before running SlurmStack.
OpenStack credentials
The OpenStack credentials can be set using a clouds.yaml file, or via the respective environment variables within .env.
To obtain a clouds.yaml file from your OpenStack Horizon dashboard, do the following:
- Log into Horizon
- On the left bar, click Identity.
- Under Identity, click "Application Credentials".
- Click the "+ Create Application Credentials" button in the top bar.
- You must provide at least a name.
- Click "Create Application Credential" at the bottom of the page.
- Click Download clouds.yaml.
You can also create a clouds.yaml file manually using the provided example:
cp clouds.yaml.example clouds.yamlRocky Linux 9 image
A Rocky Linux 9 image must be available in your OpenStack project. The image name is set via SS_IMAGE. Base images can be found on the Rocky Linux download webpage.
Network
A network must exist for the OpenStack project, which must be accessible to the VMs. The network name can be set via SS_NETWORK.
Security groups
One or more security groups must be pre-created in OpenStack and assigned to the VMs via SS_SECGROUP. At a minimum, the groups should allow:
- SSH (port 22) from your control machine
- All internal traffic between cluster nodes
SSH key pair
An SSH key pair must be registered in OpenStack, and the corresponding private key must be accessible on the machine running SlurmStack. Set the path via SS_ANSIBLE_KEY. Ansible uses this key to connect to the provisioned VMs.
if ansible fails run: ansible-playbook -i inventory_<cluster-name>.json --private-key /path/to/key playbooks/deploy_nodes.yml