Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at installing wmagent with pip in docker #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion wmagent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ FROM gitlab-registry.cern.ch/cmsdocks/dmwm:wmcore_base_test
#RUN echo "Updating the base system - 2017-06-16"
#RUN yum -y install cern-get-sso-cookie && yum clean all

# We need pip and virtualenv
RUN yum -y install python2-pip python-virtualenv

# WMAgent RPM dependencies
RUN yum -y install gcc openssl-devel libcurl-devel mariadb mariadb-devel jemalloc

# Condor Installation - we probaby should build this ourselves
RUN yum -y install condor

# Install CouchDB
COPY bintray-apache-couchdb-rpm.repo /etc/yum.repos.d/bintray-apache-couchdb-rpm.repo
RUN yum -y install couchdb

RUN echo "Adding the AFS cmst1:zh user"
RUN groupadd -g 1399 zh
RUN adduser -u 31961 -g 1399 cmst1
Expand All @@ -24,6 +37,13 @@ RUN chown -R 31961:1399 /data/srv/
# Switch user
USER cmst1

# Install Oracle
COPY oracle_install.sh /home/cmst1/oracle_install.sh
RUN sh /home/cmst1/oracle_install.sh
RUN rm -f /home/cmst1/oracle_install.sh

ENV ORACLE_HOME=/data/srv/depend/oracle

# setup a fake service certificate
RUN ls -l /data
#WORKDIR /data/certs
Expand All @@ -37,7 +57,13 @@ WORKDIR /data/srv

# Install cms-bot and WMCore
RUN echo "Installing WMAgent"
RUN sh deploy-wmagent.sh -w 1.1.15.patch5 -d HG1808g -t testbed-docker
#RUN sh deploy-wmagent.sh -w 1.1.15.patch5 -d HG1808g -t testbed-docker

# Set up the wmagent virtualenv
COPY pydistutils.cfg /home/cmst1/.pydistutils.cfg
RUN virtualenv wmagent
RUN /bin/bash -c "source wmagent/bin/activate; pip --no-cache-dir install wmagent; deactivate"
#RUN pip install wmagent
RUN echo "Installation completed!"

#Finished
Expand Down
6 changes: 6 additions & 0 deletions wmagent/bintray-apache-couchdb-rpm.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el$releasever/$basearch/
gpgcheck=0
repo_gpgcheck=0
enabled=1
51 changes: 51 additions & 0 deletions wmagent/oracle_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This script is based off of the spec file for the CMS oracle rpm
# https://github.com/cms-sw/cmsdist/blob/comp_gcc630/oracle.spec

set -x
INSTALLDIR=/data/srv/depend/oracle
CLIENTDIR=$INSTALLDIR/instantclient_11_2

mkdir -p $INSTALLDIR
cd $INSTALLDIR

# Grab instant client from cmsrep
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/20150918-instantclient-basic-linux.x64-11.2.0.4.0.zip
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/20150918-instantclient-basiclite-linux.x64-11.2.0.4.0.zip
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/20150918-instantclient-jdbc-linux.x64-11.2.0.4.0.zip
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/20150918-instantclient-sdk-linux.x64-11.2.0.4.0.zip
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/20150918-instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
wget http://cmsrep.cern.ch/cmssw/oracle-mirror/oracle-license

# Unzip the files
for f in $(ls *.zip); do
unzip -o $f
done

# Delete the zips
rm -f $INSTALLDIR/*.zip

# Set up directory structure and move files to appropriate places
mkdir -p $INSTALLDIR/{bin,lib,java,demo,include,doc}
mv $CLIENTDIR/*_README $CLIENTDIR/sdk/*_README $INSTALLDIR/doc
mv $CLIENTDIR/lib* $INSTALLDIR/lib
mv $CLIENTDIR/glogin.sql $INSTALLDIR/bin
mv $CLIENTDIR/*.jar $CLIENTDIR/sdk/*.zip $INSTALLDIR/java
mv $CLIENTDIR/sdk/demo/* $INSTALLDIR/demo
mv $CLIENTDIR/sdk/include/* $INSTALLDIR/include

cd $CLIENTDIR
for f in sqlplus adrci genezi uidrvci sdk/ott; do
[ -f $f ] || continue
mv $f $INSTALLDIR/bin
done

cd $INSTALLDIR/lib
for f in lib*.{dylib,so}.[0-9]*; do
[ -f $f ] || continue
dest=$(echo $f | sed 's/\.[.0-9]*$//')
rm -f $dest
ln -s $f $dest
done

# Cleanup
rm -rf $CLIENTDIR
2 changes: 2 additions & 0 deletions wmagent/pydistutils.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build_ext]
include_dirs=/data/srv/depend/oracle/include