From c0ef816b5651310747eb2c3d0807f506a9d643e2 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 23 Aug 2018 20:23:51 -0500 Subject: [PATCH 1/4] Split build-and-test-py-project-within-miniconda.sh to 2 files --- build-and-test-py-project-within-miniconda.sh | 54 +----------------- build-py-project-within-miniconda.sh | 56 +++++++++++++++++++ 2 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 build-py-project-within-miniconda.sh diff --git a/build-and-test-py-project-within-miniconda.sh b/build-and-test-py-project-within-miniconda.sh index 770b64a..0f4c0fd 100644 --- a/build-and-test-py-project-within-miniconda.sh +++ b/build-and-test-py-project-within-miniconda.sh @@ -1,62 +1,14 @@ #! /bin/bash -echo "-----------------------------------------------" -echo "Current directory: $(pwd)" -echo "Conda environment file: ${CONDA_ENVIRONMENT}" -echo "Extra pip requirements: ${REQUIREMENTS_TXT}" -echo "Extra pytest options: ${PYTEST_ADDOPTS}" -echo "PYOPENCL_TEST: ${PYOPENCL_TEST}" -echo "PYTEST_ADDOPTS: ${PYTEST_ADDOPTS}" -echo "git revision: $(git rev-parse --short HEAD)" -echo "git status:" -git status -s -echo "-----------------------------------------------" - -if [ "$(uname)" = "Darwin" ]; then - PLATFORM=MacOSX -else - PLATFORM=Linux -fi - -# {{{ download and install - -MINICONDA_VERSION=3 -MINICONDA_INSTALL_DIR=.miniconda${MINICONDA_VERSION} - -MINICONDA_INSTALL_SH=Miniconda${MINICONDA_VERSION}-latest-${PLATFORM}-x86_64.sh -curl -O "https://repo.continuum.io/miniconda/$MINICONDA_INSTALL_SH" - -rm -Rf "$MINICONDA_INSTALL_DIR" - -bash "$MINICONDA_INSTALL_SH" -b -p "$MINICONDA_INSTALL_DIR" - -# }}} - -# {{{ set up testing environment - -PATH="$MINICONDA_INSTALL_DIR/bin/:$PATH" conda update conda --yes --quiet - -PATH="$MINICONDA_INSTALL_DIR/bin/:$PATH" conda update --all --yes --quiet - -PATH="$MINICONDA_INSTALL_DIR/bin:$PATH" conda env create --quiet --file "$CONDA_ENVIRONMENT" --name testing - -source "$MINICONDA_INSTALL_DIR/bin/activate" testing - -if test -f "$REQUIREMENTS_TXT"; then - conda install --quiet --yes pip - pip install -r "$REQUIREMENTS_TXT" -fi +curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-within-miniconda.sh +source build-py-project-within-miniconda.sh conda install --quiet --yes pytest -# }}} +conda list PY_EXE=python -${PY_EXE} setup.py install - -conda list - TESTABLES="" if [ -d test ]; then cd test diff --git a/build-py-project-within-miniconda.sh b/build-py-project-within-miniconda.sh new file mode 100644 index 0000000..2934dcb --- /dev/null +++ b/build-py-project-within-miniconda.sh @@ -0,0 +1,56 @@ +#! /bin/bash + +echo "-----------------------------------------------" +echo "Current directory: $(pwd)" +echo "Conda environment file: ${CONDA_ENVIRONMENT}" +echo "Extra pip requirements: ${REQUIREMENTS_TXT}" +echo "Extra pytest options: ${PYTEST_ADDOPTS}" +echo "PYOPENCL_TEST: ${PYOPENCL_TEST}" +echo "PYTEST_ADDOPTS: ${PYTEST_ADDOPTS}" +echo "git revision: $(git rev-parse --short HEAD)" +echo "git status:" +git status -s +echo "-----------------------------------------------" + +if [ "$(uname)" = "Darwin" ]; then + PLATFORM=MacOSX +else + PLATFORM=Linux +fi + +# {{{ download and install + +MINICONDA_VERSION=3 +MINICONDA_INSTALL_DIR=.miniconda${MINICONDA_VERSION} + +MINICONDA_INSTALL_SH=Miniconda${MINICONDA_VERSION}-latest-${PLATFORM}-x86_64.sh +curl -O "https://repo.continuum.io/miniconda/$MINICONDA_INSTALL_SH" + +rm -Rf "$MINICONDA_INSTALL_DIR" + +bash "$MINICONDA_INSTALL_SH" -b -p "$MINICONDA_INSTALL_DIR" + +# }}} + +# {{{ set up testing environment + +PATH="$MINICONDA_INSTALL_DIR/bin/:$PATH" conda update conda --yes --quiet + +PATH="$MINICONDA_INSTALL_DIR/bin/:$PATH" conda update --all --yes --quiet + +PATH="$MINICONDA_INSTALL_DIR/bin:$PATH" conda env create --quiet --file "$CONDA_ENVIRONMENT" --name testing + +source "$MINICONDA_INSTALL_DIR/bin/activate" testing + +if test -f "$REQUIREMENTS_TXT"; then + conda install --quiet --yes pip + pip install -r "$REQUIREMENTS_TXT" +fi + +# }}} + +PY_EXE=python + +${PY_EXE} setup.py install + +conda list -- GitLab From 23a1ec6ec5e53f966d6722b85a7209b3445c0711 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 23 Aug 2018 20:26:36 -0500 Subject: [PATCH 2/4] benchmark using asv --- build-and-benchmark-py-project.sh | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 build-and-benchmark-py-project.sh diff --git a/build-and-benchmark-py-project.sh b/build-and-benchmark-py-project.sh new file mode 100644 index 0000000..5997df5 --- /dev/null +++ b/build-and-benchmark-py-project.sh @@ -0,0 +1,46 @@ +curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-within-miniconda.sh +source build-py-project-within-miniconda.sh + +pip install asv + +conda list + +PY_EXE=python + +if [[ ! -z "$PROJECT" ]]; then + echo "PROJECT env var not set" + exit 1 +fi + +mkdir -p ~/.$PROJECT/asv + +if [[ ! -z "$CI" ]]; then + if [[ "$CI_PROJECT_NAMESPACE" == "inducer" ]]; then + ln -s ~/.$PROJECT/asv .asv + else + # Copy, so that the original folder is not changed. + cp -r ~/.$PROJECT/asv .asv + fi +fi + +asv machine --yes +asv setup --verbose +master_commit=`git rev-parse master` +test_commit=`git rev-parse HEAD` + +export PYOPENCL_CTX=port + +asv run $master_commit...$master_commit~ --skip-existing --verbose +asv run $test_commit...$test_commit~ --skip-existing --verbose + +output=`asv compare $master_commit $test_commit --factor 1 -s` +echo "$output" + +if [[ "$output" = *"worse"* ]]; then + echo "Some of the benchmarks have gotten worse" + exit 1 +fi + +if [[ "$CI_PROJECT_NAMESPACE" == "inducer" ]]; then + asv publish --html-dir ~/.scicomp-benchmarks/asv/$PROJECT +fi -- GitLab From d9ff5699c347773ca759d9c336e2dd8c05194a33 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 24 Aug 2018 01:16:52 -0400 Subject: [PATCH 3/4] Update build-and-test-py-project-within-miniconda.sh --- build-and-test-py-project-within-miniconda.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-and-test-py-project-within-miniconda.sh b/build-and-test-py-project-within-miniconda.sh index 0f4c0fd..d5521b0 100644 --- a/build-and-test-py-project-within-miniconda.sh +++ b/build-and-test-py-project-within-miniconda.sh @@ -1,6 +1,6 @@ #! /bin/bash -curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-within-miniconda.sh +curl -L -O -k https://gitlab.tiker.net/isuruf/ci-support/raw/bench/build-py-project-within-miniconda.sh source build-py-project-within-miniconda.sh conda install --quiet --yes pytest -- GitLab From 2ec84e536bcbab664be80d15175ead0f718f43da Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 24 Aug 2018 09:22:45 -0400 Subject: [PATCH 4/4] Revert "Update build-and-test-py-project-within-miniconda.sh" This reverts commit d9ff5699c347773ca759d9c336e2dd8c05194a33. --- build-and-test-py-project-within-miniconda.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-and-test-py-project-within-miniconda.sh b/build-and-test-py-project-within-miniconda.sh index d5521b0..0f4c0fd 100644 --- a/build-and-test-py-project-within-miniconda.sh +++ b/build-and-test-py-project-within-miniconda.sh @@ -1,6 +1,6 @@ #! /bin/bash -curl -L -O -k https://gitlab.tiker.net/isuruf/ci-support/raw/bench/build-py-project-within-miniconda.sh +curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-within-miniconda.sh source build-py-project-within-miniconda.sh conda install --quiet --yes pytest -- GitLab