chore(ollama): add Ollama module and job specification
All checks were successful
Lint / lint (push) Successful in 1m39s
Terraform Plan and Apply / cicd (push) Successful in 1m17s

This commit is contained in:
Ben Martin 2025-03-20 01:06:47 +00:00
parent 2165540e58
commit 7a63a072b3
Signed by: ben
GPG key ID: 859A655FCD290E4A
3 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,49 @@
job "ollama" {
group "ollama" {
network {
port "api" {
static = 11434
}
}
ephemeral_disk {
migrate = true
size = 5000
}
task "ollama" {
driver = "docker"
constraint {
attribute = "${node.unique.name}"
value = "Hestia"
}
config {
image = "ollama/ollama:latest"
runtime = "nvidia"
ports = ["api"]
volumes = [
"alloc/data/:/root/.ollama"
]
}
env {
NVIDIA_DRIVER_CAPABILITIES = "all"
NVIDIA_VISIBLE_DEVICES = "all"
}
resources {
cpu = 100
memory = 1024
}
}
service {
provider = "consul"
port = "api"
}
}
}

3
modules/ollama/main.tf Normal file
View file

@ -0,0 +1,3 @@
resource "nomad_job" "ollama" {
jobspec = file("${path.module}/jobspec.nomad.hcl")
}