Skip to content

Commit

Permalink
Merge pull request #494 from GoogleCloudPlatform/script_gcs
Browse files Browse the repository at this point in the history
Add GCS bucket creation
  • Loading branch information
takumiohym authored Jul 8, 2024
2 parents f4aa2ad + 0562581 commit 7ee94e5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions scripts/setup_on_jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@ gcloud services enable \

# Setup Artifact Registry
export PROJECT_ID=$(gcloud config get-value project)
export REGION=us
export BUCKET=$PROJECT_ID
export MULTIREGION=us
export REGION=us-central1
export ARTIFACT_REG_REPO=asl-artifact-repo

if ! gcloud artifacts repositories describe $ARTIFACT_REG_REPO \
--location=$REGION > /dev/null 2>&1; then
--location=$MULTIREGION > /dev/null 2>&1; then
gcloud artifacts repositories create $ARTIFACT_REG_REPO \
--project=$PROJECT_ID --location=$REGION --repository-format=docker
--project=$PROJECT_ID --location=$MULTIREGION --repository-format=docker
fi

# Create a GCS bucket
exists=$(gsutil ls -d | grep -w gs://${BUCKET}/)
if [ -n "$exists" ]; then
echo -e "Bucket exists, let's not recreate it."
else
echo "Creating a new GCS bucket."
gsutil mb -l ${REGION} gs://${BUCKET}
echo "Here are your current buckets:"
gsutil ls
fi

0 comments on commit 7ee94e5

Please sign in to comment.