Changeset 274f9ef in flex_extract.git for source/python/install.py
- Timestamp:
- Oct 22, 2018, 11:44:47 AM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- db27c09
- Parents:
- 708c667
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/install.py
rc5074d2 r274f9ef 66 66 # ------------------------------------------------------------------------------ 67 67 def main(): 68 ''' 69 @Description: 70 Controls the installation process. Calls the installation function 71 if target is specified. 72 73 @Intput: 74 <nothing> 75 76 @Return: 77 <nothing> 68 '''Controls the installation process. Calls the installation function 69 if target is specified. 70 71 Parameters 72 ---------- 73 74 Return 75 ------ 78 76 ''' 79 77 … … 88 86 89 87 def get_install_cmdline_arguments(): 90 ''' 91 @Description: 92 Decomposes the command line arguments and assigns them to variables. 93 Apply default values for non mentioned arguments. 94 95 @Input: 96 <nothing> 97 98 @Return: 99 args: instance of ArgumentParser 100 Contains the commandline arguments from script/program call. 88 '''Decomposes the command line arguments and assigns them to variables. 89 Apply default values for non mentioned arguments. 90 91 Parameters 92 ---------- 93 94 Return 95 ------ 96 args : :obj:`Namespace` 97 Contains the commandline arguments from script/program call. 101 98 ''' 102 99 parser = ArgumentParser(description='Install flex_extract software locally or \ … … 139 136 140 137 def install_via_gateway(c): 141 ''' 142 @Description: 143 Perform the actual installation on local machine or prepare data 144 transfer to remote gate and submit a job script which will 145 install everything on the remote gate. 146 147 @Input: 148 c: instance of class ControlFile 149 Contains all the parameters of CONTROL file and 150 command line. 151 For more information about format and content of the parameter 152 see documentation. 153 154 @Return: 155 <nothing> 138 '''Perform the actual installation on local machine or prepare data 139 transfer to remote gate and submit a job script which will 140 install everything on the remote gate. 141 142 Parameters 143 ---------- 144 c : :obj:`ControlFile` 145 Contains all the parameters of CONTROL file and 146 command line. 147 148 Return 149 ------ 150 156 151 ''' 157 152 import tarfile … … 224 219 225 220 def mk_tarball(tarball_path, target): 226 ''' 227 @Description:228 Creates a tarball with all necessary files which need to be sent to the229 installation directory.230 It does not matter if this is local or remote.231 Collects all python files, the Fortran source and makefiles,232 the ECMWF_ENV file, the CONTROL files as well as the 233 template files.234 235 @Input:236 tarball_path: string237 The complete path to the tar file which will contain all238 relevant data for flex_extract. 239 240 target: string241 The queue where the job is submitted to. 242 243 @Return:244 <nothing> 221 '''Creates a tarball with all necessary files which need to be sent to the 222 installation directory. 223 It does not matter if this is local or remote. 224 Collects all python files, the Fortran source and makefiles, 225 the ECMWF_ENV file, the CONTROL files as well as the 226 template files. 227 228 Parameters 229 ---------- 230 tarball_path : :obj:`string` 231 The complete path to the tar file which will contain all 232 relevant data for flex_extract. 233 234 target : :obj:`string` 235 The queue where the job is submitted to. 236 237 Return 238 ------ 239 245 240 ''' 246 241 import tarfile … … 294 289 295 290 def un_tarball(tarball_path): 296 ''' 297 @Description: 298 Extracts the given tarball into current directory.299 300 @Input:301 tarball_path: string302 The complete path to the tar file which will contain all303 relevant data for flex_extract. 304 305 @Return:306 <nothing> 291 '''Extracts the given tarball into current directory. 292 293 Parameters 294 ---------- 295 tarball_path : :obj:`string` 296 The complete path to the tar file which will contain all 297 relevant data for flex_extract. 298 299 Return 300 ------ 301 307 302 ''' 308 303 import tarfile … … 316 311 317 312 def mk_env_vars(ecuid, ecgid, gateway, destination): 318 ''' 319 @Description:320 Creates a file named ECMWF_ENV which contains the321 necessary environmental variables at ECMWF servers. 322 It is based on the template ECMWF_ENV.template.323 324 @Input:325 ecuid: string326 The user id on ECMWF server. 327 328 ecgid: string329 The group id on ECMWF server. 330 331 gateway: string332 The gateway server the user is using. 333 334 destination: string335 The remote destination which is used to transfer files336 from ECMWF server to local gateway server. 337 338 @Return:339 <nothing> 313 '''Creates a file named ECMWF_ENV which contains the 314 necessary environmental variables at ECMWF servers. 315 It is based on the template ECMWF_ENV.template. 316 317 Parameters 318 ---------- 319 ecuid : :obj:`string` 320 The user id on ECMWF server. 321 322 ecgid : :obj:`string` 323 The group id on ECMWF server. 324 325 gateway : :obj:`string` 326 The gateway server the user is using. 327 328 destination : :obj:`string` 329 The remote destination which is used to transfer files 330 from ECMWF server to local gateway server. 331 332 Return 333 ------ 334 340 335 ''' 341 336 from genshi.template.text import NewTextTemplate … … 358 353 359 354 def mk_compilejob(makefile, target, ecuid, ecgid, fp_root): 360 ''' 361 @Description:362 Modifies the original job template file so that it is specified363 for the user and the environment were it will be applied. Result 364 is stored in a new file "job.temp" in the python directory.365 366 @Input:367 makefile: string368 Name of the makefile which should be used to compile FORTRAN369 CONVERT2 program. 370 371 target: string372 The target where the installation should be done, e.g. the queue. 373 374 ecuid: string375 The user id on ECMWF server. 376 377 ecgid: string378 The group id on ECMWF server. 379 380 fp_root: string381 Path to the root directory of FLEXPART environment or flex_extract382 environment. 383 384 @Return:385 <nothing> 355 '''Modifies the original job template file so that it is specified 356 for the user and the environment were it will be applied. Result 357 is stored in a new file "job.temp" in the python directory. 358 359 Parameters 360 ---------- 361 makefile : :obj:`string` 362 Name of the makefile which should be used to compile FORTRAN 363 CONVERT2 program. 364 365 target : :obj:`string` 366 The target where the installation should be done, e.g. the queue. 367 368 ecuid : :obj:`string` 369 The user id on ECMWF server. 370 371 ecgid : :obj:`string` 372 The group id on ECMWF server. 373 374 fp_root : :obj:`string` 375 Path to the root directory of FLEXPART environment or flex_extract 376 environment. 377 378 Return 379 ------ 380 386 381 ''' 387 382 from genshi.template.text import NewTextTemplate … … 413 408 414 409 def mk_job_template(ecuid, ecgid, gateway, destination, fp_root): 415 ''' 416 @Description:417 Modifies the original job template file so that it is specified418 for the user and the environment were it will be applied. Result 419 is stored in a new file.420 421 @Input:422 ecuid: string423 The user id on ECMWF server. 424 425 ecgid: string426 The group id on ECMWF server. 427 428 gateway: string429 The gateway server the user is using. 430 431 destination: string432 The remote destination which is used to transfer files433 from ECMWF server to local gateway server. 434 435 fp_root: string436 Path to the root directory of FLEXPART environment or flex_extract437 environment. 438 439 @Return:440 <nothing> 410 '''Modifies the original job template file so that it is specified 411 for the user and the environment were it will be applied. Result 412 is stored in a new file. 413 414 Parameters 415 ---------- 416 ecuid : :obj:`string` 417 The user id on ECMWF server. 418 419 ecgid : :obj:`string` 420 The group id on ECMWF server. 421 422 gateway : :obj:`string` 423 The gateway server the user is using. 424 425 destination : :obj:`string` 426 The remote destination which is used to transfer files 427 from ECMWF server to local gateway server. 428 429 fp_root : :obj:`string` 430 Path to the root directory of FLEXPART environment or flex_extract 431 environment. 432 433 Return 434 ------ 435 441 436 ''' 442 437 from genshi.template.text import NewTextTemplate … … 467 462 468 463 def delete_convert_build(src_path): 469 ''' 470 @Description:471 Clean up the Fortran source directory and remove all 472 build files (e.g. *.o, *.mod and CONVERT2)473 474 @Input:475 src_path: string476 Path to the fortran source directory. 477 478 @Return:479 <nothing> 464 '''Clean up the Fortran source directory and remove all 465 build files (e.g. \*.o, \*.mod and CONVERT2) 466 467 Parameters 468 ---------- 469 src_path : :obj:`string` 470 Path to the fortran source directory. 471 472 Return 473 ------ 474 480 475 ''' 481 476 … … 491 486 492 487 def make_convert_build(src_path, makefile): 493 ''' 494 @Description: 495 Compiles the Fortran code and generates the executable.496 497 @Input:498 src_path: string499 Path to the fortran source directory. 500 501 makefile: string502 The name of the makefile which should be used. 503 504 @Return:505 <nothing> 488 '''Compiles the Fortran code and generates the executable. 489 490 Parameters 491 ---------- 492 src_path : :obj:`string` 493 Path to the fortran source directory. 494 495 makefile : :obj:`string` 496 The name of the makefile which should be used. 497 498 Return 499 ------ 500 506 501 ''' 507 502
Note: See TracChangeset
for help on using the changeset viewer.