Changeset 25b14be in flex_extract.git for source/python/install.py
- Timestamp:
- Sep 23, 2018, 11:40:28 AM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 4971f63
- Parents:
- 5d42acd
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
source/python/install.py
r2fb99de r25b14be 58 58 # software specific classes and modules from flex_extract 59 59 import _config 60 from ControlFile import ControlFile61 from UioFiles import UioFiles62 from tools import make_dir, put_file_to_ecserver, submit_job_to_ecserver60 from classes.ControlFile import ControlFile 61 from classes.UioFiles import UioFiles 62 from mods.tools import make_dir, put_file_to_ecserver, submit_job_to_ecserver 63 63 64 64 # ------------------------------------------------------------------------------ … … 189 189 mk_env_vars(c.ecuid, c.ecgid, c.gateway, c.destination) 190 190 191 mk_tarball(tar_file )191 mk_tarball(tar_file, c.install_target) 192 192 193 193 put_file_to_ecserver(ecd, tarball_name, c.install_target, … … 195 195 196 196 submit_job_to_ecserver(c.install_target, 197 os.path.join(_config.PATH_REL ATIVE_JOBSCRIPTS,197 os.path.join(_config.PATH_REL_JOBSCRIPTS, 198 198 _config.FILE_INSTALL_COMPILEJOB)) 199 199 … … 214 214 c.flexpart_root_scripts)) 215 215 if os.path.abspath(ecd) != os.path.abspath(c.flexpart_root_scripts): 216 mk_tarball(tar_file )216 mk_tarball(tar_file, c.install_target) 217 217 make_dir(os.path.join(c.flexpart_root_scripts, 218 218 target_dirname)) … … 222 222 os.chdir(os.path.join(c.flexpart_root_scripts, 223 223 target_dirname, 224 _config.PATH_REL ATIVE_FORTRAN_SRC))224 _config.PATH_REL_FORTRAN_SRC)) 225 225 226 226 # Create Fortran executable - CONVERT2 … … 238 238 return 239 239 240 def mk_tarball(tarball_path ):240 def mk_tarball(tarball_path, target): 241 241 ''' 242 242 @Description: … … 253 253 relevant data for flex_extract. 254 254 255 target: string 256 The queue where the job is submitted to. 257 255 258 @Return: 256 259 <nothing> … … 267 270 268 271 # get lists of the files to be added to the tar file 269 ECMWF_ENV_FILE = [_config.PATH_RELATIVE_ECMWF_ENV] 272 if target == 'local': 273 ECMWF_ENV_FILE = [] 274 else: 275 ECMWF_ENV_FILE = [_config.PATH_REL_ECMWF_ENV] 276 270 277 pyfiles = [os.path.relpath(x, ecd) 271 for x in glob(_config.PATH_LOCAL_PYTHON + 272 os.path.sep + '*py')] 278 for x in UioFiles(_config.PATH_LOCAL_PYTHON, '*py').files] 273 279 controlfiles = [os.path.relpath(x, ecd) 274 for x in glob(_config.PATH_CONTROLFILES +275 os.path.sep + 'CONTROL*')]280 for x in UioFiles(_config.PATH_CONTROLFILES, 281 'CONTROL*').files] 276 282 tempfiles = [os.path.relpath(x, ecd) 277 for x in glob(_config.PATH_TEMPLATES + 278 os.path.sep + '*')] 283 for x in UioFiles(_config.PATH_TEMPLATES , '*').files] 279 284 ffiles = [os.path.relpath(x, ecd) 280 for x in glob(_config.PATH_FORTRAN_SRC + 281 os.path.sep + '*.f*')] 285 for x in UioFiles(_config.PATH_FORTRAN_SRC, '*.f*').files] 282 286 hfiles = [os.path.relpath(x, ecd) 283 for x in glob(_config.PATH_FORTRAN_SRC + 284 os.path.sep + '*.h')] 287 for x in UioFiles(_config.PATH_FORTRAN_SRC, '*.h').files] 285 288 makefiles = [os.path.relpath(x, ecd) 286 for x in glob(_config.PATH_FORTRAN_SRC + 287 os.path.sep + 'Makefile*')] 289 for x in UioFiles(_config.PATH_FORTRAN_SRC, 'Makefile*').files] 288 290 289 291 # concatenate single lists to one for a better looping … … 352 354 ''' 353 355 354 with open(_config.PATH_REL ATIVE_ECMWF_ENV, 'w') as fo:356 with open(_config.PATH_REL_ECMWF_ENV, 'w') as fo: 355 357 fo.write('ECUID ' + ecuid + '\n') 356 358 fo.write('ECGID ' + ecgid + '\n') … … 389 391 ''' 390 392 391 template = os.path.join(_config.PATH_REL ATIVE_TEMPLATES,393 template = os.path.join(_config.PATH_REL_TEMPLATES, 392 394 _config.TEMPFILE_INSTALL_COMPILEJOB) 393 395 with open(template) as f: 394 396 fdata = f.read().split('\n') 395 397 396 compilejob = os.path.join(_config.PATH_REL ATIVE_JOBSCRIPTS,398 compilejob = os.path.join(_config.PATH_REL_JOBSCRIPTS, 397 399 _config.FILE_INSTALL_COMPILEJOB) 398 400 with open(compilejob, 'w') as fo: … … 450 452 ''' 451 453 fp_root_path_to_python = os.path.join(fp_root, _config.FLEXEXTRACT_DIRNAME, 452 _config.PATH_REL ATIVE_PYTHON)453 454 template = os.path.join(_config.PATH_REL ATIVE_TEMPLATES,454 _config.PATH_REL_PYTHON) 455 456 template = os.path.join(_config.PATH_REL_TEMPLATES, 455 457 _config.TEMPFILE_INSTALL_JOB) 456 458 with open(template) as f: 457 459 fdata = f.read().split('\n') 458 460 459 jobfile_temp = os.path.join(_config.PATH_REL ATIVE_TEMPLATES,461 jobfile_temp = os.path.join(_config.PATH_REL_TEMPLATES, 460 462 _config.TEMPFILE_JOB) 461 463 with open(jobfile_temp, 'w') as fo:
Note: See TracChangeset
for help on using the changeset viewer.