From 614adb4360d8621df45f39414b7b31b9eefc8308 Mon Sep 17 00:00:00 2001 From: jalencato Date: Thu, 26 Sep 2024 10:24:13 -0700 Subject: [PATCH 1/5] Update push_gsprocessing_image.sh --- graphstorm-processing/docker/push_gsprocessing_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphstorm-processing/docker/push_gsprocessing_image.sh b/graphstorm-processing/docker/push_gsprocessing_image.sh index be1b29912e..ffadf6a9ce 100644 --- a/graphstorm-processing/docker/push_gsprocessing_image.sh +++ b/graphstorm-processing/docker/push_gsprocessing_image.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -Eeuo pipefail +set -euxo pipefail trap cleanup SIGINT SIGTERM ERR EXIT script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) From afe5cfcaf810992240ae41fdb2aec829dc25862e Mon Sep 17 00:00:00 2001 From: jalencato Date: Thu, 26 Sep 2024 10:38:59 -0700 Subject: [PATCH 2/5] Update push_gsprocessing_image.sh --- .../docker/push_gsprocessing_image.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/graphstorm-processing/docker/push_gsprocessing_image.sh b/graphstorm-processing/docker/push_gsprocessing_image.sh index ffadf6a9ce..625212819c 100644 --- a/graphstorm-processing/docker/push_gsprocessing_image.sh +++ b/graphstorm-processing/docker/push_gsprocessing_image.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euxo pipefail +set -Eeuo pipefail trap cleanup SIGINT SIGTERM ERR EXIT script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) @@ -42,8 +42,6 @@ parse_params() { IMAGE='graphstorm-processing' VERSION=`poetry version --short` LATEST_VERSION=${VERSION} - REGION=$(aws configure get region) - REGION=${REGION:-us-west-2} ACCOUNT=$(aws sts get-caller-identity --query Account --output text) ARCH='x86_64' SUFFIX="" @@ -106,6 +104,19 @@ else die "--environment parameter needs to be one of 'emr', 'emr-serverless' or 'sagemaker', got ${EXEC_ENV}" fi +# Determine the AWS region +if [[ -n "${REGION-}" ]]; then + # REGION was set via script argument + : +else + # Attempt to get REGION from AWS CLI, default to 'us-west-2' + REGION=$(aws configure get region) || REGION="" + REGION=${REGION:-us-west-2} + if [[ -z "$(aws configure get region)" ]]; then + msg "No default AWS region configured. Falling back to 'us-west-2'." + fi +fi + TAG="${VERSION}-${ARCH}${SUFFIX}" LATEST_TAG="latest-${ARCH}${SUFFIX}" IMAGE_WITH_ENV="${IMAGE}-${EXEC_ENV}" From 8341d2725d3d505615a9f5150ee4a6f26025587e Mon Sep 17 00:00:00 2001 From: jalencato Date: Thu, 26 Sep 2024 10:40:35 -0700 Subject: [PATCH 3/5] Update push_gsprocessing_image.sh --- graphstorm-processing/docker/push_gsprocessing_image.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/graphstorm-processing/docker/push_gsprocessing_image.sh b/graphstorm-processing/docker/push_gsprocessing_image.sh index 625212819c..8f03bcffac 100644 --- a/graphstorm-processing/docker/push_gsprocessing_image.sh +++ b/graphstorm-processing/docker/push_gsprocessing_image.sh @@ -104,7 +104,6 @@ else die "--environment parameter needs to be one of 'emr', 'emr-serverless' or 'sagemaker', got ${EXEC_ENV}" fi -# Determine the AWS region if [[ -n "${REGION-}" ]]; then # REGION was set via script argument : From ab09af9a1990808c69b4fcacd74a72e2bf6f43f0 Mon Sep 17 00:00:00 2001 From: jalencato Date: Thu, 26 Sep 2024 10:45:53 -0700 Subject: [PATCH 4/5] Update push_gsprocessing_image.sh --- .../docker/push_gsprocessing_image.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/graphstorm-processing/docker/push_gsprocessing_image.sh b/graphstorm-processing/docker/push_gsprocessing_image.sh index 8f03bcffac..43c58bd7c8 100644 --- a/graphstorm-processing/docker/push_gsprocessing_image.sh +++ b/graphstorm-processing/docker/push_gsprocessing_image.sh @@ -42,6 +42,8 @@ parse_params() { IMAGE='graphstorm-processing' VERSION=`poetry version --short` LATEST_VERSION=${VERSION} + REGION=$(aws configure get region)||REGION="" + REGION=${REGION:-us-west-2} ACCOUNT=$(aws sts get-caller-identity --query Account --output text) ARCH='x86_64' SUFFIX="" @@ -104,18 +106,6 @@ else die "--environment parameter needs to be one of 'emr', 'emr-serverless' or 'sagemaker', got ${EXEC_ENV}" fi -if [[ -n "${REGION-}" ]]; then - # REGION was set via script argument - : -else - # Attempt to get REGION from AWS CLI, default to 'us-west-2' - REGION=$(aws configure get region) || REGION="" - REGION=${REGION:-us-west-2} - if [[ -z "$(aws configure get region)" ]]; then - msg "No default AWS region configured. Falling back to 'us-west-2'." - fi -fi - TAG="${VERSION}-${ARCH}${SUFFIX}" LATEST_TAG="latest-${ARCH}${SUFFIX}" IMAGE_WITH_ENV="${IMAGE}-${EXEC_ENV}" From 95db9e748714b4d2762af7fe20e39b17db5af88e Mon Sep 17 00:00:00 2001 From: jalencato Date: Thu, 26 Sep 2024 11:18:48 -0700 Subject: [PATCH 5/5] Update graphstorm-processing/docker/push_gsprocessing_image.sh Co-authored-by: Theodore Vasiloudis --- graphstorm-processing/docker/push_gsprocessing_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphstorm-processing/docker/push_gsprocessing_image.sh b/graphstorm-processing/docker/push_gsprocessing_image.sh index 43c58bd7c8..c54fa0e703 100644 --- a/graphstorm-processing/docker/push_gsprocessing_image.sh +++ b/graphstorm-processing/docker/push_gsprocessing_image.sh @@ -42,7 +42,7 @@ parse_params() { IMAGE='graphstorm-processing' VERSION=`poetry version --short` LATEST_VERSION=${VERSION} - REGION=$(aws configure get region)||REGION="" + REGION=$(aws configure get region) || REGION="" REGION=${REGION:-us-west-2} ACCOUNT=$(aws sts get-caller-identity --query Account --output text) ARCH='x86_64'