GCP Setup
Installing the Google Cloud SDK
The Google Cloud SDK is a set of tools for interacting with the Google Cloud Platform (GCP). These tools include:
- gcloud: The primary command-line interface
- gsutil: Tool for managing Google Cloud Storage
- bq: Tool for working with BigQuery
Prerequisites
- Python Environment: We'll assume you've already got a Python environment ready to go. If not, review the getting started section on how to create a python environment.
GCLOUD SDK Installation Instructions
1. Download the SDK
- Visit the Google Cloud SDK download page: https://cloud.google.com/sdk/docs/install
2. Installation
- MacOS
- Windows
- Debian/Ubuntu
macOS
- Open a terminal window.
- Extract the downloaded archive:
tar -xvzf [ARCHIVE_FILE_NAME]
(Replace [ARCHIVE_FILE_NAME] with the actual name of the downloaded file)
3. Run the install script:
./[ARCHIVE_DIRECTORY]/install.sh
(Replace [ARCHIVE_DIRECTORY] with the name of the extracted directory)
4. Follow the prompts, selecting default options if unsure.
5. Restart your terminal window.
Windows
- Run the downloaded executable installer.
- Follow the installation wizard, selecting default options if unsure.
- Restart your command prompt.
- Debian/Ubuntu
- Import the Cloud SDK public key:
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 - Install the packages:
sudo apt-get update && sudo apt-get install google-cloud-sdk
- Red Hat (RHEL)/ CentOS
- Import the Cloud SDK public key:
sudo rpm --import https://packages.cloud.google.com/yum/doc/yum-key.gpg - Add the SDK repo:
sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM - Install the packages:
sudo yum install google-cloud-sdk
- Import the Cloud SDK public key:
3. Initialize the gcloud CLI Once installed, initialize the SDK:
gcloud init
Follow the prompts to log in to your Google account and configure default settings.
Let me know if you'd like assistance with any specific part of the process!
Authentication: Keyring Setup 🔐
Google's recommended approach for authenticating to Artifact Registry PyPi repositories is using the Python keyring library. Here's how to set it up:
-
Install the Packages: Using UV
uv pip install keyring keyrings.google-artifactregistry-authOtherwise
pip install keyring keyrings.google-artifactregistry-auth -
Verify Installation
keyring --list-backendsYou should see "ChainerBackend" and "GooglePythonAuth" in the output.
-
Get Configuration
gcloud artifacts print-settings python --project=mcp-idp-app-registry-p-13hf \
--repository=mcp-art-internal-idp-python \
--location=us-central1 -
Keyring Authentication with User Credentials
Once keyring is set up, setup gcloud application-default login, and log in using the Google Cloud CLI:
gcloud auth application-default login
gcloud auth login
Now you're all set to install MCP Package! 🎉