From 61b8826eff5ee47f0401f2db7998771fb9cadeea Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Sun, 16 Aug 2015 21:07:59 -0500 Subject: [PATCH 01/15] Update conda if conda-env is not installed --- bin/steps/conda_compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 6b7d452..1486a0b 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -9,6 +9,7 @@ if [ ! -d /app/.heroku/miniconda ]; then conda update conda --quiet --yes | indent fi +conda environment --help || conda update conda --quiet --yes | indent if [ -f conda-requirements.txt ]; then puts-step "Installing dependencies using Conda" From 3d8e3276f81f0e16cd6bc36a11f304379000e5af Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Sun, 16 Aug 2015 21:15:34 -0500 Subject: [PATCH 02/15] Fix typo --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 1486a0b..4974ad8 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -9,7 +9,7 @@ if [ ! -d /app/.heroku/miniconda ]; then conda update conda --quiet --yes | indent fi -conda environment --help || conda update conda --quiet --yes | indent +conda env --help || conda update conda --quiet --yes | indent if [ -f conda-requirements.txt ]; then puts-step "Installing dependencies using Conda" From 708255bcc344a231c428f10db6c5eea75a0e9afe Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Sun, 16 Aug 2015 21:44:05 -0500 Subject: [PATCH 03/15] Make check for conda env more verbose while suppressing irrelevant output --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 4974ad8..aa44148 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -9,7 +9,7 @@ if [ ! -d /app/.heroku/miniconda ]; then conda update conda --quiet --yes | indent fi -conda env --help || conda update conda --quiet --yes | indent +(puts-setp "Checking for conda env" && conda env &> /dev/null) || conda update conda --quiet --yes | indent if [ -f conda-requirements.txt ]; then puts-step "Installing dependencies using Conda" From 198e36a34745e59d1b48aa3ef3e6469b914078f7 Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Mon, 24 Aug 2015 12:42:02 -0500 Subject: [PATCH 04/15] Fix typo --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index aa44148..b61bc1a 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -9,7 +9,7 @@ if [ ! -d /app/.heroku/miniconda ]; then conda update conda --quiet --yes | indent fi -(puts-setp "Checking for conda env" && conda env &> /dev/null) || conda update conda --quiet --yes | indent +(puts-step "Checking for conda env" && conda env &> /dev/null) || conda update conda --quiet --yes | indent if [ -f conda-requirements.txt ]; then puts-step "Installing dependencies using Conda" From f91d1d061ccf3e6152a0980fdd5fcb6d6f9c1217 Mon Sep 17 00:00:00 2001 From: Matthew Craig Date: Sun, 17 Jan 2016 21:28:57 -0600 Subject: [PATCH 05/15] Put heroku-env at the front of PATH if using an environment --- bin/compile | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/compile b/bin/compile index 784c077..4545395 100755 --- a/bin/compile +++ b/bin/compile @@ -91,6 +91,7 @@ PYTHONPATH='/app/.heroku/miniconda/lib/python2.7/site-packages:$PYTHONPATH' if [ -f environment.yml ]; then PYTHONPATH="/app/.heroku/miniconda/envs/heroku-env/lib/python2.7/site-packages:${PYTHONPATH}" set-default-env CONDA_DEFAULT_ENV "heroku-env" + set-env PATH '$HOME/.heroku/miniconda/envs/heroku-env/bin:$PATH' fi set-default-env PYTHONPATH $PYTHONPATH set-env PYTHONUNBUFFERED true From 901bc293e6d0101eefe32925aa7383b446eb56c7 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 21:44:05 -0600 Subject: [PATCH 06/15] Update miniconda version --- bin/steps/conda_compile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index b61bc1a..70a8414 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -1,8 +1,9 @@ #!/usr/bin/env bash -CONDA_VERSION=3.8.3 +CONDA_VERSION=4.3.31 +puts-step "Checking for existing conda install" if [ ! -d /app/.heroku/miniconda ]; then puts-step "Preparing Python/Miniconda Environment (${CONDA_VERSION})" - curl -Os http://repo.continuum.io/miniconda/Miniconda-${CONDA_VERSION}-Linux-x86_64.sh + curl -Os http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh bash Miniconda-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent rm -fr Miniconda-${CONDA_VERSION}-Linux-x86_64.sh From 50306ddb5bb3339a51359e5b1252f38e88b27bfe Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 22:10:45 -0600 Subject: [PATCH 07/15] Add more verbose output when creating environments --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 70a8414..f6d8882 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -21,7 +21,7 @@ if [ -f environment.yml ]; then puts-step "Creating conda environment" # TODO: Use update if its already there conda env remove --yes --quiet --name heroku-env - conda env create --name=heroku-env --file environment.yml + conda env create -v --name=heroku-env --file environment.yml fi # Clean up the installation environment . From 859d3e019782eb28aa7e8fe060dd3f94eb3f8cff Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 22:18:32 -0600 Subject: [PATCH 08/15] Remove -v since version of conda-env does not understand it --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index f6d8882..70a8414 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -21,7 +21,7 @@ if [ -f environment.yml ]; then puts-step "Creating conda environment" # TODO: Use update if its already there conda env remove --yes --quiet --name heroku-env - conda env create -v --name=heroku-env --file environment.yml + conda env create --name=heroku-env --file environment.yml fi # Clean up the installation environment . From f97452c0604a0d43ab6c065e9a3d38d7243a0464 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 22:52:37 -0600 Subject: [PATCH 09/15] Add more 3s where needed.... --- bin/steps/conda_compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 70a8414..01dec00 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -4,8 +4,8 @@ puts-step "Checking for existing conda install" if [ ! -d /app/.heroku/miniconda ]; then puts-step "Preparing Python/Miniconda Environment (${CONDA_VERSION})" curl -Os http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh - bash Miniconda-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent - rm -fr Miniconda-${CONDA_VERSION}-Linux-x86_64.sh + bash Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent + rm -fr Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh conda update conda --quiet --yes | indent fi From 90c880719fb41c4bd0ace3d588edfc3b758f7785 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 22:54:27 -0600 Subject: [PATCH 10/15] Get more secure --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 01dec00..01e7c37 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -3,7 +3,7 @@ CONDA_VERSION=4.3.31 puts-step "Checking for existing conda install" if [ ! -d /app/.heroku/miniconda ]; then puts-step "Preparing Python/Miniconda Environment (${CONDA_VERSION})" - curl -Os http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh + curl -Os https://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh bash Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent rm -fr Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh From d382140c54367049a1a7f1e6715ae5c14bbbfcc4 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 22:58:40 -0600 Subject: [PATCH 11/15] Continue gracefully if no old environment to delete --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 01e7c37..58f4b64 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -20,7 +20,7 @@ fi if [ -f environment.yml ]; then puts-step "Creating conda environment" # TODO: Use update if its already there - conda env remove --yes --quiet --name heroku-env + conda env remove --yes --quiet --name heroku-env || puts-step "No old environment to remove" conda env create --name=heroku-env --file environment.yml fi From 6f720439a9e4cf0a75968c812d3fc978a1117704 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 23:21:32 -0600 Subject: [PATCH 12/15] Try removing a couple things to save space --- bin/steps/conda_compile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 58f4b64..587ab27 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -22,6 +22,10 @@ if [ -f environment.yml ]; then # TODO: Use update if its already there conda env remove --yes --quiet --name heroku-env || puts-step "No old environment to remove" conda env create --name=heroku-env --file environment.yml + puts-step "Conda environment created" + conda activate heroku-env + conda install nomkl numpy + conda remove mkl mkl-service fi # Clean up the installation environment . From 6e7011fd2b5de31037fb0dd43536a0d41188b33d Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Tue, 9 Jan 2018 23:24:49 -0600 Subject: [PATCH 13/15] --yes, please --- bin/steps/conda_compile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 587ab27..db4cafa 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -23,9 +23,9 @@ if [ -f environment.yml ]; then conda env remove --yes --quiet --name heroku-env || puts-step "No old environment to remove" conda env create --name=heroku-env --file environment.yml puts-step "Conda environment created" - conda activate heroku-env - conda install nomkl numpy - conda remove mkl mkl-service + source activate heroku-env + conda install --yes nomkl numpy + conda remove --yes mkl mkl-service fi # Clean up the installation environment . From 57883d727a17a6bc6d11bb24c1dd5edcd5c3caf4 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Mon, 8 Oct 2018 13:15:21 -0500 Subject: [PATCH 14/15] Do not update numpy Updating numpy is also adding mkl...which we don't want because the built image gets too large --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index db4cafa..018630b 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -24,7 +24,7 @@ if [ -f environment.yml ]; then conda env create --name=heroku-env --file environment.yml puts-step "Conda environment created" source activate heroku-env - conda install --yes nomkl numpy + # conda install --yes nomkl numpy conda remove --yes mkl mkl-service fi From 1e8a35c99936a5ab2b61274ef0b19c68d3b165fb Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Mon, 8 Oct 2018 13:40:57 -0500 Subject: [PATCH 15/15] Update conda_compile --- bin/steps/conda_compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index 018630b..b66e2a3 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -25,7 +25,7 @@ if [ -f environment.yml ]; then puts-step "Conda environment created" source activate heroku-env # conda install --yes nomkl numpy - conda remove --yes mkl mkl-service + # conda remove --yes mkl mkl-service fi # Clean up the installation environment .