Terraform modules for deploying components of a Charmed HPC cluster.
The modules
directory contains modules that make use of the
Juju Terraform Provider to interact with a
previously bootstrapped Juju controller.
Furthermore, the examples
directory offers example deployments that can be copy-pasted
to kickstart your own deployments.
A Juju 3.x controller bootstrapped on your choice of cloud is required. Steps for deploying:
# Prerequisites
juju bootstrap <cloud name> <controller name>
sudo snap install --classic opentofu
Then, create a Terraform plan to deploy the core components:
terraform {
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.16.0"
}
}
}
provider "juju" {}
resource "juju_model" "charmed-hpc" {
name = "charmed-hpc"
}
## MySQL - provides backing database for the accounting node.
module "mysql" {
source = "git::https://github.com/canonical/mysql-operator//terraform"
juju_model_name = juju_model.charmed-hpc.name
app_name = "mysql"
channel = "8.0/stable"
units = 1
}
module "slurm" {
source = "git::https://github.com/charmed-hpc/charmed-hpc-terraform//modules/slurm"
model_name = juju_model.charmed-hpc.name
database_backend = {
name = module.mysql.application_name,
endpoint = module.mysql.provides.database
}
# Optional settings for the controller node.
controller = {
app_name = "slurmctld"
}
# Optional settings for the database node.
database = {
app_name = "slurmdbd"
}
# Optional settings for the REST API node.
rest_api = {
app_name = "slurmrestd"
}
# Optional settings for the kiosk node.
kiosk = {
app_name = "sackd",
units = 1,
}
# Compute partitions to be deployed.
compute_partitions = {
"default" : {
units = 1,
},
"gpu" : {
units = 1,
}
}
depends_on = [
juju_model.charmed-hpc
]
}
Finally, plan and deploy!
tofu init
tofu plan
tofu apply -auto-approve
To learn more about the deployment and use of a Charmed HPC cluster, the following resources are available:
A useful command to help while hacking on the plans is:
just check # Checks file formatting and syntax are valid.
If you're interested in contributing, take a look at our contributing guidelines.
The Charmed HPC Terraform plans are a project of the Ubuntu High-Performance Computing community. Interested in contributing bug fixes, patches, documentation, or feedback? Want to join the Ubuntu HPC community? You’ve come to the right place!
Here’s some links to help you get started with joining the community:
- Ubuntu Code of Conduct
- Contributing guidelines
- Join the conversation on Matrix
- Get the latest news on Discourse
- Ask and answer questions on GitHub
The Charmed HPC Terraform plans are free software, distributed under the Apache Software License, version 2.0. See the Apache-2.0 LICENSE file for further details.