Project

General

Profile

Glideinwms Git on a RPM installation

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.
These have been already applied to the hosts gwms-dev-frontend and gwms-dev-factory .

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.

Disable auto-updates

Exclude HTCondor and glidein packages from updates:

# SL6
vi /etc/sysconfig/yum-autoupdate
# Add this line
EXCLUDE="kernel* openafs* *-kmdl-* kmod-* *firmware* condor* glidein*" 

# SL7
# sl7 does not have /etc/sysconfig/yum-autoupdate. Alt. add at the end of yum.conf:
vi /etc/yum.conf
# Add these lines
## Exclude following Packages Updates ##
exclude=glidein* condor*

vi /etc/yum/yum-cron.conf
# Add these lines:
# Do not update these automatically
exclude=kernel* openafs* *-kmdl-* kmod-* *firmware* condor* glidein*

Install Git, clone the repository and checkout your branch

yum install -y git
mkdir /opt/gwms-git
cd /opt/gwms-git
# you may need a kinit if the key was not forwarded
git clone ssh://p-glideinwms@cdcvs.fnal.gov/cvs/projects/glideinwms
cd glideinwms
git checkout YOUR_BRANCH

Changes to Frontend software

# For RHEL 6
export PYVERSION=2.6

# For RHEL 7
export PYVERSION=2.7

mkdir -p /opt/fromrpm/usr_sbin
cd /usr/sbin
mv checkFrontend glideinFrontendElement.py glideinFrontend stopFrontend /opt/fromrpm/usr_sbin/
for i in checkFrontend glideinFrontend stopFrontend; do ln -s /usr/lib/python$PYVERSION/site-packages/glideinwms/frontend/${i}.py $i; done
ln -s /usr/lib/python$PYVERSION/site-packages/glideinwms/frontend/glideinFrontendElement.py glideinFrontendElement.py

# already in /usr/sbin
mv glidecondor_addDN glidecondor_createSecCol glidecondor_createSecSched /opt/fromrpm/usr_sbin/
for i in glidecondor_addDN glidecondor_createSecCol glidecondor_createSecSched ; do ln -s /opt/gwms-git/glideinwms/install/$i $i ; done

# already in /usr/sbin
mv reconfig_frontend /opt/fromrpm/usr_sbin/
ln -s /opt/gwms-git/glideinwms/creation/reconfig_frontend reconfig_frontend

mkdir -p /opt/fromrpm/usr_bin
cd /usr/bin/
mv /usr/bin/glidein* /opt/fromrpm/usr_bin/
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

cd /usr/lib/python$PYVERSION/site-packages/
mv glideinwms fromrpm_glideinwms
mkdir glideinwms
cd glideinwms/
for i in creation  frontend  __init__.py  lib  tools; do  ln -s /opt/gwms-git/glideinwms/$i $i; done
pushd /opt/gwms-git/glideinwms/creation/
ln -s . creation
popd

# no touching files in /etc

cd /var/lib/gwms-frontend/
mkdir fromrpm
mv creation web-base fromrpm/
ln -s /opt/gwms-git/glideinwms/creation creation
ln -s /opt/gwms-git/glideinwms/creation/web_base web-base

# Change as needed
vi /etc/gwms-frontend/frontend.xml

Restart the Frontend

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.

# Stop the Factory if already running
service gwms-factory stop
service gwms-frontend upgrade
service gwms-frontend reconfig
service gwms-frontend start

Changes to Factory software

# For SL6
export PYVERSION=python2.6
# For SL7
export PYVERSION=python2.7

pushd /usr/sbin
mkdir -p /opt/fromrpm/usr_sbin

mv checkFactory.py* glideFactoryEntryGroup.py* glideFactoryEntry.py* glideFactory.py* manageFactoryDowntimes.py* stopFactory.py* /opt/fromrpm/usr_sbin/
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

# already in: pushd /usr/sbin
mkdir -p /opt/fromrpm/usr_sbin
mv clone_glidein glidecondor_createSecCol glidecondor_addDN glidecondor_createSecSched info_glidein reconfig_glidein /opt/fromrpm/usr_sbin
## Not in factory  mv reconfig_frontend /opt/fromrpm/usr_sbin   # reconfig_frontend is not there at start
for i in glidecondor_createSecCol glidecondor_addDN glidecondor_createSecSched; do ln -s /opt/gwms-git/glideinwms/install/$i $i; done
for i in clone_glidein info_glidein reconfig_glidein reconfig_frontend; do ln -s /opt/gwms-git/glideinwms/creation/$i $i; done

mkdir -p /opt/fromrpm/usr_bin
mv /usr/bin/glidein* /opt/fromrpm/usr_bin/
pushd /usr/bin/
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

cd /usr/lib/$PYVERSION/site-packages/
mv glideinwms/ fromrpm_glideinwms
mkdir glideinwms
cd glideinwms
for i in creation  factory  __init__.py lib  tools; do ln -s /opt/gwms-git/glideinwms/$i $i; done

# no touching files in /etc

cd /var/lib/gwms-factory/
mkdir fromrpm
mv creation web-base fromrpm/
ln -s /opt/gwms-git/glideinwms/creation creation
ln -s /opt/gwms-git/glideinwms/creation/web_base web-base

cd /var/log/gwms-factory/
mkdir old
mv client server old
mkdir client server
chown gfactory: server

Restart the Factory

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.

# For SL6
/etc/init.d/gwms-factory upgrade

# For SL7
# Stop the Factory if already running
/bin/systemctl stop gwms-factory
/usr/sbin/gwms-factory upgrade
#/usr/sbin/gwms-factory reconfig
/bin/systemctl start gwms-factory