Skip to content

Instantly share code, notes, and snippets.

@drewyangdev
Last active May 30, 2024 17:43
Show Gist options
  • Save drewyangdev/389e8c4ffb334fa0183e73653db0be42 to your computer and use it in GitHub Desktop.
Save drewyangdev/389e8c4ffb334fa0183e73653db0be42 to your computer and use it in GitHub Desktop.
#!/bin/bash
export AWS_REGION=$1
export BUCKET_NAME=$2
export ORG_NAME=$3
export WORKFLOW_NAME=$4
export WORKER_CONTAINER_UID=$5
export WORKER_CONTAINER_GID=$6
echo "INFO :: Mount S3"
sed -i '/user_allow_other/s/^#//g' /etc/fuse.conf
[ ! -d "/mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/inbox" ] && sudo mkdir -p /mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/inbox
s3fs ${BUCKET_NAME}:/${ORG_NAME}_${WORKFLOW_NAME}/inbox /mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/inbox \
-o allow_other,uid=${WORKER_CONTAINER_UID},gid=${WORKER_CONTAINER_GID},createbucket,multipart_size=530,endpoint=${AWS_REGION},default_acl=private,url=http://s3-accelerate.amazonaws.com
[ ! -d "/mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/outbox" ] && sudo mkdir -p /mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/outbox
s3fs ${BUCKET_NAME}:/${ORG_NAME}_${WORKFLOW_NAME}/outbox /mnt/s3/works/org/${ORG_NAME}/proj/${WORKFLOW_NAME}/outbox \
-o allow_other,uid=${WORKER_CONTAINER_UID},gid=${WORKER_CONTAINER_GID},createbucket,multipart_size=530,endpoint=${AWS_REGION},default_acl=private,url=http://s3-accelerate.amazonaws.com
sleep 1
df -Th
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment