diff options
-rw-r--r-- | etc/hstdp-snapshot/pip/001-setuptools | 0 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pip/002-testing | 5 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pip/003-prerequisites | 3 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pip/004-pipeline | 24 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pkgs/000-dummy.sh | 2 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pkgs/001-cfitsio.sh | 15 | ||||
-rw-r--r-- | etc/hstdp-snapshot/pkgs/002-hstcal.sh | 18 | ||||
-rwxr-xr-x | etc/hstdp-snapshot/tasks/001-packages.sh | 43 | ||||
-rwxr-xr-x | etc/hstdp-snapshot/tasks/002-python-packages.sh | 40 | ||||
-rwxr-xr-x | etc/hstdp-snapshot/tasks/999-clean.sh | 18 |
10 files changed, 168 insertions, 0 deletions
diff --git a/etc/hstdp-snapshot/pip/001-setuptools b/etc/hstdp-snapshot/pip/001-setuptools new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/etc/hstdp-snapshot/pip/001-setuptools diff --git a/etc/hstdp-snapshot/pip/002-testing b/etc/hstdp-snapshot/pip/002-testing new file mode 100644 index 0000000..cbd39ce --- /dev/null +++ b/etc/hstdp-snapshot/pip/002-testing @@ -0,0 +1,5 @@ +nose +pytest +pytest-xdist +pytest-astropy +pytest-virtualenv diff --git a/etc/hstdp-snapshot/pip/003-prerequisites b/etc/hstdp-snapshot/pip/003-prerequisites new file mode 100644 index 0000000..e14f6f7 --- /dev/null +++ b/etc/hstdp-snapshot/pip/003-prerequisites @@ -0,0 +1,3 @@ +numpy +astropy +relic diff --git a/etc/hstdp-snapshot/pip/004-pipeline b/etc/hstdp-snapshot/pip/004-pipeline new file mode 100644 index 0000000..ffba706 --- /dev/null +++ b/etc/hstdp-snapshot/pip/004-pipeline @@ -0,0 +1,24 @@ +d2to1 +parsley +git+https://github.com/spacetelescope/stsci.imagestats +git+https://github.com/spacetelescope/stsci.stimage +git+https://github.com/spacetelescope/crds +git+https://github.com/spacetelescope/pysynphot +git+https://github.com/spacetelescope/reftools +git+https://github.com/spacetelescope/spherical_geometry +git+https://github.com/spacetelescope/stregion +git+https://github.com/spacetelescope/stsci.ndimage +git+https://github.com/spacetelescope/stsci.tools +git+https://github.com/spacetelescope/acstools +git+https://github.com/spacetelescope/calcos +git+https://github.com/spacetelescope/fitsblender +git+https://github.com/spacetelescope/nictools +git+https://github.com/spacetelescope/stistools +git+https://github.com/spacetelescope/stsci.image +git+https://github.com/spacetelescope/stsci.imagemanip +git+https://github.com/spacetelescope/stwcs +git+https://github.com/spacetelescope/wfc3tools +git+https://github.com/spacetelescope/wfpc2tools +git+https://github.com/spacetelescope/costools +git+https://github.com/spacetelescope/stsci.skypac +git+https://github.com/spacetelescope/drizzlepac diff --git a/etc/hstdp-snapshot/pkgs/000-dummy.sh b/etc/hstdp-snapshot/pkgs/000-dummy.sh new file mode 100644 index 0000000..06bd986 --- /dev/null +++ b/etc/hstdp-snapshot/pkgs/000-dummy.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exit 0 diff --git a/etc/hstdp-snapshot/pkgs/001-cfitsio.sh b/etc/hstdp-snapshot/pkgs/001-cfitsio.sh new file mode 100644 index 0000000..719b542 --- /dev/null +++ b/etc/hstdp-snapshot/pkgs/001-cfitsio.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e + +name=cfitsio +version=3440 +url=https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/${name}${version}.tar.gz + +sudo yum install -y libcurl-devel +curl -LO "${url}" +tar xf "$(basename ${url})" + +pushd "${name}" &>/dev/null +./configure --prefix="${PREFIX}" --enable-reentrant +make shared +make install +popd &>/dev/null diff --git a/etc/hstdp-snapshot/pkgs/002-hstcal.sh b/etc/hstdp-snapshot/pkgs/002-hstcal.sh new file mode 100644 index 0000000..fe45351 --- /dev/null +++ b/etc/hstdp-snapshot/pkgs/002-hstcal.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e +name=hstcal +version=2.2.0 +url="https://github.com/spacetelescope/${name}" + +# Grab a version of WAF that isn't broken +curl -o waf https://waf.io/waf-2.0.12 +chmod +x waf + +git clone "${url}" +pushd "${name}" &>/dev/null + git checkout "${version}" + + # Build / Install + ../waf configure --prefix=${PREFIX} --release-with-symbols --with-cfitsio=${PREFIX} + ../waf build + ../waf install +popd &>/dev/null diff --git a/etc/hstdp-snapshot/tasks/001-packages.sh b/etc/hstdp-snapshot/tasks/001-packages.sh new file mode 100755 index 0000000..e948120 --- /dev/null +++ b/etc/hstdp-snapshot/tasks/001-packages.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e +set -x + +prefix="${TOOLCHAIN}" +sysconfdir="${TOOLCHAIN_BUILD}/etc/${PIPELINE}" +reqdir=${sysconfdir}/pkgs +blddir=builds + +export PATH="${prefix}/bin:${PATH}" +export CFLAGS="-I${prefix}/include" +export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" +export PREFIX="${prefix}" + +function pre() +{ + if [[ ! -d ${reqdir} ]]; then + # Nothing there, but maybe that's on purpose. + exit 0 + fi + mkdir -p "${blddir}" + pushd ${blddir} &>/dev/null +} + +function build() +{ + pre + # Iterate over binary package build scripts + for req in ${reqdir}/* + do + chmod +x "${req}" + "${req}" + done + post +} + +function post() +{ + popd &>/dev/null + [[ -d ${blddir} ]] && rm -rf "${blddir}" +} + +build diff --git a/etc/hstdp-snapshot/tasks/002-python-packages.sh b/etc/hstdp-snapshot/tasks/002-python-packages.sh new file mode 100755 index 0000000..33714aa --- /dev/null +++ b/etc/hstdp-snapshot/tasks/002-python-packages.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +set -x + +# Uses GLOBAL environment variable: PYTHON_VERSION defined by `docker build` argument +prefix="${TOOLCHAIN}" +sysconfdir="${TOOLCHAIN_BUILD}/etc/${PIPELINE}" +reqdir=${sysconfdir}/pip + +export PATH="${prefix}/bin:${PATH}" +export CFLAGS="-I${prefix}/include" +export LDFLAGS="-L${prefix}/lib -Wl,-rpath=${prefix}/lib" + +function pre() +{ + if [[ ! -d ${reqdir} ]]; then + # Nothing there, but maybe that's on purpose. + exit 0 + fi +} + +function build() +{ + pre + # Iterate over pip requirement files + for req in ${reqdir}/* + do + pip install --upgrade --progress-bar=off -r "${req}" + done + post +} + +function post() +{ + rm -rf ~/.cache/pip + [[ -d src ]] && rm -rf src || true + [[ -f gmon.out ]] && rm -rf gmon.out || true +} + +build diff --git a/etc/hstdp-snapshot/tasks/999-clean.sh b/etc/hstdp-snapshot/tasks/999-clean.sh new file mode 100755 index 0000000..7487b9c --- /dev/null +++ b/etc/hstdp-snapshot/tasks/999-clean.sh @@ -0,0 +1,18 @@ +#!/bin/bash -x +if [[ ! -f /.dockerenv ]]; then + echo "This script cannot be executed outside of a docker container." + exit 1 +fi + +rm -rf "${HOME}/.astropy" +rm -rf "${HOME}/.cache" +rm -rf "${HOME}"/* + +sudo yum clean all +sudo rm -rf /tmp/* +sudo rm -rf /var/cache/yum + +for logfile in /var/log/* +do + sudo truncate --size=0 "${logfile}" +done |