Skip to content

Commit

Permalink
bypass S3FS if downloading (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErinWeisbart authored Dec 4, 2024
1 parent 49c1af8 commit e870124
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions worker/run-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ VOL_1_ID=$(aws ec2 describe-instance-attribute --instance-id $MY_INSTANCE_ID --a
aws ec2 create-tags --resources $VOL_1_ID --tags Key=Name,Value=${APP_NAME}Worker

# 2. MOUNT S3
echo "Mounting S3 using S3FS"
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then
echo "Using role credentials to mount S3"
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o iam_role
else
echo "Using user credentials to mount S3"
echo $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY > /credentials.txt
chmod 600 /credentials.txt
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o passwd_file=/credentials.txt
if [[ ${DOWNLOAD_FILES} == 'False' ]]; then
echo "Mounting S3 using S3FS"
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then
echo "Using role credentials to mount S3"
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o iam_role
else
echo "Using user credentials to mount S3"
echo $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY > /credentials.txt
chmod 600 /credentials.txt
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o passwd_file=/credentials.txt
fi
fi

# 3. SET UP ALARMS
Expand Down

0 comments on commit e870124

Please sign in to comment.