-
Notifications
You must be signed in to change notification settings - Fork 1
/
stack_install.sh
executable file
·68 lines (63 loc) · 2.16 KB
/
stack_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash -xe
#
# A script to setup the Travis build environment with Miniconda
# and install the LSST stack into it.
MINICONDA_VERSION=${MINICONDA_VERSION:-"latest"}
CHANNEL=${CHANNEL:-"http://conda.lsst.codes/stack/0.13.0"}
CACHE_DIR="$HOME/miniconda.tarball"
CACHE_DIR_TMP="$CACHE_DIR.tmp"
CACHE_TARBALL_NAME="miniconda.tar.gz"
CACHE_TARBALL_PATH="$CACHE_DIR/$CACHE_TARBALL_NAME"
PACKAGES="gcc lsst-daf-persistence lsst-log lsst-afw lsst-skypix lsst-meas-algorithms lsst-pipe-tasks lsst-obs-cfht"
# Store a record of what's in the cached tarball
# This record allows us to automatically regenerate the tarball if the installed packages change.
rm -f "$HOME/info.txt"
cat > "$HOME/info.txt" <<-EOT
# -- cache information; autogenerated by ci/install.sh
MINICONDA_VERSION=$MINICONDA_VERSION
CHANNEL=$CHANNEL
PACKAGES=$PACKAGES
EOT
cat "$HOME/info.txt"
ls -l $HOME
ls -l $CACHE_DIR
if [ -f "$CACHE_TARBALL_PATH" ] && cmp "$HOME/info.txt" "$CACHE_DIR/info.txt"; then
# Restore from cached tarball
tar xzf "$CACHE_TARBALL_PATH" -C "$HOME"
ls -l "$HOME"
export PATH="$HOME/miniconda/bin:$PATH"
source activate lsst
else
# Miniconda install
# Install Python 2.7 Miniconda
wget https://repo.continuum.io/miniconda/Miniconda2-$MINICONDA_VERSION-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
# Stack install
conda config --add channels "$CHANNEL"
conda create -q -n lsst python=$TRAVIS_PYTHON_VERSION
source activate lsst
conda install -q $PACKAGES
# Pack for caching. We pack here as Travis tends to time out if it can't pack
# the whole directory in ~180 seconds.
rm -rf "$CACHE_DIR" "$CACHE_DIR_TMP"
mkdir "$CACHE_DIR_TMP"
tar czf "$CACHE_DIR_TMP/$CACHE_TARBALL_NAME" -C "$HOME" miniconda
mv "$HOME/info.txt" "$CACHE_DIR_TMP"
mv "$CACHE_DIR_TMP" "$CACHE_DIR" # Atomic rename
ls -l "$CACHE_DIR"
fi
# Install obs_cfht
#source eups-setups.sh
#setup daf_persistence
#git clone https://github.com/lsst/obs_cfht.git
#cd obs_cfht
#git checkout b7ab2c4
#setup -k -r .
#scons opt=3
#eups declare -r . -t travis
#cd ../