Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 247 lines (207 sloc) 7.831 kB
e633c0d @timf Bug 7009 - All scripts should use shebang /bin/bash
timf authored
1 #!/bin/bash
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
2
3 FORCE_FRESH_INSTALL="yes"
4
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored
5 START_DIR=`pwd`
6
f7b03a5 @timf install output cleanup/normalization
timf authored
7 NIMBUS_SRC_REL="`dirname $0`"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
8 NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
9
54cddac @labisso /bin/sh compatiblity
labisso authored
10 if [ "X$1" = "X" ]; then
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
11 echo ""
12 echo "Usage: $0 destination_dir"
43b8a93 @labisso Echo doesn't also understand newlines.
labisso authored
13 echo " You must specify the destination directory."
14 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
15 exit 1
16 fi
17
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored
18 NIMBUS_REL_BASE_HOME="`dirname $1`"
19 NIMBUS_BASE_HOME=`cd $NIMBUS_REL_BASE_HOME; pwd`
0aab144 catch non existant parent director for the installer
BuzzTroll authored
20
21 if [ ! -e $NIMBUS_REL_BASE_HOME ]; then
22 echo "The parent directory for the installation path $1 must exist"
23 exit 1
24 fi
25
07cd774 patched install program to do relative and abosulte paths
BuzzTroll authored
26 NIMBUS_INST_DIR=`basename $1`
27 NIMBUS_HOME="$NIMBUS_BASE_HOME/$NIMBUS_INST_DIR"
28 echo "NIMBUS_HOME $NIMBUS_HOME"
29
33ae148 @timf use an environment variable instead to fix Bug 7041
timf authored
30 if [ "X$NIMBUS_ALLOW_ROOT_INSTALL" != "Xyes" ] && [ $EUID -eq 0 ]; then
8cb5a4f @labisso Added basic root check to install script.
labisso authored
31 echo ""
33ae148 @timf use an environment variable instead to fix Bug 7041
timf authored
32 echo "It is not recommended to install or run Nimbus as root."
33 echo "If you insist, set the NIMBUS_ALLOW_ROOT_INSTALL environment variable to \"yes\""
8cb5a4f @labisso Added basic root check to install script.
labisso authored
34 echo ""
35 exit 1
36 fi
37
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
38 if [ -d $NIMBUS_HOME ] && [ "$(ls -A $NIMBUS_HOME)" ]; then
54cddac @labisso /bin/sh compatiblity
labisso authored
39 if [ $FORCE_FRESH_INSTALL = "yes" ]; then
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
40 echo ""
41 echo "The destination directory '$NIMBUS_HOME' exists and is not empty."
42 echo "It is not recommended to reinstall Nimbus into an existing install."
43 echo ""
62dcf64 @timf Moved these more esoteric scripts to their own subdirectory
timf authored
44 echo "If you are making changes to the service code, you can build and install those directly:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
45 echo " export GLOBUS_LOCATION=$NIMBUS_HOME/services"
62dcf64 @timf Moved these more esoteric scripts to their own subdirectory
timf authored
46 echo " scripts/jars-build-and-install.sh"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
47 echo ""
48 echo "If you know what you are doing and want to reinstall, edit this script:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
49 echo " $0"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
50 echo "and change FORCE_FRESH_INSTALL to \"no\""
51 echo ""
52
53 exit 1
54 fi
55 fi
56
8afcdff @labisso Moved python check to earlier in install script.
labisso authored
57 if [ "X$PYTHON" = "X" ]; then
58 PYTHON_EXE=`which python`
59 else
60 PYTHON_EXE="$PYTHON"
61 fi
62 # returns 0 if Python 2.5+
63 $PYTHON_EXE -c "import sys; sys.exit(sys.version_info < (2,5))"
64 if [ $? -ne 0 ]; then
65 echo "ERROR: The central Nimbus node must have Python version 2.5 or later (VMM nodes can have 2.4+)."
66 exit 1
67 fi
c7b45ca nice stubs for the 'web' library
BuzzTroll authored
68
69 if [ ! -d $NIMBUS_HOME ]; then
70 mkdir $NIMBUS_HOME
71 fi
72
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
73 # If the dir exists but is not writable, this will also trip that situation early/gracefully.
74 touch $NIMBUS_HOME/install.log
75 if [ $? -ne 0 ]; then
76 echo "ERROR: cannot write install log file: $NIMBUS_HOME/install.log"
77 exit 1
78 fi
79
80 # The install log contains the initial cumulus admin secrets
81 chmod 600 $NIMBUS_HOME/install.log
82 if [ $? -ne 0 ]; then
83 echo "ERROR: cannot chmod install log file: $NIMBUS_HOME/install.log"
84 exit 1
85 fi
86
f7b03a5 @timf install output cleanup/normalization
timf authored
87 echo ""
88 echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
89 echo "Making the Python virtual environment" | tee -a $NIMBUS_HOME/install.log
90 echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
91 echo ""
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
92
237381b ready to push
BuzzTroll authored
93 pyve_path=$NIMBUS_HOME/ve
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
94 echo "Installing from $NIMBUS_SRC"
95
8ed3352 updating the doc to reflect changes that will be in 2.5
BuzzTroll authored
96 cp $NIMBUS_SRC/cumulus/*.egg .
c25af42 @timf added chmod to install.log since the initial admin secret is printed;…
timf authored
97 $PYTHON_EXE $NIMBUS_SRC/cumulus/virtualenv.py -p $PYTHON_EXE $pyve_path | tee -a $NIMBUS_HOME/install.log
98 if [ $PIPESTATUS -ne 0 ]; then
722a0f4 mo code, mo problems.
BuzzTroll authored
99 echo "ERROR: python virtualenv installation failed."
100 exit 1
101 fi
102
071009d No longer downloads twisted. This was fixed by capitalizing the T (p…
BuzzTroll authored
103 $NIMBUS_SRC/libexec/create-nimbus-home $NIMBUS_HOME 2>&1 | tee -a $NIMBUS_HOME/install.log
1470f78 @timf check for Python 2.4 before anything happens
timf authored
104
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored
105 # need PIPESTATUS because tee is not the exit code this needs to check
106 if [ $PIPESTATUS -ne 0 ]; then
f4963f9 @labisso Cleaned up install script output.
labisso authored
107 echo ""
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
108 exit 1
109 fi
110
e40196f @timf Got things working with cumulus.conf instead of @TOKEN@ post-deploy m…
timf authored
111 CUMULUS_ENV="$NIMBUS_HOME/cumulus/env.sh"
112 if [ ! -f $CUMULUS_ENV ]; then
113 echo "Expected file to be created: $CUMULUS_ENV"
114 exit 1
115 fi
116
43149cb @timf Initial install-from support, missing cumulus import
timf authored
117 export NIMBUS_HOME
8aad6a6 @buzztroll repackaged lantorrent to be more pythonic
buzztroll authored
118 source $pyve_path/bin/activate
8d187ea @buzztroll repackaging lantorrent to be more pythonic
buzztroll authored
119 export LANTORRENT_HOME=$NIMBUS_HOME/lantorrent
9877299 @buzztroll packaging some lantorrent deps with cumulus (same virutal env). expa…
buzztroll authored
120
8aad6a6 @buzztroll repackaged lantorrent to be more pythonic
buzztroll authored
121 $NIMBUS_SRC/lantorrent/install.sh $LANTORRENT_HOME | tee -a $NIMBUS_HOME/install.log
43149cb @timf Initial install-from support, missing cumulus import
timf authored
122 rc=$PIPESTATUS
123 if [ $rc -ne 0 ]; then
124 echo "lantorrent install failed"
125 exit $rc
126 fi
127
128 echo ""
f4963f9 @labisso Cleaned up install script output.
labisso authored
129 echo "-----------------------------------------------------------------"
130 echo " Configuring installed services"
131 echo "-----------------------------------------------------------------"
132
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
133 CONFIG_SCRIPT="$NIMBUS_HOME/bin/nimbus-configure"
134
135 if [ ! -f $CONFIG_SCRIPT ]; then
136 echo "Configuration script could not be found: $CONFIG_SCRIPT"
137 exit 1
138 fi
139
43149cb @timf Initial install-from support, missing cumulus import
timf authored
140 vmm_cmd="Programmer. Error."
141 EXTRA_CONFIG_SCRIPT_ARGS=""
142 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
143 echo ""
144 echo "Beginning the configuration with values from the old Nimbus installation: $PREVIOUS_NIMBUS_HOME_VALIDATED"
145 echo ""
146
147 oldnimbusconf=$PREVIOUS_NIMBUS_HOME_VALIDATED/nimbus-setup.conf
148 if [ ! -f $oldnimbusconf ]; then
149 echo "The old Nimbus installation does not have a configuration file, expecting to find: $oldnimbusconf"
150 exit 1
151 fi
152
153 cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf
154 if [ $? -ne 0 ]; then
155 echo "Could not copy the old configuration file: cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf"
156 exit 1
157 fi
158
159 EXTRA_CONFIG_SCRIPT_ARGS="--conf $NIMBUS_HOME/nimbus-setup.conf"
160
161 # We know that a fresh installation will have missing things specified in
162 # that conf file. Any relative path configuratoin in that previous conf
163 # file will be copied over here. Any absolute path will be noted but not
164 # touched.
165
166 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-prev
167 if [ $? -ne 0 ]; then
168 echo ""
169 echo "Could not import something specified in the old configuration file: $oldnimbusconf"
170 exit 1
171 fi
172
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
173 old_vmmdir="$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus/workspace-service/vmm-pools"
43149cb @timf Initial install-from support, missing cumulus import
timf authored
174 vmm_cmd="$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-vmms $old_vmmdir"
175 fi
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
176
43149cb @timf Initial install-from support, missing cumulus import
timf authored
177 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
178 if [ $? -ne 0 ]; then
179 echo "Nimbus configuration script failed! You may try running it manually:"
906cafe @labisso Fixes to setup and nimbusctl scripts.
labisso authored
180 echo " $CONFIG_SCRIPT"
8cc7d25 @labisso nimbus-configure improvements.
labisso authored
181 echo "You can also run the script with debugging output:"
182 echo " $CONFIG_SCRIPT --debug"
5b452b8 @labisso Installer bugfixes and enhancements
labisso authored
183 exit 1
184 fi
185
43149cb @timf Initial install-from support, missing cumulus import
timf authored
186 $NIMBUS_SRC/libexec/configure-cumulus.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
e03a295 @timf exit checks with tee need PIPESTATUS
timf authored
187 # need PIPESTATUS because tee is not the exit code of interest
0b8aa41 merged virga1 and master
BuzzTroll authored
188 rc=$PIPESTATUS
189 if [ $rc -ne 0 ]; then
190 exit $rc
191 fi
192
43149cb @timf Initial install-from support, missing cumulus import
timf authored
193 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
194 echo ""
195 $CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-cumulusdb
196 if [ $? -ne 0 ]; then
197 echo ""
198 echo "Could not import Cumulus DB from the old configuration file: $oldnimbusconf"
199 exit 1
200 fi
43149cb @timf Initial install-from support, missing cumulus import
timf authored
201 fi
202
203 echo ""
204 GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
205 if [ $? -ne 0 ]; then
206 GUIDEURL="Development mode: no guide url"
207 fi
208
209 echo ""
210 echo "-----------------------------------------------------------------"
211 echo " Nimbus installation succeeded!"
212 echo "-----------------------------------------------------------------"
213 echo ""
214 echo "Additional configuration may be necessary, refer to this URL for information:"
215 echo ""
216 echo " $GUIDEURL"
217 echo ""
218 echo "You can start/stop Nimbus services with the nimbusctl command. e.g:"
219 echo ""
220 echo " $NIMBUS_HOME/bin/nimbusctl start"
221 echo ""
222
223 if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
224 old_etc_dir=$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus
225 new_etc_dir=$NIMBUS_HOME/services/etc/nimbus
226 echo "-----------------------------------------------------------------"
4ec97f2 @timf cumulus db import, need to test with old posixdata + unpropagation
timf authored
227 echo " ** Upgrade work still needed **"
43149cb @timf Initial install-from support, missing cumulus import
timf authored
228 echo "-----------------------------------------------------------------"
229 echo ""
230 echo "While key settings have been transferred from your old install,"
231 echo "you still need to do a manual confirmation and transfer of"
232 echo "customizations."
233 echo ""
234 echo "Run the following command to look for customizations:"
235 echo ""
236 echo " diff -u -r $old_etc_dir $new_etc_dir"
237 echo ""
238 echo "After using nimbusctl to start the services, use the following"
239 echo "command to import VMM configurations. This can only be done "
240 echo "with a running service:"
241 echo ""
242 echo " $vmm_cmd"
243 echo ""
0b8aa41 merged virga1 and master
BuzzTroll authored
244 fi
43149cb @timf Initial install-from support, missing cumulus import
timf authored
245
0b8aa41 merged virga1 and master
BuzzTroll authored
246 exit 0
Something went wrong with that request. Please try again.