source: flex_extract.git/setup_bologna.sh

dev
Last change on this file was c31ee05, checked in by Anne Tipka <anne.tipka@…>, 18 months ago

added loading of ecaccess module in submit script and adjusted installscript to Bologna environment

  • Property mode set to 100755
File size: 3.1 KB
Line 
1#!/bin/bash
2#
3# @Author: Anne Philipp
4#
5# @Date: September, 10 2018
6#
7# @Description:
8#    This file defines the flex_extract's available installation
9#    parameters and puts them together for the call of the actual
10#    python installation script. It also does some checks to
11#    guarantee necessary parameters were set.
12#
13# @Changes:
14#    July 2022 - Anne Tipka (formerly Philipp)
15#      - adapted for the use on  ECWMF Bologna servers
16#
17# @Licence:
18#    (C) Copyright 2014-2020.
19#
20#    SPDX-License-Identifier: CC-BY-4.0
21#
22#    This work is licensed under the Creative Commons Attribution 4.0
23#    International License. To view a copy of this license, visit
24#    http://creativecommons.org/licenses/by/4.0/ or send a letter to
25#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
26#
27# -----------------------------------------------------------------
28# AVAILABLE COMMANDLINE ARGUMENTS TO SET
29#
30# THE USER HAS TO SPECIFY THESE PARAMETERS
31#
32TARGET='ecs'
33MAKEFILE='makefile_atosecs'
34ECUID='<username>'
35ECGID='<groupID>'
36GATEWAY='<gatewayname>'
37DESTINATION='<username>@genericSftp'
38INSTALLDIR=None
39JOB_TEMPLATE=''
40CONTROLFILE='CONTROL_EA5'
41# -----------------------------------------------------------------
42#
43# AFTER THIS LINE THE USER DOES NOT HAVE TO CHANGE ANYTHING !!!
44#
45# -----------------------------------------------------------------
46
47# PATH TO INSTALLATION SCRIPT
48script="Source/Python/install.py"
49
50# INITIALIZE EMPTY PARAMETERLIST
51parameterlist=""
52
53# CHECK IF ON ECMWF SERVER;
54if [[ $EC_CLUSTER == "ecs" ]] || [[ $EC_CLUSTER == "aa"* ]] || [[ $EC_CLUSTER == "ab"* ]] || [[ $EC_CLUSTER == "ac"* ]] || [[ $EC_CLUSTER == "ad"* ]]; then
55# LOAD PYTHON3 AND ECACCESS MODULES
56  module load python3 ecaccess
57fi 
58
59# DEFAULT PARAMETERLIST
60if [ -n "$TARGET" ]; then
61  parameterlist=" --target=$TARGET"
62else
63  echo "ERROR: No installation target specified."
64  echo "EXIT WITH ERROR"
65  exit
66fi
67
68# CHECK FOR MORE PARAMETER
69if [ "$TARGET" == "ecs" ] || [ "$TARGET" == "hpc" ] ; then
70  # check if necessary Parameters are set
71  if [ -z "$ECUID" ] || [ -z "$ECGID" ] || [ "$ECUID" == "<username>" ] || [ "$ECGID" == "<groupID>" ] ; then
72    echo "ERROR: At least one of the following parameters are not properly set: ECUID or ECGID!"
73    echo "EXIT WITH ERROR"
74    exit
75  else
76    parameterlist+=" --ecuid=$ECUID --ecgid=$ECGID --gateway=$GATEWAY --destination=$DESTINATION"
77  fi
78  if [ -z "$GATEWAY" ] || [ -z "$DESTINATION" ] || [ "$GATEWAY" == "<gatewayname>" ] || [ "$DESTINATION" == "<username>@genericSftp" ] ; then
79    echo "WARNING: Not setting parameters GATEWAY and DESTINATION means there will be no file transfer to local gateway server."
80  fi
81fi
82if [ -n "$MAKEFILE" ]; then
83  parameterlist+=" --makefile=$MAKEFILE"
84fi
85if [ -n "$FLEXPARTDIR" ]; then # not empty
86  parameterlist+=" --flexpartdir=$FLEXPARTDIR"
87fi
88if [ -n "$JOB_TEMPLATE" ]; then
89  parameterlist+=" --job_template=$JOB_TEMPLATE"
90fi
91if [ -n "$CONTROLFILE" ]; then
92  parameterlist+=" --controlfile=$CONTROLFILE"
93fi
94
95# -----------------------------------------------------------------
96# CALL INSTALLATION SCRIPT WITH DETERMINED COMMANDLINE ARGUMENTS
97
98$script $parameterlist
99
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG