GCSFuse is a great utility to mount the GCS bucket into your local computer. I used it to access the data from my local computer or VMs in the cloud to access the data in the GCS bucket.
1. How to install gcsfuse
1.1 Mac
- Do not use brew to install gcsfuse. due to the depencies to the FUSE, homebrew is deprecating gcsfuse
- install go first
brew install go
- build from source:
GO111MODULE=auto go get -u github.com/googlecloudplatform/gcsfuse
More info: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/installing.md#building-from-source
1.2 Ubuntu
- get the key
export GCSFUSE_REPO=gcsfuse-`lsb_release -c -s`
echo "deb http://packages.cloud.google.com/apt $GCSFUSE_REPO main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
- update he packages and install
sudo apt-get update
sudo apt-get install gcsfuse
More Info: https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/installing.md#linux
2. How to mount
gcsfuse --implicit-dirs my-gcs-bucket ~/my-gcs-bucket
3. How to unmount
unmount ~/my-gcs-bucket