Skip to content

Commit e870124

Browse files
authored
bypass S3FS if downloading (#187)
1 parent 49c1af8 commit e870124

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

worker/run-worker.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ VOL_1_ID=$(aws ec2 describe-instance-attribute --instance-id $MY_INSTANCE_ID --a
2323
aws ec2 create-tags --resources $VOL_1_ID --tags Key=Name,Value=${APP_NAME}Worker
2424

2525
# 2. MOUNT S3
26-
echo "Mounting S3 using S3FS"
27-
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then
28-
echo "Using role credentials to mount S3"
29-
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o iam_role
30-
else
31-
echo "Using user credentials to mount S3"
32-
echo $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY > /credentials.txt
33-
chmod 600 /credentials.txt
34-
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o passwd_file=/credentials.txt
26+
if [[ ${DOWNLOAD_FILES} == 'False' ]]; then
27+
echo "Mounting S3 using S3FS"
28+
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then
29+
echo "Using role credentials to mount S3"
30+
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o iam_role
31+
else
32+
echo "Using user credentials to mount S3"
33+
echo $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY > /credentials.txt
34+
chmod 600 /credentials.txt
35+
s3fs $SOURCE_BUCKET /home/ubuntu/bucket -o passwd_file=/credentials.txt
36+
fi
3537
fi
3638

3739
# 3. SET UP ALARMS

0 commit comments

Comments
 (0)