Skip to content

Commit f4521db

Browse files
Merge pull request #171 from brianhlin/SOFTWARE-3783.osg-35
Initial OSG 3.5 support, including Travis tests (SOFTWARE-3783)
2 parents 0cc7f61 + 6cc0f92 commit f4521db

File tree

10 files changed

+111
-31
lines changed

10 files changed

+111
-31
lines changed

.travis.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
sudo: required
2+
3+
git:
4+
depth: false
5+
quiet: true
6+
27
env:
3-
matrix:
4-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun
5-
- OS_TYPE=centos OS_VERSION=6 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun
6-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-ce-condor,rsv,vo-client-lcmaps-voms,llrun,singularity,osg-oasis
7-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=osg-gridftp,rsv,lcmaps,lcmaps-db-templates,vo-client-lcmaps-voms,rsv,llrun,singularity,osg-oasis
8-
- OS_TYPE=centos OS_VERSION=7 PACKAGES=xrootd,xrootd-client,xrootd-multiuser,globus-proxy-utils
8+
- OSG_RELEASE=3.4 OS_VERSION=6 PKG_SET=htcondor-ce
9+
- OSG_RELEASE=3.4 OS_VERSION=6 PKG_SET=gridftp
10+
- OSG_RELEASE=3.4 OS_VERSION=7 PKG_SET=htcondor-ce
11+
- OSG_RELEASE=3.4 OS_VERSION=7 PKG_SET=gridftp
12+
- OSG_RELEASE=3.4 OS_VERSION=7 PKG_SET=singularity
13+
- OSG_RELEASE=3.4 OS_VERSION=7 PKG_SET=stashcache
14+
- OSG_RELEASE=3.4 OS_VERSION=7 PKG_SET=xrootd
15+
- OSG_RELEASE=3.5 OS_VERSION=7 PKG_SET=htcondor-ce
16+
- OSG_RELEASE=3.5 OS_VERSION=7 PKG_SET=gridftp
17+
- OSG_RELEASE=3.5 OS_VERSION=7 PKG_SET=singularity
18+
- OSG_RELEASE=3.5 OS_VERSION=7 PKG_SET=stashcache
19+
- OSG_RELEASE=3.5 OS_VERSION=7 PKG_SET=xrootd
920

1021
services:
1122
- docker

osgtest/library/core.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class PackageVersion:
9191
def __init__(self, pkgname):
9292
e,n,v,r,a = get_package_envra(pkgname)
9393
self.evr = e,v,r
94+
self.version = v
9495

9596
def __repr__(self):
9697
return "%s:%s-%s" % self.evr
@@ -629,16 +630,16 @@ def el_release():
629630

630631
def osg_release(update_state=False):
631632
"""
632-
Return the version of osg-release. If the query fails, the test module fails.
633+
Return a PackageVersion instance of osg-release. If the query fails, the test module fails.
633634
"""
634635
if not update_state and 'general.osg_release_ver' in state:
635636
return state['general.osg_release_ver']
636637
try:
637-
_, _, osg_release_ver, _, _ = get_package_envra('osg-release')
638+
release = PackageVersion('osg-release')
638639
except OSError:
639-
_, _, osg_release_ver, _, _ = get_package_envra('osg-release-itb')
640-
state['general.osg_release_ver'] = osg_release_ver
641-
return osg_release_ver
640+
release = PackageVersion('osg-release-itb')
641+
state['general.osg_release_ver'] = release
642+
return release
642643

643644

644645
def get_hostname():
@@ -750,10 +751,10 @@ def test_bar_34_only(self):
750751
releases = map(str, releases) # convert float args to str
751752
def osg_release_decorator(fn):
752753
def run_fn_if_osg_release_ok(*args, **kwargs):
753-
if osg_release() in releases:
754+
if osg_release().version in releases:
754755
return fn(*args, **kwargs)
755756
else:
756-
msg = "excluding for OSG %s" % osg_release()
757+
msg = "excluding for OSG %s" % osg_release().version
757758
raise osgunittest.ExcludedException(msg)
758759
return run_fn_if_osg_release_ok
759760
return osg_release_decorator

osgtest/tests/special_install.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ def test_02_install_packages(self):
3030
fail_msg = ''
3131
pkg_repo_dict = OrderedDict((x, core.options.extrarepos) for x in core.options.packages)
3232

33-
# HACK: Install slurm out of development if we're running 'All' tests.
33+
# HACK: Install Slurm and osg-tested-internal out of development-like repos.
3434
# SOFTWARE-1733 may one day give us a generalized solution.
35+
if core.osg_release() > '3.4':
36+
devops_repo = 'devops-itb'
37+
else:
38+
devops_repo = 'osg-development'
39+
3540
if 'osg-tested-internal' in pkg_repo_dict or 'slurm' in pkg_repo_dict:
36-
pkg_repo_dict.update(dict((x, ['osg-development']) for x in core.SLURM_PACKAGES))
41+
pkg_repo_dict.update(dict((x, [devops_repo]) for x in core.SLURM_PACKAGES + ['osg-tested-internal']))
3742

3843
# HACK: Install x509-scitokens-issuer-client out of development (SOFTWARE-3649)
3944
if 'xrootd-scitokens' in pkg_repo_dict:

travis-ci/gridftp.packages

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
osg-gridftp
2+
osg-gridftp-xrootd

travis-ci/htcondor-ce.packages

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
osg-ce-condor
2+
globus-proxy-utils

travis-ci/setup_tests.sh

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
#!/bin/sh -xe
1+
#!/bin/bash -xe
22

33
# This script starts docker and systemd (if el7)
44

55
# Run tests in Container
66
# We use `--privileged` for cgroup compatability, which seems to be enabled by default in HTCondor 8.6.x
7+
8+
ENV_FILE=/tmp/travis.env
9+
for vars in {OSG_RELEASE,OS_VERSION,PKG_SET}; do
10+
echo "$vars=${!vars}" >> $ENV_FILE
11+
done
12+
713
if [ "${OS_VERSION}" = "6" ]; then
814

9-
sudo docker run --privileged --rm=true -v /sys/fs/cgroup:/sys/fs/cgroup -v `pwd`:/osg-test:rw centos:centos${OS_VERSION} /bin/bash -c "bash -xe /osg-test/travis-ci/test_inside_docker.sh ${OS_VERSION} ${PACKAGES}"
15+
sudo docker run --privileged \
16+
--rm=true \
17+
--volume=/sys/fs/cgroup:/sys/fs/cgroup \
18+
--volume=`pwd`:/osg-test:rw \
19+
--env-file=$ENV_FILE \
20+
centos:centos${OS_VERSION} \
21+
/bin/bash -c "bash -xe /osg-test/travis-ci/test_inside_docker.sh"
1022

1123
elif [ "${OS_VERSION}" = "7" ]; then
1224

13-
docker run --privileged -d -ti -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v `pwd`:/osg-test:rw centos:centos${OS_VERSION} /usr/sbin/init
14-
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
15-
docker logs $DOCKER_CONTAINER_ID
16-
docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -xec "bash -xe /osg-test/travis-ci/test_inside_docker.sh ${OS_VERSION} ${PACKAGES};
25+
echo "container=docker" >> $ENV_FILE
26+
docker run --privileged \
27+
--detach=true \
28+
--tty \
29+
--interactive=true \
30+
--volume=/sys/fs/cgroup:/sys/fs/cgroup \
31+
--volume `pwd`:/osg-test:rw \
32+
--env-file=$ENV_FILE \
33+
centos:centos${OS_VERSION} \
34+
/usr/sbin/init
35+
DOCKER_CONTAINER_ID=$(docker ps | grep centos | awk '{print $1}')
36+
docker logs $DOCKER_CONTAINER_ID
37+
docker exec --tty=true \
38+
--interactive \
39+
$DOCKER_CONTAINER_ID \
40+
/bin/bash -xec "bash -xe /osg-test/travis-ci/test_inside_docker.sh;
1741
echo -ne \"------\nEND OSG-TEST TESTS\n\";"
18-
docker ps -a
19-
docker stop $DOCKER_CONTAINER_ID
20-
docker rm -v $DOCKER_CONTAINER_ID
42+
docker ps -a
43+
docker stop $DOCKER_CONTAINER_ID
44+
docker rm -v $DOCKER_CONTAINER_ID
2145

2246
fi
2347

travis-ci/singularity.packages

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
osg-oasis
2+
singularity

travis-ci/stashcache.packages

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
stashcache-client
2+
stash-cache
3+
stash-origin

travis-ci/test_inside_docker.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/sh -xe
22

3-
OS_VERSION=$1
4-
PACKAGES=$2
3+
if [[ "$OSG_RELEASE" == "3.5" ]]; then
4+
devops_repo='--enablerepo=devops-itb'
5+
extra_repos='--extra-repo=osg-development'
6+
else
7+
devops_repo=''
8+
extra_repos=''
9+
fi
510

611
ls -l /home
712

@@ -10,10 +15,11 @@ yum -y clean all
1015
yum -y clean expire-cache
1116

1217
# First, install all the needed packages.
13-
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-${OS_VERSION}.noarch.rpm
18+
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-"$OS_VERSION".noarch.rpm
1419

1520
yum -y install yum-plugin-priorities
16-
rpm -Uvh https://repo.opensciencegrid.org/osg/3.4/osg-3.4-el${OS_VERSION}-release-latest.rpm
21+
22+
rpm -Uvh https://repo.opensciencegrid.org/osg/"$OSG_RELEASE"/osg-"$OSG_RELEASE"-el"$OS_VERSION"-release-latest.rpm
1723
yum -y install make git openssl rpm-build
1824

1925
# Prepare the RPM environment
@@ -34,7 +40,9 @@ popd
3440
rpmbuild --define '_topdir /tmp/rpmbuild' -ba /tmp/rpmbuild/SPECS/osg-test.spec
3541

3642
# After building the RPM, try to install it
37-
yum localinstall -y /tmp/rpmbuild/RPMS/noarch/osg-test*
43+
yum localinstall -y \
44+
$devops_repo \
45+
/tmp/rpmbuild/RPMS/noarch/osg-test*
3846

3947
# HTCondor really, really wants a domain name. Fake one.
4048
sed /etc/hosts -e "s/`hostname`/`hostname`.unl.edu `hostname`/" > /etc/hosts.new
@@ -55,6 +63,18 @@ cp /etc/condor/config.d/99-local.conf /etc/condor-ce/config.d/99-local.conf
5563
export _condor_CONDOR_CE_TRACE_ATTEMPTS=60
5664

5765
# Ok, do actual testing
58-
INSTALL_STR="--install ${PACKAGES//,/ --install }"
66+
67+
install_str=''
68+
while read package; do
69+
install_str="$install_str --install $package"
70+
done < /osg-test/travis-ci/"$PKG_SET".packages
71+
5972
echo "------------ OSG Test --------------"
60-
osg-test -vad --hostcert --no-cleanup ${INSTALL_STR}
73+
74+
osg-test --verbose \
75+
--add-user \
76+
--dump-output \
77+
--hostcert \
78+
--no-cleanup \
79+
${extra_repos} \
80+
${install_str}

travis-ci/xrootd.packages

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
xrootd
2+
xrootd-multiuser
3+
xrootd-lcmaps
4+
xrootd-client
5+
xrootd-fuse
6+
xrootd-scitokens
7+
lcmaps-db-templates
8+
vo-client-lcmaps-voms
9+
globus-proxy-utils
10+
osg-gridftp-xrootd

0 commit comments

Comments
 (0)