Skip to content

Commit 1cd6401

Browse files
authored
Glib2 travis issue [WIP] (#83)
* hoping to help travis not use /lib64 * since issue is only linux turning off osx for now also uploading on all successes * while testing turning off other numpys * ok trying to run a docker now * another try at docker * no if test while testing * make sure conda_upload is executable, added bash header to it, full path for docker * -c is not needed * installing missing packages on centos6 * more verbose docker * gfortra needed * quiet because output seems too long * need to print env to see what is really passed * trying to use our custom docker image with everything pre-loaded * seems like networks hangs so putting a retry * for the purpose of testing docker turing off actuall travis bits * get latest docker image with conda-forge pkg pre-downloaded build numpy 1.11, 1.10 , 1.9 * trying to matrix oses * need to put os before matrix? * dropping matrix can't figure it out * trying to add circle ci * needs a checkout, copied from conda-forge * reorg a bit * ok actually running this thing now on circle-ci * anonymous CDAT * token removed it was in clear, wrong location for env variable * putting mac back in for travis
1 parent d403f31 commit 1cd6401

File tree

6 files changed

+120
-10
lines changed

6 files changed

+120
-10
lines changed

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
os:
22
- osx
33
- linux
4-
sudo: false
4+
5+
sudo: required
6+
services:
7+
- docker
8+
59
before_install:
610
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; fi
711
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh; fi
@@ -14,7 +18,7 @@ script:
1418
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then conda install -c conda-forge -c uvcdat uvcdat-nox pyopenssl; fi
1519
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then conda install -c conda-forge -c uvcdat uvcdat pyopenssl; fi
1620
- export UVCDAT_ANONYMOUS_LOG=False
17-
- vcs_download_sample_data
21+
- travis_retry vcs_download_sample_data
1822
- echo $TRAVIS_BRANCH
1923
- export TRAVIS_PR_BRANCH=$TRAVIS_BRANCH
2024
- echo $TRAVIS_EVENT_TYPE
@@ -25,4 +29,5 @@ env:
2529
global:
2630
secure: Z06idl4BP01QMhrocmfuYV4CcbLmb5ZJZoXXymDr5sLIIfqdMiSL/CfDCRkIwl44vKpTN5R9AAhQV6iNMdU0NOQQrftHJyT5YV4y966FuAA1v9ev7y/cgExJFv7M/4E37WAN6YIcO7E42KZReeNKOAodorpqoT87MW6FAImZbrM=
2731
after_success:
28-
- if [ $TRAVIS_BRANCH == "master" -a $TRAVIS_PULL_REQUEST == "false" ]; then conda install conda-build && conda install anaconda-client && bash conda_upload.sh ; fi
32+
- if [ $TRAVIS_BRANCH == "master" -a $TRAVIS_PULL_REQUEST == "false" -a "$TRAVIS_OS_NAME" = "osx"]; then conda install conda-build && conda install anaconda-client && bash scripts/conda_upload.sh ; fi
33+
- if [ $TRAVIS_BRANCH == "master" -a $TRAVIS_PULL_REQUEST == "false" -a "$TRAVIS_OS_NAME" = "linux"]; docker run -v `pwd`:/travis_home -e CONDA_UPLOAD_TOKEN=${CONDA_UPLOAD_TOKEN} -a STDOUT cdat/conda:conda-forge-cdms2 /travis_home/scripts/conda_upload.sh ; fi

circle.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
general:
2+
branches:
3+
ignore:
4+
# We only want to build pull requests for testing. If something is merged,
5+
# then we are prepping for release an there is no need to build it again.
6+
- master
7+
8+
checkout:
9+
post:
10+
- ./scripts/checkout_merge_commit.sh
11+
12+
machine:
13+
services:
14+
- docker
15+
16+
dependencies:
17+
# Note, we used to use the naive caching of docker images, but found that it was quicker
18+
# just to pull each time. #rollondockercaching
19+
override:
20+
- docker pull cdat/conda:conda-forge-cdms2
21+
22+
test:
23+
override:
24+
- docker run -it -v `pwd`:/git_repo -a STDOUT -a STDERR -P cdat/conda:conda-forge-cdms2 /git_repo/scripts/circle.sh

scripts/checkout_merge_commit.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
4+
# Add `master` branch to the update list.
5+
# Otherwise CircleCI will give us a cached one.
6+
FETCH_REFS="+master:master"
7+
8+
# Update PR refs for testing.
9+
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
10+
then
11+
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head"
12+
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge"
13+
fi
14+
15+
# Retrieve the refs.
16+
git fetch -u origin ${FETCH_REFS}
17+
18+
# Checkout the PR merge ref.
19+
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
20+
then
21+
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge"
22+
fi
23+
24+
# Check for merge conflicts.
25+
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
26+
then
27+
git branch --merged | grep master > /dev/null
28+
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
29+
fi

scripts/circle.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
PKG_NAME=cdms2
3+
USER=uvcdat
4+
export PATH=${HOME}/miniconda2/bin:${PATH}
5+
echo "Trying to upload conda"
6+
conda update -y -q conda
7+
conda install -c conda-forge -c uvcdat uvcdat-nox pyopenssl
8+
export UVCDAT_ANONYMOUS_LOG=False
9+
vcs_download_sample_data
10+
#mkdir ${HOME}/conda-bld
11+
conda config --set anaconda_upload no
12+
#export CONDA_BLD_PATH=${HOME}/conda-bld
13+
#export VERSION=`date +%Y.%m.%d`
14+
echo "Cloning recipes"
15+
cd /git_repo
16+
ls -l
17+
python setup.py install
18+
python run_tests.py
19+
#git clone git://github.com/UV-CDAT/conda-recipes
20+
#cd conda-recipes
21+
# uvcdat creates issues for build -c uvcdat confises package and channel
22+
#rm -rf uvcdat
23+
#python ./prep_for_build.py -v `date +%Y.%m.%d`
24+
#echo "Building now"
25+
#conda build -c conda-forge -c uvcdat --numpy=1.11 cdms2
26+
#echo "Uploading"
27+
#anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-np111py27_0.tar.bz2 --force
28+
#conda build cdms2 -c conda-forge -c uvcdat --numpy=1.10
29+
#anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-np110py27_0.tar.bz2 --force
30+
#conda build cdms2 -c conda-forge -c uvcdat --numpy=1.9
31+
#anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-np19py27_0.tar.bz2 --force
32+

conda_upload.sh renamed to scripts/conda_upload.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1+
#!/usr/bin/env bash
12
PKG_NAME=cdms2
23
USER=uvcdat
3-
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
4+
echo "Trying to upload conda"
5+
if [ `uname` == "Linux" ]; then
46
OS=linux-64
7+
echo "Linux OS"
8+
export PATH="$HOME/miniconda2/bin:$PATH"
9+
conda update -y -q conda
510
else
11+
echo "Mac OS"
612
OS=osx-64
713
fi
814

915
mkdir ~/conda-bld
1016
conda config --set anaconda_upload no
11-
export CONDA_BLD_PATH=~/conda-bld
17+
export CONDA_BLD_PATH=${HOME}/conda-bld
1218
export VERSION=`date +%Y.%m.%d`
19+
echo "Cloning recipes"
1320
git clone git://github.com/UV-CDAT/conda-recipes
1421
cd conda-recipes
22+
# uvcdat creates issues for build -c uvcdat confises package and channel
23+
rm -rf uvcdat
1524
python ./prep_for_build.py -v `date +%Y.%m.%d`
16-
conda build cdms2 -c conda-forge -c uvcdat --numpy=1.11
25+
echo "Building now"
26+
conda build -c conda-forge -c uvcdat --numpy=1.11 cdms2
27+
echo "Uploading"
1728
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-np111py27_0.tar.bz2 --force
1829
conda build cdms2 -c conda-forge -c uvcdat --numpy=1.10
1930
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME-`date +%Y.%m.%d`-np110py27_0.tar.bz2 --force

setup.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
os.environ["CFLAGS"]="-w -g"
6464
pass
6565

66+
libs_pth = os.path.join(sys.prefix,"lib")
6667
setup (name = "cdms2",
6768
version=Version,
6869
description = "Climate Data Management System",
@@ -76,11 +77,13 @@
7677
library_dirs = cdat_info.cdunif_library_directories,
7778
libraries = cdat_info.cdunif_libraries,
7879
define_macros = macros,
79-
extra_compile_args = [ ""],
80+
runtime_library_dirs = [libs_pth],
81+
extra_compile_args = [ "-L%s"% libs_pth],
8082
),
8183
Extension('cdms2._bindex',
8284
['Src/_bindexmodule.c', 'Src/bindex.c'],
83-
extra_compile_args = [ ""],
85+
extra_compile_args = [ "-L%s"% libs_pth],
86+
runtime_library_dirs = [libs_pth],
8487
)
8588
]
8689
)
@@ -99,6 +102,12 @@
99102
packages = ['regrid2'],
100103
package_dir = {'regrid2': 'regrid2/Lib'},
101104
include_dirs = [numpy.lib.utils.get_include()],
102-
ext_modules = [Extension('regrid2._regrid', ['regrid2/Src/_regridmodule.c']),
103-
Extension('regrid2._scrip', ['regrid2/Src/scrip.pyf','regrid2/Src/regrid.c'])]
105+
ext_modules = [Extension('regrid2._regrid', ['regrid2/Src/_regridmodule.c'],
106+
runtime_library_dirs = [libs_pth],
107+
extra_compile_args = [ "-L%s"% libs_pth],
108+
),
109+
Extension('regrid2._scrip', ['regrid2/Src/scrip.pyf','regrid2/Src/regrid.c'],
110+
runtime_library_dirs = [libs_pth],
111+
extra_compile_args = [ "-L%s"% libs_pth],
112+
)]
104113
)

0 commit comments

Comments
 (0)