diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2016-08-19 11:21:43 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2016-08-19 11:21:43 -0400 |
commit | c1189149053228204277708cc01037e6c9891d37 (patch) | |
tree | 428c25de7334c2df058ef87f846f33f5c0390f3c /bin | |
parent | a26ab9064bc34e6695cb1e255522fab3f55deeb8 (diff) | |
download | astroconda-control-master.tar.gz |
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/build.sh | 36 | ||||
-rwxr-xr-x | bin/docs_jwst.sh | 5 | ||||
-rwxr-xr-x | bin/tests_dev27.sh | 4 | ||||
-rwxr-xr-x | bin/tests_jwst_dev27.sh | 4 | ||||
-rwxr-xr-x | bin/tests_okify.sh | 6 | ||||
-rwxr-xr-x | bin/tests_okify_tables.sh | 33 | ||||
-rwxr-xr-x | bin/tests_public27.sh | 7 | ||||
-rwxr-xr-x | bin/update_all.sh | 14 |
8 files changed, 92 insertions, 17 deletions
diff --git a/bin/build.sh b/bin/build.sh index 177c47c..0a60284 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -28,10 +28,6 @@ # exit regardless of exit method. Signals and general exit calls are ALL # handled equally. # -# If you do, you will quickly fill up the partition. Builds can be as large -# as 4GB, and potentially larger as time goes on. Don't be a doofus; always -# run "porcelain_deinit". You have been warned. -# # Never run a build outside of the "midnight_special" environment. The IRAF # account is a total mess. "midnight_special" performs a magical ritutal # that reassigns $HOME and effectively carpet bombs the original environment. @@ -40,8 +36,10 @@ source /eng/ssb/auto/astroconda/include/midnight_special.sh source /eng/ssb/auto/astroconda/include/sysinfo.sh -source /eng/ssb/auto/astroconda/include/conda_porcelain.sh +source /eng/ssb/auto/astroconda/include/error.sh source /eng/ssb/auto/astroconda/include/logger.sh +source /eng/ssb/auto/astroconda/include/conda_porcelain.sh + function warning_sleep { @@ -52,7 +50,7 @@ function warning_sleep echo "YOU PROBABLY DO NOT WANT THIS!" echo "Sleeping for $wtime second(s) just in case." - #sleep $wtime + sleep $wtime echo "Continuing..." } @@ -65,12 +63,16 @@ function repo_transfer if [[ -z $path ]]; then echo "transfer_repo requires a path." + error_set _E_FLAG_FAILED + error_set _E_FLAG_BAD_ARGUMENT exit 1 fi if [[ $path == *${repo_arch} ]]; then echo "tranfer_repo received an invalid path: $path" echo "(Remove the trailing /$repo_arch)" + error_set _E_FLAG_FAILED + error_set _E_FLAG_BAD_ARGUMENT exit 1 fi @@ -83,7 +85,8 @@ function repo_transfer retval=$? if [[ $retval > 0 ]]; then - exit $? + error_set _E_FLAG_BAD_RETVAL + return $? fi } @@ -92,11 +95,13 @@ function repo_index local path="$1" if [[ -z $path ]]; then echo "index_repo requires a path" + error_set _E_FLAG_BAD_ARGUMENT exit 1 fi if [[ ! -d $path ]]; then echo "$path does not exist." + error_set _E_FLAG_BAD_ARGUMENT exit 1 fi @@ -105,7 +110,8 @@ function repo_index retval=$? if [[ $retval > 0 ]]; then - exit $retval + error_set _E_FLAG_BAD_RETVAL + return $retval fi } @@ -317,6 +323,7 @@ pushd "$PORCELAIN_PREFIX" conda install --yes --quiet conda-build=1.18.1 conda=3.19.1 if [[ $? > 0 ]]; then echo "Unable to install conda-build, so stopping." + error_set _E_FLAG_HALT_AND_CATCH_FIRE exit 1 fi echo @@ -324,6 +331,7 @@ pushd "$PORCELAIN_PREFIX" git clone $repo_git if [[ $? > 0 ]]; then echo "Unable to clone recipe repository $repo_git, so stopping." + error_set _E_FLAG_HALT_AND_CATCH_FIRE exit 1 fi echo @@ -337,6 +345,10 @@ pushd "$PORCELAIN_PREFIX" fi logger $LOGDIR/${pkg}.log $build_command $pkg + + if [[ $? > 0 ]]; then + error_set _E_FLAG_BAD_PACKAGE + fi done else # Pretty much the worst thing you could ever WANT to do... @@ -344,17 +356,23 @@ pushd "$PORCELAIN_PREFIX" for pkg in * do [[ ! -f $pkg/meta.yaml ]] && continue + logger $LOGDIR/${pkg}.log $build_command $pkg + + if [[ $? > 0 ]]; then + error_set _E_FLAG_BAD_PACKAGE + fi done fi echo '----' logger repo_transfer.log repo_transfer "$repo_deposit" + echo '----' logger repo_index.log repo_index "$repo_deposit/$repo_arch" + echo '----' popd popd porcelain_deinit - diff --git a/bin/docs_jwst.sh b/bin/docs_jwst.sh index 1542cdd..1d01027 100755 --- a/bin/docs_jwst.sh +++ b/bin/docs_jwst.sh @@ -1,5 +1,6 @@ #!/bin/bash source /eng/ssb/auto/astroconda/include/midnight_special.sh +source /eng/ssb/auto/astroconda/include/error.sh source /eng/ssb/auto/astroconda/include/conda_porcelain.sh source /eng/ssb/auto/astroconda/include/texlive.sh @@ -20,8 +21,8 @@ pushd "$PORCELAIN_PREFIX" --yes \ --quiet \ --override-channels \ - -c defaults \ - -c $repo_conda sphinx=1.3.5 jwst stsci.sphinxext + -c $repo_conda \ + -c defaults sphinx=1.3.5 jwst stsci.sphinxext source activate $build_env diff --git a/bin/tests_dev27.sh b/bin/tests_dev27.sh index a1cd0b9..532a503 100755 --- a/bin/tests_dev27.sh +++ b/bin/tests_dev27.sh @@ -11,7 +11,7 @@ repo=http://ssb.stsci.edu/conda-dev source activate rt_${context}27 # Update environment -conda update -q -y --override-channels -c defaults -c $repo --all +conda update -q -y --override-channels -c $repo -c defaults --all source /eng/ssb/auto/astroconda/include/post-common.sh @@ -31,6 +31,8 @@ set -x [[ -d $LOGDIR ]] && [[ $LOGDIR != ^/$ ]] && rm -f "$LOGDIR/*" pushd $LOGDIR time pdkrun --parallel=${CPU_COUNT} -r "${tests[@]}" + retval=$? popd cat ${PDK_LOG}* | ssh iraf@ssb "irafdev ; pdk import -" +exit $retval diff --git a/bin/tests_jwst_dev27.sh b/bin/tests_jwst_dev27.sh index bb8878b..cf702ec 100755 --- a/bin/tests_jwst_dev27.sh +++ b/bin/tests_jwst_dev27.sh @@ -11,7 +11,7 @@ repo=http://ssb.stsci.edu/conda-dev source activate rt_${context}27 # Update environment -conda update -q -y --override-channels -c defaults -c $repo --all +conda update -q -y --override-channels -c $repo -c defaults --all source /eng/ssb/auto/astroconda/include/post-common.sh @@ -28,6 +28,8 @@ set -x [[ -d $LOGDIR ]] && [[ $LOGDIR != ^/$ ]] && rm -f "$LOGDIR/*" pushd $LOGDIR time pdkrun --parallel=${CPU_COUNT} -r "${tests[@]}" + retval=$? popd cat ${PDK_LOG}* | ssh iraf@ssb "irafdev ; pdk import -" +exit $retval diff --git a/bin/tests_okify.sh b/bin/tests_okify.sh index b46c43d..4b169fb 100755 --- a/bin/tests_okify.sh +++ b/bin/tests_okify.sh @@ -2,6 +2,8 @@ source /eng/ssb/auto/astroconda/include/midnight_special.sh source /eng/ssb/auto/astroconda/include/pre-common.sh +source activate pandokia + if [ "$groupdir" = "" ] then groupdir=/eng/ssb @@ -31,9 +33,13 @@ mv $h.ok $h.ok.process echo START +set -x + pdk ok -w $h.ok.process status=$? +set +x + echo END exit $status diff --git a/bin/tests_okify_tables.sh b/bin/tests_okify_tables.sh new file mode 100755 index 0000000..f4308fc --- /dev/null +++ b/bin/tests_okify_tables.sh @@ -0,0 +1,33 @@ +#!/bin/bash +source /eng/ssb/auto/astroconda/include/midnight_special.sh +source /eng/ssb/auto/astroconda/include/pre-common.sh +hostname=`hostname` + +case "$hostname" in + ssbwebv1*) + echo processing okify records in pandokia database + ;; + *) + echo $hostname cannot perform this action + exit 1 + ;; +esac + +# The only 'irafdev' gave us that we actually needed... +export PATH=/usr/stsci/pyssgdev/Python-2.7.1/bin:$PATH +export PYTHONPATH=/home/iraf/py/lib/python:/usr/stsci/pyssgdev/2.7.1.stsci_python:/usr/stsci/pyssgdev/2.7.1 + +# Pandokia specific (rather not clobber these together) +export N=82 +export PATH=/ssbwebv1/data2/pandokia/c$N/bin:$PATH +export PYTHONPATH=/ssbwebv1/data2/pandokia/c$N/lib/python/:$PYTHONPATH + +which pdk + +set -x + +pdk ok + +set +x + +exit $? diff --git a/bin/tests_public27.sh b/bin/tests_public27.sh index 1fa26b3..7f83419 100755 --- a/bin/tests_public27.sh +++ b/bin/tests_public27.sh @@ -7,11 +7,14 @@ name=conda context=public repo=http://ssb.stsci.edu/astroconda +# use RTX +test_from+='x' + # Activate environment source activate rt_${context}27 # Update environment -conda update -q -y --override-channels -c defaults -c $repo --all +conda update -q -y --override-channels -c $repo -c defaults --all source /eng/ssb/auto/astroconda/include/post-common.sh @@ -31,6 +34,8 @@ set -x [[ -d $LOGDIR ]] && [[ $LOGDIR != ^/$ ]] && rm -f "$LOGDIR/*" pushd $LOGDIR time pdkrun --parallel=${CPU_COUNT} -r "${tests[@]}" + retval=$? popd cat ${PDK_LOG}* | ssh iraf@ssb "irafdev ; pdk import -" +exit $retval diff --git a/bin/update_all.sh b/bin/update_all.sh index 11a5024..a89ef28 100755 --- a/bin/update_all.sh +++ b/bin/update_all.sh @@ -5,6 +5,8 @@ source /eng/ssb/auto/astroconda/include/pre-common.sh repo_base=http://ssb.stsci.edu contexts=( dev public ) versions=( 27 35 ) +tree_base=$(dirname $test_from) +trees=( rt rtx ) echo '----' echo 'Updating base installation:' @@ -37,15 +39,21 @@ do fi echo '----' echo "Updating $context from $repo:" - conda update -q -y --override-channels -c defaults -c $repo -n $environ --all + conda update -q -y --override-channels -c $repo -c defaults -n $environ --all echo '----' echo "Forcing pandokia to exist:" - conda install -q -y --override-channels -c defaults -c $repo -n $environ pandokia + conda install -q -y --override-channels -c $repo -c defaults -n $environ pandokia done done echo '----' echo 'Updating regression tests:' -svn_update `for d in /srv/rt/*; do [[ -d $d/.svn ]] && echo $d; done` +for tree in "${trees[@]}" +do + base="$tree_base/$tree" + if [[ -d $base/.svn ]]; then + svn_update $base + fi +done echo '----' |