@@ -159,18 +159,30 @@ source "openstack" "openhpc" {
159
159
image_visibility = " ${ var . image_visibility } "
160
160
}
161
161
162
- # The "fat" image build with all binaries :
162
+ # "fat" image builds :
163
163
build {
164
+
165
+ # non-CUDA:
164
166
source "source.openstack.openhpc" {
167
+ name = " openhpc"
165
168
floating_ip_network = " ${ var . floating_ip_network } "
166
169
source_image = " ${ var . fatimage_source_image [var . os_version ]} "
167
170
source_image_name = " ${ var . fatimage_source_image_name [var . os_version ]} " # NB: must already exist in OpenStack
168
171
image_name = " ${ source . name } -${ var . os_version } -${ local . timestamp } -${ substr (local. git_commit , 0 , 8 )} " # similar to name from slurm_image_builder
169
172
}
170
173
174
+ # CUDA:
175
+ source "source.openstack.openhpc" {
176
+ name = " openhpc-cuda" # this is the only difference from the above
177
+ floating_ip_network = " ${ var . floating_ip_network } "
178
+ source_image = " ${ var . fatimage_source_image [var . os_version ]} "
179
+ source_image_name = " ${ var . fatimage_source_image_name [var . os_version ]} "
180
+ image_name = " ${ source . name } -${ var . os_version } -${ local . timestamp } -${ substr (local. git_commit , 0 , 8 )} "
181
+ }
182
+
171
183
provisioner "ansible" {
172
184
playbook_file = " ${ var . repo_root } /ansible/fatimage.yml"
173
- groups = [" builder" , " control" , " compute" , " login" ]
185
+ groups = concat ( [" builder" , " control" , " compute" , " login" ], [ for g in split ( " - " , " ${ source . name } " ) : g if g != " openhpc " ])
174
186
keep_inventory_file = true # for debugging
175
187
use_proxy = false # see https://www.packer.io/docs/provisioners/ansible#troubleshooting
176
188
extra_arguments = [" --limit" , " builder" , " -i" , " ${ var . repo_root } /packer/ansible-inventory.sh" , " -vv" , " -e" , " @${ var . repo_root } /packer/${ source . name } _extravars.yml" ]
0 commit comments