Skip to content

tohweizhong/dev-quick-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

dev-quick-start

A cheatsheet of commands that I always forget

Creating Python virtual environment

  • python3 -m venv .venv
  • source .venv/bin/activate
  • pip3 install google-adk==1.8.0 # packages

GCP authentication

  • Authorize: gcloud auth login
  • ADC login: gcloud auth application-default login
  • Set project: gcloud config set project weizhong-project03
  • (Set quota project: gcloud auth application-default set-quota-project weizhong-project03)
  • (See current project: gcloud config list)

GCP add IAM policy binding

  • gcloud projects add-iam-policy-binding <PROJECT_ID> --member="<SERVICE ACCOUNT>" --role="roles/<ROLE>" --project=<PROJECT_ID>

Set environment variables

  • source ./set_vars.sh
  • Example set_vars.sh
export GOOGLE_CLOUD_LOCATION="us-central1" # Example location

Add environment variables into bash profile

  • echo 'export GOOGLE_CLOUD_PROJECT="<PROJECT_ID>"' >> ~/.bash_profile
  • echo 'export GOOGLE_CLOUD_LOCATION="REGION_ID"' >> ~/.bash_profile
  • echo 'export GOOGLE_GENAI_USE_VERTEXAI=true' >> ~/.bash_profile
  • source ~/.bash_profile

ADK

  • Create a new agent: adk create <agent_name>

List of git commands that I always forget

Python

  • Use dir to see all properties and methods of the specified object, without the values. This function will return all the properties and methods, even built-in properties which are default for all object.

Dev notes

  • Vertex AI workbench instance needs a defined network in GCP project
    • (User-managed and Managed notebooks are deprecated and no longer supported.)
    • Create VPC using auto-mode
  • Secure boot in Machine Type
  • Added instance to organization policy constraints/compute.vmExternalIpAccess: Override parent's policy -> Replace parent -> Allow -> projects/<PROJECT_NAME>/zones/us-central1-a/instances/<INSTANCE_NAME>

About

A cheatsheet of commands that I always forget

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors