Commit 85bf2c4b authored by Dries Kimpe's avatar Dries Kimpe
Browse files

Working on nightly builds

parent 49bc7534
#!/bin/bash
if test -z "${WORKSPACE}" -o -z "${BUILD_ID}" ; then
echo "This script can only be ran under jenkins"
exit 1
fi
# Dump some information
ls ${WORKSPACE}
echo "======================================================================="
echo "= Build ${BUILD_NUMBER} ${BUILD_ID}"
echo "= on ${NODE_NAME} [${NODE_LABELS}]"
echo "======================================================================="
BUILD="${WORKSPACE}/build"
mkdir -p "${BUILD}"
"${WORKSPACE}/autobuild/build-local.sh" "${WORKSPACE}" "${BUILD}"
#!/bin/bash
# This script can be used to trigger the nightly build scripts locally. No
# guarantees!
if test -z "$1" -o -z "$2" ; then
echo "Need two arguments: path to source tree and path to build dir"
exit 1
fi
export SRCDIR="$1"
export WORKSPACE="$2"
echo "IOFSL source in $SRCDIR"
echo "Building in $WORKSPACE"
exec "${SRCDIR}/autobuild/build.sh"
......@@ -5,19 +5,169 @@ ls ${WORKSPACE}
AUTOBUILDDIR=${WORKSPACE}/autobuild
# Dump some information
echo "======================================================================="
echo "= Build ${BUILD_NUMBER} ${BUILD_ID}"
echo "= on ${NODE_NAME} [${NODE_LABELS}]"
echo "======================================================================="
# =============== Validate environment ===================
if test -z "${SRCDIR}"; then
echo "This script requires SRCDIR to be defined"
echo "(and pointing to the IOFSL source tree)"
exit 1
fi
# Make sure srcdir is absolute
tmp=$(echo ${SRCDIR} | cut -c1-2)
if test "A$tmp" != "A/" ; then
# make srcdir absolute
SRCDIR=$(cd $tmp && pwd)
fi
if ! test -r "${SRCDIR}/iofsl.pc.in" ; then
echo "Doesn't look like ${SRCDIR} contains an IOFSL source tree"
exit 1
fi
if test -z "${WORKSPACE}" -a -d "${WORKSPACE}"; then
echo "This scripts requires WORKSPACE to be defined (and exist)"
exit 1
fi
# ====================================================================
# ========== Settings ================================================
# ====================================================================
# where we'll fetch dependencies and other files needed for the build
FETCHDIR="${WORKSPACE}/fetch-files"
# Where we'll cache build info (fetched files, ccache, etc.)
CACHEDIR="/tmp/iofsl-cache"
# Dir containing build scripts
AUTOBUILDDIR=${SRCDIR}/autobuild
# ====================================================================
# ========= Dump some settings =======================================
# ====================================================================
echo "===================================================================="
echo "===== INFO ========================================================="
echo "===================================================================="
echo "IOFSL Source tree : ${SRCDIR}"
echo "Workspace : ${WORKSPACE}"
echo "Cachedir : ${CACHEDIR}"
# ====================================================================
# Load rest of build function
# ====================================================================
if ! test -r "${AUTOBUILDDIR}/functions.sh" ; then
echo "Missing ${AUTOBUILDDIR}/functions.sh!"
exit 1
fi
source "${AUTOBUILDDIR}/functions.sh" || exit 2
# ===================================================================
# ==== Internal variables | DO NOT MODIFY ===========================
# ===================================================================
# list of files we will fetch
FETCH="${AUTOBUILDDIR}/files.fetch"
# Where we'll install dependencies
DEPINSTALL="${WORKSPACE}/install"
# Where we'll build IOFSL
BUILDDIR="${WORKSPACE}/build"
# ===================================================================
# ==== Validate internal environment ================================
# ===================================================================
if ! test -d "${CACHEDIR}" -o ! -O "${CACHEDIR}" -o ! -G "${CACHEDIR}" ; then
echo "Invalid cachedir ${CACHEDIR}; Doesn't exist or not owned by build"
fi
echo
echo "======================================================================="
echo "==== STEP 1: Fetch build dependencies ================================="
echo "======================================================================="
mkdir -p "${FETCHDIR}"
mkdir -p "${CACHEDIR}"
fetch_deps "${FETCH}" "${FETCHDIR}" "${CACHEDIR}" || exit 1
echo "======================================================================="
echo "==== STEP 2: Build & install dependencies ============================="
echo "======================================================================="
DEPBUILDDIR="${WORKSPACE}/depbuild"
mkdir -p "${DEPBUILDDIR}"
mkdir -p "${DEPINSTALL}"
echo -n " * Building and installing boost..."
"${AUTOBUILDDIR}/install-boost.sh" \
"${DEPBUILDDIR}" \
"${FETCHDIR}/boost.tar.bz2" \
"${DEPINSTALL}" \
> "${DEPBUILDDIR}/boost-log" \
|| exit 2
echo DONE
echo -n " * Building and installing openpa..."
"${AUTOBUILDDIR}/install-openpa.sh" \
"${DEPBUILDDIR}" \
"${FETCHDIR}/openpa.tar.gz" \
"${DEPINSTALL}" \
> "${DEPBUILDDIR}/openpa-log" \
|| exit 2
echo DONE
echo -n " * Building and installing BMI..."
"${AUTOBUILDDIR}/install-bmi.sh" \
"${DEPBUILDDIR}" \
"${FETCHDIR}/bmi.tar.gz" \
"${DEPINSTALL}" \
> "${DEPBUILDDIR}/bmi-log" \
|| exit 2
echo DONE
echo "======================================================================="
echo "===== STEP 3: Configure IOFSL ========================================="
echo "======================================================================="
BUILDDIR="${WORKSPACE}/iofslbuild"
INSTALLDIR="${WORKSPACE}/iofslinstall"
mkdir -p "${BUILDDIR}"
echo "* Generating buildsystem"
cd "${SRCDIR}"
./prepare
echo "* Configuring IOFSL"
CONFIGOPTS="--prefix=${INSTALLDIR} --with-bmi=${DEPINSTALL}"
cd "${BUILDDIR}"
"${SRCDIR}/configure" ${CONFIGOPTS} || exit 3
echo "======================================================================="
echo "==== STEP 4: Building IOFSL ==========================================="
echo "======================================================================="
make -j2 || exit 4
echo "======================================================================="
echo "==== STEP 5: Install IOFSL ============================================"
echo "======================================================================="
make install || exit 5
echo "======================================================================="
echo "===== STEP 6: Distcheck ==============================================="
echo "======================================================================="
make distcheck DISTCHECK_CONFIGURE_FLAGS="${CONFIGOPTS}" || exit 6
# force failure for now
exit 1
# Structure of this file:
# md5sum filename URL
15cb8c0803064faef0c4ddf5bc5ca279 boost.tar.bz2 .tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.bz2/download
3ad998bb26ac84ee7de262db94dd7656 openpa.tar.gz https://trac.mcs.anl.gov/projects/openpa/raw-attachment/wiki/Downloads/openpa-1.0.4.tar.gz
# Version is broken!
#54d1323d1431311024c01a69913e7b0b bmi.tar.gz http://www.mcs.anl.gov/~dkimpe/bmi-2.8.7-orangefs.tar.gz
82a8efe604a80c80d18dab76dfc13c38 bmi.tar.gz http://www.mcs.anl.gov/~dkimpe/bmi-2.8.1pre1-2009-10-06-175201.tar.gz
#!/bin/bash
# Helper functions for autobuild
#
# Assumes AUTOBUILDDIR is set and valid
#
function do_error ()
{
echo "Error: $1" >2
exit 1
}
test -n "${AUTOBUILDDIR}" || do_error "Need AUTOBUILDDIR"
# Global Settings
# Fetch files described in $1 into dir $2, checking cache in $3
function fetch_deps () {
FETCH="$1"
OUTPUTDIR="$2"
CACHEDIR="$3"
cat "${FETCH}" | grep -v '^#' | while read checksum output url
do
if test -z "${url}"; then
continue
fi
echo -n "${output}: "
CACHED="${CACHEDIR}/${output}"
OUTPUTNAME="${OUTPUTDIR}/${output}"
# Check if file is readable, owned by us and regular
if test -r "${CACHED}" -a -f "${CACHED}" -a -O "${CACHED}"; then
cachesum=$(md5sum "${CACHED}" | cut -f1 -d' ')
if test "A${checksum}" = "A${cachesum}" ; then
echo -n "(found in cache) "
else
echo -n "(cached but invalid. Removing) "
rm "${CACHED}" || exit 2
fi
fi
if ! test -r "${CACHED}"; then
echo -n "(fetching) "
# file doesn't exist; fetch it
rm -f "${CACHED}"
wget -q -O "${CACHED}" "${url}" || exit 1
fi
# copy into dest
cp -f "${CACHED}" "${OUTPUTNAME}" || exit 1
# verify md5sum
cachesum=$(md5sum "${OUTPUTNAME}" | cut -f1 -d' ')
if test "A${checksum}" != "A${cachesum}" ; then
echo "Incorrect checksum (expecting ${checksum}, got ${cachesum}"
echo "Aborting!"
exit 2
fi
echo "OK (${checksum})"
done
}
#!/bin/sh
#
# Generate new daily build if there was a change to the git tree
#
#
# location of the checkout out git tree
GITDIR=/tmp/iofsl-daily
# URL to clone
GITURL=git://git.mcs.anl.gov/iofsl
# branch to watch
BRANCH=origin/master
changed=0
if ! test -d "${GITDIR}" ; then
git clone ${GITURL} ${GITDIR} || exit 1
changed=1
else
cd ${GITDIR}
git remote update || exit 1
count=$(git rev-list HEAD..${BRANCH} --count)
if test 0 -lt "${count}" ; then
changed=1
fi
fi
if test "$changed" != "1"; then
exit 0
fi
echo "Need to build daily build"
cd ${GITDIR}
git pull --rebase
#!/bin/bash
echo "Building BMI"
DEPBUILDDIR="${1}/bmi"
INPUT="$2"
PREFIX="$3"
echo $*
mkdir -p "${DEPBUILDDIR}"
cd "${DEPBUILDDIR}"
tar --strip-components 1 -C "${DEPBUILDDIR}" -xzf "${INPUT}" || exit 1
cd "${DEPBUILDDIR}"
./configure --prefix="${PREFIX}" && make && make install
#!/bin/bash
echo "Building BOOST"
DEPBUILDDIR="${1}/boost"
INPUT="$2"
PREFIX="$3"
LIBS="atomic,chrono,date_time,exception,filesystem,iostreams,program_options,random,regex,system,test,thread,timer,wave"
mkdir -p "${DEPBUILDDIR}"
cd "${DEPBUILDDIR}"
tar --strip-components 1 -C "${DEPBUILDDIR}" -xf "${INPUT}"
cd "${DEPBUILDDIR}"
./bootstrap.sh --prefix="$PREFIX" --with-libraries="${LIBS}"
./b2 install
#!/bin/bash
echo "Building OpenPA"
DEPBUILDDIR="${1}/openpa"
INPUT="$2"
PREFIX="$3"
echo $*
mkdir -p "${DEPBUILDDIR}"
cd "${DEPBUILDDIR}"
tar --strip-components 1 -C "${DEPBUILDDIR}" -xzf "${INPUT}" || exit 1
cd "${DEPBUILDDIR}"
./configure --prefix="${PREFIX}" && make && make install
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment