@@ -63,6 +63,8 @@ def __init__(self, repositories_cfg, builder_cfg, registry_cfg):
63
63
builder_cfg ["builder_home" ], "files" , "run_build.sh" )
64
64
self .get_workflow_script = os .path .join (
65
65
builder_cfg ["builder_home" ], "files" , "get_workflow.sh" )
66
+ self .spack_build_script = os .path .join (
67
+ builder_cfg ["builder_home" ], "files" , "build_spack.sh" )
66
68
self .singularity_sudo = builder_cfg ['singularity_sudo' ]
67
69
68
70
def _update_dockerfile (self , tmp_folder , step_id , machine , debs , pips ):
@@ -128,11 +130,8 @@ def _update_configuration(self, workflow_folder_path, machine):
128
130
environment ['spack' ]['config' ] = {
129
131
'shared_linking' : {'type' : 'runpath' }}
130
132
environment ['spack' ]['view' ] = "/opt/view"
131
- else :
132
- raise Exception (
133
- "Incorrect spack environment. Not containing the spack tag." )
134
- with open (os .path .join (workflow_folder_path , "spack.yaml" ), 'w' ) as file :
135
- yaml .dump (environment , file , default_flow_style = False )
133
+ with open (os .path .join (workflow_folder_path , "spack.yaml" ), 'w' ) as file :
134
+ yaml .dump (environment , file , default_flow_style = False )
136
135
return debs , pips
137
136
138
137
def _generate_build_environment (self , logger , tmp_folder , workflow , machine , path ):
@@ -142,6 +141,7 @@ def _generate_build_environment(self, logger, tmp_folder, workflow, machine, pat
142
141
debs , pips = self ._update_configuration (workflow_folder_path , machine )
143
142
software_repo_path = os .path .join (
144
143
tmp_folder , os .path .basename (self .software_repository ))
144
+ shutil .copy2 (self .spack_build_script , tmp_folder )
145
145
shutil .copytree (self .software_repository , software_repo_path )
146
146
spack_cfg_path = os .path .join (tmp_folder , ".spack" )
147
147
shutil .copytree (self .spack_cfg , spack_cfg_path )
0 commit comments