From b667c70fdce7cf04d8fb1331372b1a06944ca090 Mon Sep 17 00:00:00 2001 From: Alex Thewsey Date: Wed, 26 Jul 2023 08:04:42 +0000 Subject: [PATCH] fix(deps): download-dependencies.sh in SMStudio chmod download-dependencies.sh to (hopefully) allow executing the script by default after git clone. Add a branch to extract the SDK file via Python in case the `unzip` CLI utility is not installed - which is the case in SageMaker Studio. --- download-dependencies.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 download-dependencies.sh diff --git a/download-dependencies.sh b/download-dependencies.sh old mode 100644 new mode 100755 index fb3c313f..b4fb6425 --- a/download-dependencies.sh +++ b/download-dependencies.sh @@ -6,5 +6,11 @@ cd ./dependencies && \ echo "Downloading dependencies" curl -sS https://preview.documentation.bedrock.aws.dev/Documentation/SDK/bedrock-python-sdk.zip > sdk.zip && \ echo "Unpacking dependencies" -unzip sdk.zip && \ -rm sdk.zip \ No newline at end of file +# (SageMaker Studio system terminals don't have `unzip` utility installed) +if command -v unzip &> /dev/null +then + unzip sdk.zip && rm sdk.zip +else + echo "'unzip' command not found: Trying to unzip via Python" + python -m zipfile -e sdk.zip . && rm sdk.zip +fi