From 67760ce3511447a9884f5fe4fd615d008665b9db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Wed, 29 Jan 2025 16:57:41 +0000
Subject: [PATCH] Add GPU node at SafeSpring production2

---
 eosc-production2/inventory/1-safespring.yaml | 1 +
 eosc-production2/terraform/terraform.tfvars  | 5 ++---
 eosc-production2/terraform/vms.tf            | 7 +++++++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/eosc-production2/inventory/1-safespring.yaml b/eosc-production2/inventory/1-safespring.yaml
index c400cba..300d822 100644
--- a/eosc-production2/inventory/1-safespring.yaml
+++ b/eosc-production2/inventory/1-safespring.yaml
@@ -30,6 +30,7 @@ worker:
 
 gpu:
   hosts:
+    2001:6b0:7d:40::46f:
 
 # using public IP of kube_server for ansible delegate_to
 kube_server:
diff --git a/eosc-production2/terraform/terraform.tfvars b/eosc-production2/terraform/terraform.tfvars
index a4ad481..131be9c 100644
--- a/eosc-production2/terraform/terraform.tfvars
+++ b/eosc-production2/terraform/terraform.tfvars
@@ -7,14 +7,13 @@ site_name = "production2"
 # These may need some adjustment for your provider
 master_flavor_name = "l2.c4r8.100"
 worker_flavor_name = "l2.c16r32.100"
-# XXX: replace this for GPU flavor, once available
-gpu_flavor_name = "l2.c2r4.100"
+gpu_flavor_name = "b2.c64r128g1"
 
 # Number of extra workers
 extra_workers = 8
 
 # Number of GPU workers
-gpu_workers = 0
+gpu_workers = 1
 
 # volumes for docker
 docker_volumes_size = 384
diff --git a/eosc-production2/terraform/vms.tf b/eosc-production2/terraform/vms.tf
index c59595e..5c012c7 100644
--- a/eosc-production2/terraform/vms.tf
+++ b/eosc-production2/terraform/vms.tf
@@ -86,6 +86,13 @@ resource "openstack_compute_instance_v2" "gpu" {
   network {
     name = var.net_name
   }
+  block_device {
+    uuid                  = data.openstack_images_image_v2.ubuntu.id
+    source_type           = "image"
+    destination_type      = "volume"
+    delete_on_termination = true
+    volume_size           = 100
+  }
 }
 
 resource "openstack_blockstorage_volume_v3" "nfs-volume" {
-- 
GitLab