Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glib2 travis issue [WIP] #83

Merged
merged 27 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6f9cda2
hoping to help travis not use /lib64
doutriaux1 Jan 24, 2017
b77562d
since issue is only linux turning off osx for now
doutriaux1 Jan 24, 2017
c014999
while testing turning off other numpys
doutriaux1 Jan 24, 2017
c3fd47e
ok trying to run a docker now
doutriaux1 Jan 25, 2017
0707d87
another try at docker
doutriaux1 Jan 25, 2017
52c5f19
no if test while testing
doutriaux1 Jan 25, 2017
8625381
make sure conda_upload is executable, added bash header to it, full p…
doutriaux1 Jan 25, 2017
533b671
-c is not needed
doutriaux1 Jan 25, 2017
152c617
installing missing packages on centos6
doutriaux1 Jan 26, 2017
d1e7690
more verbose docker
doutriaux1 Jan 26, 2017
cb43ef2
gfortra needed
doutriaux1 Jan 26, 2017
01cda8e
quiet because output seems too long
doutriaux1 Jan 26, 2017
59c425a
need to print env to see what is really passed
doutriaux1 Jan 26, 2017
a620147
trying to use our custom docker image with everything pre-loaded
doutriaux1 Feb 9, 2017
feac6c3
seems like networks hangs so putting a retry
doutriaux1 Feb 9, 2017
18f8f07
for the purpose of testing docker turing off actuall travis bits
doutriaux1 Feb 9, 2017
deef08f
get latest docker image with conda-forge pkg pre-downloaded
doutriaux1 Feb 9, 2017
3aed5cf
trying to matrix oses
doutriaux1 Feb 9, 2017
39d4f37
need to put os before matrix?
doutriaux1 Feb 9, 2017
5dc8480
dropping matrix can't figure it out
doutriaux1 Feb 9, 2017
86e671a
trying to add circle ci
doutriaux1 Feb 10, 2017
c933d48
needs a checkout, copied from conda-forge
doutriaux1 Feb 10, 2017
6c93846
reorg a bit
doutriaux1 Feb 10, 2017
9275b12
ok actually running this thing now on circle-ci
doutriaux1 Feb 10, 2017
0da0c78
anonymous CDAT
doutriaux1 Feb 10, 2017
159c6cd
token removed it was in clear, wrong location for env variable
doutriaux1 Feb 10, 2017
bc158ea
putting mac back in for travis
doutriaux1 Feb 10, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
os:
- osx
- linux
sudo: false

sudo: required
services:
- docker

before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh; fi
Expand All @@ -14,7 +18,7 @@ script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then conda install -c conda-forge -c uvcdat uvcdat-nox pyopenssl; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then conda install -c conda-forge -c uvcdat uvcdat pyopenssl; fi
- export UVCDAT_ANONYMOUS_LOG=False
- vcs_download_sample_data
- travis_retry vcs_download_sample_data
- echo $TRAVIS_BRANCH
- export TRAVIS_PR_BRANCH=$TRAVIS_BRANCH
- echo $TRAVIS_EVENT_TYPE
Expand All @@ -25,4 +29,5 @@ env:
global:
secure: Z06idl4BP01QMhrocmfuYV4CcbLmb5ZJZoXXymDr5sLIIfqdMiSL/CfDCRkIwl44vKpTN5R9AAhQV6iNMdU0NOQQrftHJyT5YV4y966FuAA1v9ev7y/cgExJFv7M/4E37WAN6YIcO7E42KZReeNKOAodorpqoT87MW6FAImZbrM=
after_success:
- if [ $TRAVIS_BRANCH == "master" -a $TRAVIS_PULL_REQUEST == "false" ]; then conda install conda-build && conda install anaconda-client && bash conda_upload.sh ; fi
- 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
- 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
24 changes: 24 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
general:
branches:
ignore:
# We only want to build pull requests for testing. If something is merged,
# then we are prepping for release an there is no need to build it again.
- master

checkout:
post:
- ./scripts/checkout_merge_commit.sh

machine:
services:
- docker

dependencies:
# Note, we used to use the naive caching of docker images, but found that it was quicker
# just to pull each time. #rollondockercaching
override:
- docker pull cdat/conda:conda-forge-cdms2

test:
override:
- docker run -it -v `pwd`:/git_repo -a STDOUT -a STDERR -P cdat/conda:conda-forge-cdms2 /git_repo/scripts/circle.sh
29 changes: 29 additions & 0 deletions scripts/checkout_merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash


