From 432349bd75ddfa50415deccfe5eb17b78be443aa Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Thu, 1 Feb 2018 18:59:02 +0800 Subject: [PATCH 01/15] updated install script --- deploy/install_taxbrain_server.sh | 76 +++++++++++++++++-------------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 3083a9f5..8a6ea3d8 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -1,35 +1,43 @@ #!/bin/bash -install_env(){ - export has_env=1; - conda env remove --name aei_dropq &> /dev/null; - conda env create --file fab/dropq_environment.yml || return 0; - return 0; -} -install_conda_reqs(){ - echo ---------------------------------------Installing conda requirements; - channel="-c ospc/label/dev -c ospc " - for pkg in $(cat ../conda-requirements.txt);do - echo $pkg | grep -Eoi "(btax)|(ogusa)|(taxcalc)" &> /dev/null || echo install $channel $pkg && conda install $channel $pkg -y || return 1; - done - echo install $channel ogusa -y - conda install $channel ogusa -y -} -install_reqs(){ - install_conda_reqs || return 1; - echo Install webapp-public requirements.txt - pip install -r ../requirements.txt || return 1; - echo Install webapp-public requirements_dev.txt - pip install -r ../requirements_dev.txt || return 1; - echo Install requirements.txt of the deploy folder; - pip install -r requirements.txt || return 1; - pip uninstall -y taxbrain_server &> /dev/null; - pip install -e . || return 1; - rm -rf taxbrain_server/logs - mkdir taxbrain_server/logs || return 1; - return 0; -} -msg(){ - echo Local server installation complete! - return 0; -} -install_env && source activate aei_dropq && install_reqs && msg || echo FAILED + +set -e + +# Paths to the requirements files that are installed. +REQS_FILES=( + ../requirements.txt + ../requirements_dev.txt + requirements.txt +) + +# Path to the log directory. +LOGDIR=taxbrain_server/logs + +echo '*** Creating environment ***' +export HAS_ENV=1 +conda env remove --name aei_dropq +conda env create --file fab/dropq_environment.yml + +echo '*** Installing conda requirements ***' +CHANNEL='-c ospc/label/dev -c ospc ' +for pkg in $(cat ../conda-requirements.txt); do + if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then + echo "Installing ${pkg}..." + conda install $channel $pkg -y + fi +done + +echo '*** Installing package requirements ***' +install_conda_reqs +for reqs in "${REQS_FILES[@]}"; do + echo "pip install -r $reqs" + pip install -r $reqs +done +pip uninstall -y taxbrain_server +pip install -e . + +echo "*** Re-initializing logs directory: ${LOGDIR} ***" +rm -rf taxbrain_server/logs +mkdir taxbrain_server/logs + +echo "DONE" + From 2c541990ff11153401dcb941c815aebdfc4161c4 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 00:33:41 +0800 Subject: [PATCH 02/15] retinkered the ol' script --- deploy/install_taxbrain_server.sh | 74 ++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 8a6ea3d8..654b6c87 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -12,32 +12,56 @@ REQS_FILES=( # Path to the log directory. LOGDIR=taxbrain_server/logs -echo '*** Creating environment ***' -export HAS_ENV=1 -conda env remove --name aei_dropq -conda env create --file fab/dropq_environment.yml - -echo '*** Installing conda requirements ***' -CHANNEL='-c ospc/label/dev -c ospc ' -for pkg in $(cat ../conda-requirements.txt); do - if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then - echo "Installing ${pkg}..." - conda install $channel $pkg -y +# Name of the environment (in the dropq_environment.yml file). +AEI_ENV_NAME='aei_dropq' + +# Defines a finction that prompts the user for a particular action. +prompt_user() { + read -p "$1 [y/N] " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + return 0 + else + return 1 + fi +} + +if prompt_user "Create / reset environment?"; then + echo '*** Creating environment ***' + if [[ $(conda env list) =~ $AEI_ENV_NAME ]]; then + echo "Removing old environment: $AEI_ENV_NAME" + conda env remove --name $AEI_ENV_NAME fi -done - -echo '*** Installing package requirements ***' -install_conda_reqs -for reqs in "${REQS_FILES[@]}"; do - echo "pip install -r $reqs" - pip install -r $reqs -done -pip uninstall -y taxbrain_server -pip install -e . - -echo "*** Re-initializing logs directory: ${LOGDIR} ***" -rm -rf taxbrain_server/logs -mkdir taxbrain_server/logs + conda env create --file fab/dropq_environment.yml +fi + +if prompt_user "Install conda requirements?"; then + echo '*** Installing conda requirements ***' + CHANNEL='-c ospc/label/dev -c ospc ' + for pkg in $(cat ../conda-requirements.txt); do + if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then + echo "Installing ${pkg}..." + conda install $channel $pkg -y + fi + done +fi + +if prompt_user "Install package requirements?"; then + echo '*** Installing package requirements ***' + install_conda_reqs + for reqs in "${REQS_FILES[@]}"; do + echo "pip install -r $reqs" + pip install -r $reqs + done + pip uninstall -y taxbrain_server + pip install -e . +fi + +if prompt_user "Re-initialize logs directory?"; then + echo "*** Re-initializing logs directory: ${LOGDIR} ***" + rm -rf taxbrain_server/logs + mkdir taxbrain_server/logs +fi echo "DONE" From a5d3e006b881686608502f2d66d96835ca52c36d Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 00:51:04 +0800 Subject: [PATCH 03/15] further re-twiddling --- deploy/install_taxbrain_server.sh | 36 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 654b6c87..8e71e904 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -12,9 +12,12 @@ REQS_FILES=( # Path to the log directory. LOGDIR=taxbrain_server/logs -# Name of the environment (in the dropq_environment.yml file). +# Name of the environment (in the DROPQ_YML_PATH file). AEI_ENV_NAME='aei_dropq' +# The path to the dropq_environment.yml definition. +DROPQ_YML_PATH=fab/dropq_environment.yml + # Defines a finction that prompts the user for a particular action. prompt_user() { read -p "$1 [y/N] " -n 1 -r @@ -27,32 +30,39 @@ prompt_user() { } if prompt_user "Create / reset environment?"; then - echo '*** Creating environment ***' if [[ $(conda env list) =~ $AEI_ENV_NAME ]]; then - echo "Removing old environment: $AEI_ENV_NAME" - conda env remove --name $AEI_ENV_NAME + if prompt_user "Remove existing environment?"; then + conda env remove --name $AEI_ENV_NAME + conda env create --file $DROPQ_YML_PATH + else + conda env update --file $DROPQ_YML_PATH + fi + else + conda env create --file $DROPQ_YML_PATH fi - conda env create --file fab/dropq_environment.yml fi +source activate $AEI_ENV_NAME + if prompt_user "Install conda requirements?"; then - echo '*** Installing conda requirements ***' - CHANNEL='-c ospc/label/dev -c ospc ' + CHANNEL='-c ospc/label/dev -c ospc' + PACKAGES=() for pkg in $(cat ../conda-requirements.txt); do if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then - echo "Installing ${pkg}..." - conda install $channel $pkg -y + PACKAGES+=($pkg) fi done + echo "conda install $CHANNEL ${PACKAGES[@]}" + conda install -y $CHANNEL ${PACKAGES[@]} fi if prompt_user "Install package requirements?"; then - echo '*** Installing package requirements ***' - install_conda_reqs + REQUIREMENTS=() for reqs in "${REQS_FILES[@]}"; do - echo "pip install -r $reqs" - pip install -r $reqs + REQUIREMENTS+=("-r $reqs") done + echo "pip install ${REQUIREMENTS[@]}" + pip install ${REQUIREMENTS[@]} pip uninstall -y taxbrain_server pip install -e . fi From e41108f49926b92e49160426bac36ead8804a9e0 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 00:58:49 +0800 Subject: [PATCH 04/15] final twiddling --- deploy/install_taxbrain_server.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 8e71e904..80b0f726 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Interactive installation script. +# For a fresh install, simply run: +# yes | ./install_taxbrain_server.sh +# Optionally, pipe all output to /dev/null: +# yes | ./install_taxbrain_server.sh > /dev/null set -e @@ -29,6 +34,7 @@ prompt_user() { fi } +# Creates a new environment, or resets the current environment. if prompt_user "Create / reset environment?"; then if [[ $(conda env list) =~ $AEI_ENV_NAME ]]; then if prompt_user "Remove existing environment?"; then @@ -42,8 +48,10 @@ if prompt_user "Create / reset environment?"; then fi fi +# Everything from here down is done in the environment. source activate $AEI_ENV_NAME +# Installs conda requirements. if prompt_user "Install conda requirements?"; then CHANNEL='-c ospc/label/dev -c ospc' PACKAGES=() @@ -56,6 +64,7 @@ if prompt_user "Install conda requirements?"; then conda install -y $CHANNEL ${PACKAGES[@]} fi +# Installs package requirements (including the current package). if prompt_user "Install package requirements?"; then REQUIREMENTS=() for reqs in "${REQS_FILES[@]}"; do @@ -63,14 +72,13 @@ if prompt_user "Install package requirements?"; then done echo "pip install ${REQUIREMENTS[@]}" pip install ${REQUIREMENTS[@]} - pip uninstall -y taxbrain_server + # Installs project in development mode. pip install -e . fi +# Reinitializes the log directory. if prompt_user "Re-initialize logs directory?"; then - echo "*** Re-initializing logs directory: ${LOGDIR} ***" - rm -rf taxbrain_server/logs - mkdir taxbrain_server/logs + rm -rf taxbrain_server/logs/* fi echo "DONE" From c15b25f6c6662393f2f338990bdce905bebab8c0 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 01:15:01 +0800 Subject: [PATCH 05/15] jk i lied --- deploy/install_taxbrain_server.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 80b0f726..67721d9a 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -4,6 +4,9 @@ # yes | ./install_taxbrain_server.sh # Optionally, pipe all output to /dev/null: # yes | ./install_taxbrain_server.sh > /dev/null +# For slow connections, it is helpful to increase the timeout for package downloads. +# To do so, add the following to your ~/.condarc file: +# remote_read_timeout_secs: 1000.0 set -e @@ -60,6 +63,8 @@ if prompt_user "Install conda requirements?"; then PACKAGES+=($pkg) fi done + # Places the "ogusa" package last, to install taxcalc, etc. at the end. + PACKAGES+=('ogusa') echo "conda install $CHANNEL ${PACKAGES[@]}" conda install -y $CHANNEL ${PACKAGES[@]} fi @@ -81,5 +86,6 @@ if prompt_user "Re-initialize logs directory?"; then rm -rf taxbrain_server/logs/* fi -echo "DONE" +echo "Finished creating environment; to start, run:" +echo " source activate aei_dropq && source webapp_env.sh" From 50bcbe35bba4749ef2becb6382bd894da5a60e1c Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 01:21:57 +0800 Subject: [PATCH 06/15] added prefix to webapp_env to automatically start the environment --- webapp_env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp_env.sh b/webapp_env.sh index edbddda5..47b98377 100644 --- a/webapp_env.sh +++ b/webapp_env.sh @@ -1,3 +1,5 @@ +source activate aei_dropq + export NUM_BUDGET_YEARS=10 export DEV_DEBUG=True export HTML_MINIFY=True From 49c74359fb010c9ebc3d3c163b0223ddfe385da2 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 01:40:24 +0800 Subject: [PATCH 07/15] minor additional change --- deploy/install_taxbrain_server.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 67721d9a..95b8e9e6 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -10,21 +10,24 @@ set -e +# Gets the path to the current script's directory. +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + # Paths to the requirements files that are installed. REQS_FILES=( - ../requirements.txt - ../requirements_dev.txt - requirements.txt + ${SCRIPT_DIR}/../requirements.txt + ${SCRIPT_DIR}/../requirements_dev.txt + ${SCRIPT_DIR}/requirements.txt ) # Path to the log directory. -LOGDIR=taxbrain_server/logs +LOGDIR=${SCRIPT_DIR}/taxbrain_server/logs # Name of the environment (in the DROPQ_YML_PATH file). AEI_ENV_NAME='aei_dropq' # The path to the dropq_environment.yml definition. -DROPQ_YML_PATH=fab/dropq_environment.yml +DROPQ_YML_PATH=${SCRIPT_DIR}/fab/dropq_environment.yml # Defines a finction that prompts the user for a particular action. prompt_user() { @@ -58,13 +61,13 @@ source activate $AEI_ENV_NAME if prompt_user "Install conda requirements?"; then CHANNEL='-c ospc/label/dev -c ospc' PACKAGES=() - for pkg in $(cat ../conda-requirements.txt); do + for pkg in $(cat ${SCRIPT_DIR}/../conda-requirements.txt); do if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then PACKAGES+=($pkg) fi done - # Places the "ogusa" package last, to install taxcalc, etc. at the end. - PACKAGES+=('ogusa') + # Places these packages last, to install taxcalc, etc. at the end. + PACKAGES+=('btax' 'ogusa') echo "conda install $CHANNEL ${PACKAGES[@]}" conda install -y $CHANNEL ${PACKAGES[@]} fi @@ -83,9 +86,9 @@ fi # Reinitializes the log directory. if prompt_user "Re-initialize logs directory?"; then - rm -rf taxbrain_server/logs/* + rm -rf ${SCRIPT_DIR}/taxbrain_server/logs/* fi echo "Finished creating environment; to start, run:" -echo " source activate aei_dropq && source webapp_env.sh" +echo " source webapp_env.sh" From e0298bd3f6e80d45924038bc51e8f64dd246cf9d Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 02:36:07 +0800 Subject: [PATCH 08/15] fixed travis cl --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b8952371..1ca8ddaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ install: - export PATH="$HOME/miniconda/bin:$PATH" - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - pushd deploy - - ./install_taxbrain_server.sh + - yes | ./install_taxbrain_server.sh - popd - source activate aei_dropq From 571e5240c4174f15a1e123e23caff4b66e139e6f Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 02:45:00 +0800 Subject: [PATCH 09/15] added taxcalc install explicitly --- deploy/install_taxbrain_server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 95b8e9e6..b593043c 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -67,7 +67,7 @@ if prompt_user "Install conda requirements?"; then fi done # Places these packages last, to install taxcalc, etc. at the end. - PACKAGES+=('btax' 'ogusa') + PACKAGES+=('btax' 'ogusa' 'taxcalc') echo "conda install $CHANNEL ${PACKAGES[@]}" conda install -y $CHANNEL ${PACKAGES[@]} fi From 43049e6e90c496843b2bcfa397d3e07a5aba8bc9 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 02:59:24 +0800 Subject: [PATCH 10/15] removed a hairy bit that i don't think should be there --- .travis.yml | 1 - deploy/install_taxbrain_server.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ca8ddaa..3e3ad541 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ install: - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - pushd deploy - yes | ./install_taxbrain_server.sh - popd diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index b593043c..95b8e9e6 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -67,7 +67,7 @@ if prompt_user "Install conda requirements?"; then fi done # Places these packages last, to install taxcalc, etc. at the end. - PACKAGES+=('btax' 'ogusa' 'taxcalc') + PACKAGES+=('btax' 'ogusa') echo "conda install $CHANNEL ${PACKAGES[@]}" conda install -y $CHANNEL ${PACKAGES[@]} fi From d795b9f9c2ca610294ab99a9ff60d53a38de7ebf Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 03:08:23 +0800 Subject: [PATCH 11/15] blarg what is travis ci even --- .travis.yml | 1 + deploy/install_taxbrain_server.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3e3ad541..1ca8ddaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ install: - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" + - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - pushd deploy - yes | ./install_taxbrain_server.sh - popd diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 95b8e9e6..f269f8f2 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -31,7 +31,8 @@ DROPQ_YML_PATH=${SCRIPT_DIR}/fab/dropq_environment.yml # Defines a finction that prompts the user for a particular action. prompt_user() { - read -p "$1 [y/N] " -n 1 -r + printf "$1 [y/N] " + read -p "" -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then return 0 From a4e28286fa3a911bd8d503af6399c05a8104fd54 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 03:21:10 +0800 Subject: [PATCH 12/15] asdf --- deploy/install_taxbrain_server.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index f269f8f2..0e449594 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -61,16 +61,7 @@ source activate $AEI_ENV_NAME # Installs conda requirements. if prompt_user "Install conda requirements?"; then CHANNEL='-c ospc/label/dev -c ospc' - PACKAGES=() - for pkg in $(cat ${SCRIPT_DIR}/../conda-requirements.txt); do - if [[ ! $pkg =~ btax|ogusa|taxcalc ]]; then - PACKAGES+=($pkg) - fi - done - # Places these packages last, to install taxcalc, etc. at the end. - PACKAGES+=('btax' 'ogusa') - echo "conda install $CHANNEL ${PACKAGES[@]}" - conda install -y $CHANNEL ${PACKAGES[@]} + conda install -y $CHANNEL -r ${SCRIPT_DIR}/../conda-requirements.txt fi # Installs package requirements (including the current package). From 8449b464f1f9272a230c19a79fc535175bc0e10f Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 03:27:06 +0800 Subject: [PATCH 13/15] fdsa --- deploy/install_taxbrain_server.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 0e449594..1c6d79a2 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -56,13 +56,11 @@ if prompt_user "Create / reset environment?"; then fi # Everything from here down is done in the environment. +echo "source activate $AEI_ENV_NAME" source activate $AEI_ENV_NAME -# Installs conda requirements. -if prompt_user "Install conda requirements?"; then - CHANNEL='-c ospc/label/dev -c ospc' - conda install -y $CHANNEL -r ${SCRIPT_DIR}/../conda-requirements.txt -fi +CHANNEL='-c ospc/label/dev -c ospc' +conda install -y $CHANNEL -r ${SCRIPT_DIR}/../conda-requirements.txt # Installs package requirements (including the current package). if prompt_user "Install package requirements?"; then From e93af42a63353989db97ae2e1f481764765fe864 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 03:32:47 +0800 Subject: [PATCH 14/15] eh maybe this will work --- deploy/install_taxbrain_server.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 1c6d79a2..3f6c529e 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -59,8 +59,11 @@ fi echo "source activate $AEI_ENV_NAME" source activate $AEI_ENV_NAME -CHANNEL='-c ospc/label/dev -c ospc' -conda install -y $CHANNEL -r ${SCRIPT_DIR}/../conda-requirements.txt +conda install \ + --yes \ + -c ospc/label/dev \ + -c ospc \ + --file ${SCRIPT_DIR}/../conda-requirements.txt # Installs package requirements (including the current package). if prompt_user "Install package requirements?"; then From 83c459db883536bae70cc78ca92ebdcff554ac2d Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Fri, 2 Feb 2018 03:46:50 +0800 Subject: [PATCH 15/15] mhm --- .travis.yml | 2 +- deploy/install_taxbrain_server.sh | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ca8ddaa..a30c6aa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ install: - export PATH="$HOME/miniconda/bin:$PATH" - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - pushd deploy - - yes | ./install_taxbrain_server.sh + - ./install_taxbrain_server.sh --all - popd - source activate aei_dropq diff --git a/deploy/install_taxbrain_server.sh b/deploy/install_taxbrain_server.sh index 3f6c529e..cf088d71 100755 --- a/deploy/install_taxbrain_server.sh +++ b/deploy/install_taxbrain_server.sh @@ -1,9 +1,9 @@ #!/bin/bash # Interactive installation script. # For a fresh install, simply run: -# yes | ./install_taxbrain_server.sh +# ./install_taxbrain_server.sh --all # Optionally, pipe all output to /dev/null: -# yes | ./install_taxbrain_server.sh > /dev/null +# ./install_taxbrain_server.sh --all > /dev/null # For slow connections, it is helpful to increase the timeout for package downloads. # To do so, add the following to your ~/.condarc file: # remote_read_timeout_secs: 1000.0 @@ -29,8 +29,18 @@ AEI_ENV_NAME='aei_dropq' # The path to the dropq_environment.yml definition. DROPQ_YML_PATH=${SCRIPT_DIR}/fab/dropq_environment.yml +# Setting to run everything automatically. +RUN_ALL=0 +if [[ $# -eq 1 && $1 == "--all" ]]; then + RUN_ALL=1 +fi + # Defines a finction that prompts the user for a particular action. prompt_user() { + if [[ $RUN_ALL -eq 1 ]]; then + echo "$1 :: YES" + return 0 + fi printf "$1 [y/N] " read -p "" -n 1 -r echo @@ -59,11 +69,13 @@ fi echo "source activate $AEI_ENV_NAME" source activate $AEI_ENV_NAME -conda install \ - --yes \ - -c ospc/label/dev \ - -c ospc \ - --file ${SCRIPT_DIR}/../conda-requirements.txt +if prompt_user "Install conda requirements?"; then + conda install \ + --yes \ + -c ospc/label/dev \ + -c ospc \ + --file ${SCRIPT_DIR}/../conda-requirements.txt +fi # Installs package requirements (including the current package). if prompt_user "Install package requirements?"; then