@@ -169,29 +169,92 @@ resource "google_storage_bucket_object" "nodeset_tpu_config" {
169169locals {
170170 build_dir = abspath (" ${ path . module } /build" )
171171
172- slurm_gcp_devel_zip = " slurm-gcp-devel.zip"
173- slurm_gcp_devel_zip_bucket = format (" %s/%s" , local. bucket_dir , local. slurm_gcp_devel_zip )
172+ slurm_gcp_devel_controller_zip = " slurm-gcp-devel-controller.zip"
173+ slurm_gcp_devel_compute_zip = " slurm-gcp-devel.zip"
174+ slurm_gcp_devel_zip_bucket = format (" %s/%s" , local. bucket_dir , local. slurm_gcp_devel_controller_zip )
175+ slurm_gcp_devel_compute_zip_bucket = format (" %s/%s" , local. bucket_dir , local. slurm_gcp_devel_compute_zip )
176+
177+ controller_files = [
178+ " tools/gpu-test" ,
179+ " tools/task-epilog" ,
180+ " tools/task-prolog" ,
181+ " conf.py" ,
182+ " file_cache.py" ,
183+ " get_tpu_vmcount.py" ,
184+ " job_submit.lua.tpl" ,
185+ " load_bq.py" ,
186+ " local_pubsub.py" ,
187+ " mig_flex.py" ,
188+ " resume_wrapper.sh" ,
189+ " resume.py" ,
190+ " setup_network_storage.py" ,
191+ " setup.py" ,
192+ " slurmsync.py" ,
193+ " sort_nodes.py" ,
194+ " suspend_wrapper.sh" ,
195+ " suspend.py" ,
196+ " tpu.py" ,
197+ " util.py" ,
198+ " watch_delete_vm_op.py" ,
199+ ]
200+
201+ compute_files = [
202+ " tools/gpu-test" ,
203+ " tools/task-epilog" ,
204+ " tools/task-prolog" ,
205+ " file_cache.py" ,
206+ " get_tpu_vmcount.py" ,
207+ " job_submit.lua.tpl" ,
208+ " local_pubsub.py" ,
209+ " mig_flex.py" ,
210+ " setup_network_storage.py" ,
211+ " setup.py" ,
212+ " slurmsync.py" ,
213+ " sort_nodes.py" ,
214+ " suspend.py" ,
215+ " tpu.py" ,
216+ " util.py" ,
217+ " watch_delete_vm_op.py" ,
218+ ]
174219}
175220
176- data "archive_file" "slurm_gcp_devel_zip " {
177- output_path = " ${ local . build_dir } /${ local . slurm_gcp_devel_zip } "
221+ data "archive_file" "slurm_gcp_devel_controller_zip " {
222+ output_path = " ${ local . build_dir } /${ local . slurm_gcp_devel_controller_zip } "
178223 type = " zip"
179- source_dir = local. scripts_dir
180224
181- excludes = flatten ([
182- fileset (local. scripts_dir , " tests/**" ),
183- # TODO: consider removing (including nested) __pycache__ and all .* files
184- # Though it only affects developers
185- ])
225+ dynamic "source" {
226+ for_each = local. controller_files
227+ content {
228+ content = file (" ${ local . scripts_dir } /${ source . value } " )
229+ filename = source. value
230+ }
231+ }
232+ }
233+
234+ data "archive_file" "slurm_gcp_devel_compute_zip" {
235+ output_path = " ${ local . build_dir } /${ local . slurm_gcp_devel_compute_zip } "
236+ type = " zip"
186237
238+ dynamic "source" {
239+ for_each = local. compute_files
240+ content {
241+ content = file (" ${ local . scripts_dir } /${ source . value } " )
242+ filename = source. value
243+ }
244+ }
187245}
188246
189247resource "google_storage_bucket_object" "devel" {
190248 bucket = var. bucket_name
191249 name = local. slurm_gcp_devel_zip_bucket
192- source = data. archive_file . slurm_gcp_devel_zip . output_path
250+ source = data. archive_file . slurm_gcp_devel_controller_zip . output_path
193251}
194252
253+ resource "google_storage_bucket_object" "devel_compute" {
254+ bucket = var. bucket_name
255+ name = local. slurm_gcp_devel_compute_zip_bucket
256+ source = data. archive_file . slurm_gcp_devel_compute_zip . output_path
257+ }
195258
196259# ##########
197260# SCRIPTS #
0 commit comments