From e0e6670ab6ea29557e095112b2930045308d0b9f Mon Sep 17 00:00:00 2001 From: Umesh Timalsina Date: Fri, 10 Apr 2020 18:00:28 -0500 Subject: [PATCH] Move jq overwrites from entrypoint to deployment script. Closes #1627 --- .deployment/deploy-deepforge | 8 +++++++- .deployment/dev-entrypoint.sh | 8 -------- .deployment/docker-compose-overrides.yml | 2 ++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.deployment/deploy-deepforge b/.deployment/deploy-deepforge index 9ade67647..568f3568d 100755 --- a/.deployment/deploy-deepforge +++ b/.deployment/deploy-deepforge @@ -3,13 +3,19 @@ DEEPFORGE_DEPLOYMENT_DIR="$(realpath "$(dirname "$0")")" export DEEPFORGE_DEPLOYMENT_DIR . ~/.nvm/nvm.sh - SERVER_NAME="server" if [[ $1 = "stable" ]]; then SERVER_NAME="server_stable" fi; +# This will overwrite config/components.json on the local source tree (please use with discretion) +< config/components.json jq '.Compute.backends=(.Compute.backends | map(select(. != "local")))' \ +> config/components2.json +< config/components2.json jq '.Storage.backends=(.Storage.backends | map(select(. != "gme")))' \ +> config/components.json +rm config/components2.json + # Merging the custom override yml file yaml-merge docker/docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml > custom-docker-compose.yml diff --git a/.deployment/dev-entrypoint.sh b/.deployment/dev-entrypoint.sh index bcf0141f8..c4ba2bc4a 100755 --- a/.deployment/dev-entrypoint.sh +++ b/.deployment/dev-entrypoint.sh @@ -9,14 +9,6 @@ source activate deepforge-server pip uninstall tensorflow -y conda install tensorflow==1.14 -y -# Install jq and remove local from config/components.json file -wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O jq && chmod +x jq - -< config/components.json ./jq '.Compute.backends=(.Compute.backends | map(select(. != "local")))' \ -> config/components2.json -< config/components2.json ./jq '.Storage.backends=(.Storage.backends | map(select(. != "gme")))' \ -> config/components.json -rm config/components2.json deepforge start --server diff --git a/.deployment/docker-compose-overrides.yml b/.deployment/docker-compose-overrides.yml index dce619774..0adc27ae7 100644 --- a/.deployment/docker-compose-overrides.yml +++ b/.deployment/docker-compose-overrides.yml @@ -5,6 +5,7 @@ services: - "$HOME/.deepforge/blob:/data/blob" - "${TOKEN_KEYS_DIR}:/token_keys" - "${DEEPFORGE_DEPLOYMENT_DIR}:/.deployment" + - "${DEEPFORGE_DEPLOYMENT_DIR}/../config:/deepforge/config" server_stable: entrypoint: /.deployment/dev-entrypoint.sh @@ -20,5 +21,6 @@ services: - "$HOME/.deepforge/blob:/data/blob" - "${TOKEN_KEYS_DIR}:/token_keys" - "${DEEPFORGE_DEPLOYMENT_DIR}:/.deployment" + - "${DEEPFORGE_DEPLOYMENT_DIR}/../config:/deepforge/config" depends_on: - mongo