Project

General

Profile

GlideinwmsGitAndRPM » History » Version 5

Marco Mambelli, 01/09/2020 01:26 PM

1 1 Marco Mambelli
h1. Glideinwms Git on a RPM installation
2 1 Marco Mambelli
3 5 Marco Mambelli
These are modifications to a RPM installarion that allow to change the code in a git repository and run off it after issuing a simple upgrade command.
4 5 Marco Mambelli
These have been already applied to the hosts =gwms-dev-frontend= and =gwms-dev-factory= .
5 5 Marco Mambelli
6 1 Marco Mambelli
In all the code segments below there are sections that are for RHEL6 systems only and sections for RHEL7 only, these are marked as SL6, SL7 respectively.
7 1 Marco Mambelli
8 5 Marco Mambelli
9 1 Marco Mambelli
h2. Disable auto-updates
10 1 Marco Mambelli
11 1 Marco Mambelli
Exclude HTCondor and glidein packages from updates:
12 2 Marco Mambelli
<pre><code class="shell">
13 1 Marco Mambelli
# SL6
14 1 Marco Mambelli
vi /etc/sysconfig/yum-autoupdate
15 1 Marco Mambelli
# Add this line
16 1 Marco Mambelli
EXCLUDE="kernel* openafs* *-kmdl-* kmod-* *firmware* condor* glidein*"
17 1 Marco Mambelli
18 1 Marco Mambelli
# SL7
19 1 Marco Mambelli
# sl7 does not have /etc/sysconfig/yum-autoupdate. Alt. add at the end of yum.conf:
20 1 Marco Mambelli
vi /etc/yum.conf
21 1 Marco Mambelli
# Add these lines
22 1 Marco Mambelli
## Exclude following Packages Updates ##
23 1 Marco Mambelli
exclude=glidein* condor*
24 1 Marco Mambelli
25 1 Marco Mambelli
vi /etc/yum/yum-cron.conf
26 1 Marco Mambelli
# Add these lines:
27 1 Marco Mambelli
# Do not update these automatically
28 1 Marco Mambelli
exclude=kernel* openafs* *-kmdl-* kmod-* *firmware* condor* glidein*
29 2 Marco Mambelli
</code></pre>
30 1 Marco Mambelli
31 2 Marco Mambelli
32 1 Marco Mambelli
h2. Install Git, clone the repository and checkout your branch
33 1 Marco Mambelli
34 2 Marco Mambelli
<pre><code class="shell">
35 1 Marco Mambelli
yum install -y git
36 1 Marco Mambelli
mkdir /opt/gwms-git
37 1 Marco Mambelli
cd /opt/gwms-git
38 1 Marco Mambelli
# you may need a kinit if the key was not forwarded
39 1 Marco Mambelli
git clone ssh://p-glideinwms@cdcvs.fnal.gov/cvs/projects/glideinwms
40 1 Marco Mambelli
cd glideinwms
41 1 Marco Mambelli
git checkout YOUR_BRANCH
42 2 Marco Mambelli
</code></pre>
43 2 Marco Mambelli
44 1 Marco Mambelli
45 1 Marco Mambelli
h2. Changes to Frontend software
46 1 Marco Mambelli
47 3 Marco Mambelli
<pre><code class="shell">
48 1 Marco Mambelli
# For RHEL 6
49 1 Marco Mambelli
export PYVERSION=2.6
50 1 Marco Mambelli
51 1 Marco Mambelli
# For RHEL 7
52 1 Marco Mambelli
export PYVERSION=2.7
53 1 Marco Mambelli
54 1 Marco Mambelli
55 1 Marco Mambelli
mkdir -p /opt/fromrpm/usr_sbin
56 1 Marco Mambelli
cd /usr/sbin
57 1 Marco Mambelli
mv checkFrontend glideinFrontendElement.py glideinFrontend stopFrontend /opt/fromrpm/usr_sbin/
58 1 Marco Mambelli
for i in checkFrontend glideinFrontend stopFrontend; do ln -s /usr/lib/python$PYVERSION/site-packages/glideinwms/frontend/${i}.py $i; done
59 1 Marco Mambelli
ln -s /usr/lib/python$PYVERSION/site-packages/glideinwms/frontend/glideinFrontendElement.py glideinFrontendElement.py
60 1 Marco Mambelli
61 1 Marco Mambelli
# already in /usr/sbin
62 1 Marco Mambelli
mv glidecondor_addDN glidecondor_createSecCol glidecondor_createSecSched /opt/fromrpm/usr_sbin/
63 1 Marco Mambelli
for i in glidecondor_addDN glidecondor_createSecCol glidecondor_createSecSched ; do ln -s /opt/gwms-git/glideinwms/install/$i $i ; done
64 1 Marco Mambelli
65 1 Marco Mambelli
# already in /usr/sbin
66 1 Marco Mambelli
mv reconfig_frontend /opt/fromrpm/usr_sbin/
67 1 Marco Mambelli
ln -s /opt/gwms-git/glideinwms/creation/reconfig_frontend reconfig_frontend
68 1 Marco Mambelli
69 1 Marco Mambelli
mkdir -p /opt/fromrpm/usr_bin
70 1 Marco Mambelli
cd /usr/bin/
71 1 Marco Mambelli
mv /usr/bin/glidein* /opt/fromrpm/usr_bin/
72 1 Marco Mambelli
for i in glidein_cat  glidein_gdb  glidein_interactive  glidein_ls  glidein_ps  glidein_status  glidein_top; do  ln -s /usr/lib/python$PYVERSION/site-packages/glideinwms/tools/${i}.py $i; done
73 1 Marco Mambelli
74 1 Marco Mambelli
cd /usr/lib/python$PYVERSION/site-packages/
75 1 Marco Mambelli
mv glideinwms fromrpm_glideinwms
76 1 Marco Mambelli
mkdir glideinwms
77 1 Marco Mambelli
cd glideinwms/
78 1 Marco Mambelli
for i in creation  frontend  __init__.py  lib  tools; do  ln -s /opt/gwms-git/glideinwms/$i $i; done
79 1 Marco Mambelli
pushd /opt/gwms-git/glideinwms/creation/
80 1 Marco Mambelli
ln -s . creation
81 1 Marco Mambelli
popd
82 1 Marco Mambelli
83 1 Marco Mambelli
84 1 Marco Mambelli
# no touching files in /etc
85 1 Marco Mambelli
86 1 Marco Mambelli
cd /var/lib/gwms-frontend/
87 1 Marco Mambelli
mkdir fromrpm
88 1 Marco Mambelli
mv creation web-base fromrpm/
89 1 Marco Mambelli
ln -s /opt/gwms-git/glideinwms/creation creation
90 1 Marco Mambelli
ln -s /opt/gwms-git/glideinwms/creation/web_base web-base
91 1 Marco Mambelli
92 1 Marco Mambelli
# Change as needed
93 1 Marco Mambelli
vi /etc/gwms-frontend/frontend.xml
94 3 Marco Mambelli
</code></pre>
95 1 Marco Mambelli
96 4 Marco Mambelli
97 1 Marco Mambelli
h3. Restart the Frontend
98 1 Marco Mambelli
99 5 Marco Mambelli
Perform this after applying the changes above and all the time you change the code in the Git repository and you want to run with the new code.
100 5 Marco Mambelli
101 3 Marco Mambelli
<pre><code class="shell">
102 5 Marco Mambelli
# Stop the Factory if already running
103 5 Marco Mambelli
service gwms-factory stop
104 1 Marco Mambelli
service gwms-frontend upgrade
105 1 Marco Mambelli
service gwms-frontend reconfig
106 1 Marco Mambelli
service gwms-frontend start
107 3 Marco Mambelli
</code></pre>
108 1 Marco Mambelli
109 3 Marco Mambelli
110 1 Marco Mambelli
h2. Changes to Factory software
111 1 Marco Mambelli
112 1 Marco Mambelli
<pre><code class="shell">
113 1 Marco Mambelli
# For SL6
114 4 Marco Mambelli
export PYVERSION=python2.6
115 1 Marco Mambelli
# For SL7
116 4 Marco Mambelli
export PYVERSION=python2.7
117 1 Marco Mambelli
118 1 Marco Mambelli
pushd /usr/sbin
119 1 Marco Mambelli
mkdir -p /opt/fromrpm/usr_sbin
120 1 Marco Mambelli
121 1 Marco Mambelli
mv checkFactory.py* glideFactoryEntryGroup.py* glideFactoryEntry.py* glideFactory.py* manageFactoryDowntimes.py* stopFactory.py* /opt/fromrpm/usr_sbin/
122 4 Marco Mambelli
for i in checkFactory.py glideFactoryEntryGroup.py glideFactoryEntry.py glideFactory.py manageFactoryDowntimes.py stopFactory.py; do ln -s /usr/lib/$PYVERSION/site-packages/glideinwms/factory/$i $i; ln -s /usr/lib/$PYVERSION/site-packages/glideinwms/factory/${i}o ${i}o; ln -s /usr/lib/$PYVERSION/site-packages/glideinwms/factory/${i}c ${i}c; done
123 1 Marco Mambelli
124 1 Marco Mambelli
# already in: pushd /usr/sbin
125 1 Marco Mambelli
mkdir -p /opt/fromrpm/usr_sbin
126 1 Marco Mambelli
mv clone_glidein glidecondor_createSecCol glidecondor_addDN glidecondor_createSecSched info_glidein reconfig_glidein /opt/fromrpm/usr_sbin
127 1 Marco Mambelli
## Not in factory  mv reconfig_frontend /opt/fromrpm/usr_sbin   # reconfig_frontend is not there at start
128 1 Marco Mambelli
for i in glidecondor_createSecCol glidecondor_addDN glidecondor_createSecSched; do ln -s /opt/gwms-git/glideinwms/install/$i $i; done
129 1 Marco Mambelli
for i in clone_glidein info_glidein reconfig_glidein reconfig_frontend; do ln -s /opt/gwms-git/glideinwms/creation/$i $i; done
130 1 Marco Mambelli
131 1 Marco Mambelli
mkdir -p /opt/fromrpm/usr_bin
132 1 Marco Mambelli
mv /usr/bin/glidein* /opt/fromrpm/usr_bin/
133 1 Marco Mambelli
pushd /usr/bin/
134 4 Marco Mambelli
for i in glidein_cat glidein_gdb glidein_interactive glidein_ls glidein_ps glidein_status glidein_top; do  ln -s /usr/lib/$PYVERSION/site-packages/glideinwms/tools/${i}.py $i; done
135 1 Marco Mambelli
136 4 Marco Mambelli
cd /usr/lib/$PYVERSION/site-packages/
137 1 Marco Mambelli
mv glideinwms/ fromrpm_glideinwms
138 1 Marco Mambelli
mkdir glideinwms
139 1 Marco Mambelli
cd glideinwms
140 1 Marco Mambelli
for i in creation  factory  __init__.py lib  tools; do ln -s /opt/gwms-git/glideinwms/$i $i; done
141 1 Marco Mambelli
142 1 Marco Mambelli
# no touching files in /etc
143 1 Marco Mambelli
144 1 Marco Mambelli
cd /var/lib/gwms-factory/
145 1 Marco Mambelli
mkdir fromrpm
146 1 Marco Mambelli
mv creation web-base fromrpm/
147 1 Marco Mambelli
ln -s /opt/gwms-git/glideinwms/creation creation
148 1 Marco Mambelli
ln -s /opt/gwms-git/glideinwms/creation/web_base web-base
149 1 Marco Mambelli
150 1 Marco Mambelli
cd /var/log/gwms-factory/
151 1 Marco Mambelli
mkdir old
152 1 Marco Mambelli
mv client server old
153 1 Marco Mambelli
mkdir client server
154 1 Marco Mambelli
chown gfactory: server
155 1 Marco Mambelli
156 4 Marco Mambelli
</code></pre>
157 4 Marco Mambelli
158 4 Marco Mambelli
159 4 Marco Mambelli
h3. Restart the Factory
160 5 Marco Mambelli
161 5 Marco Mambelli
Perform this after applying the changes above and all the time you change the code in the Git repository and you want to run with the new code.
162 4 Marco Mambelli
163 4 Marco Mambelli
<pre><code class="shell">
164 1 Marco Mambelli
# For SL6
165 1 Marco Mambelli
/etc/init.d/gwms-factory upgrade
166 1 Marco Mambelli
167 1 Marco Mambelli
# For SL7
168 4 Marco Mambelli
# Stop the Factory if already running
169 4 Marco Mambelli
/bin/systemctl stop gwms-factory
170 3 Marco Mambelli
/usr/sbin/gwms-factory upgrade
171 3 Marco Mambelli
#/usr/sbin/gwms-factory reconfig
172 3 Marco Mambelli
/bin/systemctl start gwms-factory
173 3 Marco Mambelli
</code></pre>