How to Download Your GCP Bucket Data (A Quick Guide to Have Your Data in the Palm of Your Hand)
In this short guide, we'll walk you through how to get your valuable data onto your Tromero instances, enabling you to build the next AI model of the future. Please note that this tutorial is intended for Tromero OS templates. If you are using your own image, the following commands may not work.
This guide consists of four easy steps:
- Installation of Google Cloud CLI
- Authentication via the Google Cloud CLI
- Downloading your data from your bucket
- Uploading data to your buckets
After these steps, you will be proficient in managing your data with GCP.
Step 1 - Installing Google Cloud CLI
-
Ensure that the package list is updated:
sudo apt-get update
-
Install the necessary packages:
sudo apt-get install apt-transport-https ca-certificates gnupg curl
-
Import the Google Cloud public key:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
-
Add the gcloud CLI distribution URI as a package source:
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
-
Update the package list and install the gcloud CLI:
sudo apt-get update && sudo apt-get install google-cloud-cli
Step 2 - Authentication via the Google Cloud CLI
-
Initialize gcloud:
gcloud init
This command will prompt you to log in, showing a link that you can copy and paste into your browser. The browser will ask you to log in with your Google account and will then provide an authentication token. Copy and paste this token into your terminal for authentication.
-
After logging in, the terminal will display a list of projects to choose from. You can also configure the default compute region and zone.
Step 3 - Downloading Your Data from Your Bucket
To download data from a specific bucket, use the following command to copy the contents of a file into your local file system:
gsutil cp gs://[BUCKET_NAME]/[OBJECT_NAME] [LOCAL_FILE_PATH]
Step 4 - Uploading Your Data to Your Chosen Bucket
- To upload a directory, use the following command:
gsutil cp -r [LOCAL_DIRECTORY]/* gs://[BUCKET_NAME]
- To upload a single file:
gsutil cp [LOCAL_FILE_PATH] gs://[BUCKET_NAME]/[OBJECT_NAME]
If you need further assistance, please contact support@tromero.ai and we would be happy to help!