# Add `master` branch to the update list.
# Otherwise CircleCI will give us a cached one.
FETCH_REFS="+master:master"

# Update PR refs for testing.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head"
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Retrieve the refs.
git fetch -u origin ${FETCH_REFS}

# Checkout the PR merge ref.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Check for merge conflicts.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git branch --merged | grep master > /dev/null
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
fi
32 changes: 32 additions & 0 deletions scripts/circle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
PKG_NAME=cdms2
USER=uvcdat
export PATH=${HOME}/miniconda2/bin:${PATH}
echo "Trying to upload conda"
conda update -y -q conda
conda install -c conda-forge -c uvcdat uvcdat-nox pyopenssl
export UVCDAT_ANONYMOUS_LOG=False
vcs_download_sample_data
#mkdir ${HOME}/conda-bld
conda config --set anaconda_upload no
#export CONDA_BLD_PATH=${HOME}/conda-bld
#export VERSION=`date +%Y.%m.%d`
echo "Cloning recipes"
cd /git_repo
ls -l
python setup.py install
python run_tests.py
#git clone git://github.com/UV-CDAT/conda-recipes
#cd conda-recipes
# uvcdat creates issues for build -c uvcdat confises package and channel
#rm -rf uvcdat
#python ./prep_for_build.py -v `date +%Y.%m.%d`
#echo "Building now"
#conda build -c conda-forge -c uvcdat --numpy=1.11 cdms2
#echo "Uploading"
#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
#conda build cdms2 -c conda-forge -c uvcdat --numpy=1.10
#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
#conda build cdms2 -c conda-forge -c uvcdat --numpy=1.9
#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

17 changes: 14 additions & 3 deletions conda_upload.sh → scripts/conda_upload.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
#!/usr/bin/env bash
PKG_NAME=cdms2
USER=uvcdat
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
echo "Trying to upload conda"
if [ `uname` == "Linux" ]; then
OS=linux-64
echo "Linux OS"
export PATH="$HOME/miniconda2/bin:$PATH"
conda update -y -q conda
else
echo "Mac OS"
OS=osx-64
fi

mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld
export CONDA_BLD_PATH=${HOME}/conda-bld
export VERSION=`date +%Y.%m.%d`
echo "Cloning recipes"
git clone git://github.com/UV-CDAT/conda-recipes
cd conda-recipes
# uvcdat creates issues for build -c uvcdat confises package and channel
rm -rf uvcdat
python ./prep_for_build.py -v `date +%Y.%m.%d`
conda build cdms2 -c conda-forge -c uvcdat --numpy=1.11
echo "Building now"
conda build -c conda-forge -c uvcdat --numpy=1.11 cdms2
echo "Uploading"
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
conda build cdms2 -c conda-forge -c uvcdat --numpy=1.10
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
Expand Down
17 changes: 13 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
os.environ["CFLAGS"]="-w -g"
pass

libs_pth = os.path.join(sys.prefix,"lib")
setup (name = "cdms2",
version=Version,
description = "Climate Data Management System",
Expand All @@ -76,11 +77,13 @@
library_dirs = cdat_info.cdunif_library_directories,
libraries = cdat_info.cdunif_libraries,
define_macros = macros,
extra_compile_args = [ ""],
runtime_library_dirs = [libs_pth],
extra_compile_args = [ "-L%s"% libs_pth],
),
Extension('cdms2._bindex',
['Src/_bindexmodule.c', 'Src/bindex.c'],
extra_compile_args = [ ""],
extra_compile_args = [ "-L%s"% libs_pth],
runtime_library_dirs = [libs_pth],
)
]
)
Expand All @@ -99,6 +102,12 @@
packages = ['regrid2'],
package_dir = {'regrid2': 'regrid2/Lib'},
include_dirs = [numpy.lib.utils.get_include()],
ext_modules = [Extension('regrid2._regrid', ['regrid2/Src/_regridmodule.c']),
Extension('regrid2._scrip', ['regrid2/Src/scrip.pyf','regrid2/Src/regrid.c'])]
ext_modules = [Extension('regrid2._regrid', ['regrid2/Src/_regridmodule.c'],
runtime_library_dirs = [libs_pth],
extra_compile_args = [ "-L%s"% libs_pth],
),
Extension('regrid2._scrip', ['regrid2/Src/scrip.pyf','regrid2/Src/regrid.c'],
runtime_library_dirs = [libs_pth],
extra_compile_args = [ "-L%s"% libs_pth],
)]
)