Skip to content

Commit 43b6d2a

Browse files
committed
set packer build volume sizes depending on build variant
1 parent f690cbf commit 43b6d2a

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

environments/.stackhpc/ARCUS.pkrvars.hcl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
flavor = "vm.ska.cpu.general.small"
2-
use_blockstorage_volume = true
3-
volume_size = 15 # GB
4-
image_disk_format = "qcow2"
52
networks = ["4b6b2722-ee5b-40ec-8e52-a6610e14cc51"] # portal-internal (DNS broken on ilab-60)
63
ssh_keypair_name = "slurm-app-ci"
74
ssh_private_key_file = "~/.ssh/id_rsa"

environments/.stackhpc/LEAFCLOUD.pkrvars.hcl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
flavor = "ec1.large"
2-
use_blockstorage_volume = true
3-
volume_size = 15 # GB
42
volume_type = "unencrypted"
5-
image_disk_format = "qcow2"
63
networks = ["909e49e8-6911-473a-bf88-0495ca63853c"] # slurmapp-ci
74
ssh_keypair_name = "slurm-app-ci"
85
ssh_private_key_file = "~/.ssh/id_rsa"

packer/openstack.pkr.hcl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,24 @@ variable "manifest_output_path" {
118118
default = "packer-manifest.json"
119119
}
120120

121-
variable "use_blockstorage_volume" {
122-
type = bool
123-
default = false
124-
}
125-
126121
variable "volume_type" {
127122
type = string
128123
default = null
129124
}
130125

131126
variable "volume_size" {
132-
type = number
133-
default = null # When not specified use the size of the builder instance root disk
127+
type = map(number)
128+
default = {
129+
# fat image builds, GB:
130+
openhpc = 15
131+
openhpc-ofed = 15
132+
openhpc-cuda = 25
133+
}
134134
}
135135

136136
variable "image_disk_format" {
137137
type = string
138-
default = null # When not specified use the image default
138+
default = "qcow2"
139139
}
140140

141141
variable "metadata" {
@@ -157,13 +157,13 @@ variable "groups" {
157157
source "openstack" "openhpc" {
158158
# Build VM:
159159
flavor = var.flavor
160-
use_blockstorage_volume = var.use_blockstorage_volume
160+
use_blockstorage_volume = true
161161
volume_type = var.volume_type
162+
volume_size = var.volume_size
162163
metadata = var.metadata
163164
networks = var.networks
164165
floating_ip_network = var.floating_ip_network
165166
security_groups = var.security_groups
166-
volume_size = var.volume_size
167167

168168
# Input image:
169169
source_image = "${var.source_image[var.os_version]}"
@@ -179,7 +179,7 @@ source "openstack" "openhpc" {
179179
ssh_bastion_private_key_file = var.ssh_bastion_private_key_file
180180

181181
# Output image:
182-
image_disk_format = var.image_disk_format
182+
image_disk_format = "qcow2"
183183
image_visibility = var.image_visibility
184184
image_name = "${source.name}-${var.os_version}-${local.timestamp}-${substr(local.git_commit, 0, 8)}"
185185
}

0 commit comments

Comments
 (0)