-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developer Docs: Add local dev environment/authentication docs with googleapis.com example #559
Comments
Local GCP SDK docs - using a separate ubuntu VM on AWS
follow the linux (not the debian/ubuntu) version - even for ubuntu (via curl/tar) prep
Install the gcloud CLI
|
For now I have put up some wiki content on the LZ where I'll continue to post details on SDK calls into the googleapis.com API. The tracking issue where details are worked out is below I had some recent work calling for example BigQuery from on-prem through both the public API and privately through a PSC private connection that I will return to. There is also an older project https://github.com/CloudLandingZone/gcp-landing-zone where I started some java based SDK code in a maven project. This particular project - i only used the gcp shell for auth but will adapt it over the weekend for STS (eclipse)/local dev to reverify token based authentication. It currently uses the two JAVA GCP SDKInstall java either via apt-get or from http://java.sun.com see https://github.com/cloud-quickstart/gcp-landing-zone#authenticate
Install Spring Source Tool Suite for Eclipsehttps://spring.io/tools
checkout codehttps://github.com/cloud-quickstart/gcp-landing-zone
mvn build code
Import existing maven project into eclipse20231014: test authentication By default on a new machine - no GCP authentication credentials yetA run is expected to fail - OK
Authenticate on X1 carbon gen 9open a google browser with the chrome profile set to your gcloud account
Select account accept permissions
navigate to suggested https://cloud.google.com/sdk/auth_success Eclipse must be set for cloud library access not ADC (in the shell)
Lets setup eclipse with the proper environment variablesWe are not using the following as it only supports up to Java 11 (we are using 17) https://cloud.google.com/eclipse/docs/quickstart Follow Setup a service account for authentication and impersonate it
see #494 (comment) Macbook pro 16 M1 running springsource tool suite 4.13.1 - JDK 17.0.5 Add stub endpoint to spring boot app Follow Setup a service account on the genai project, set the GOOGLE_APPLICATION_CREDENTIALS env variable or via gcloud https://cloud.google.com/iam/docs/keys-create-delete#creatingFirst reauthenticate gcloud locally
https://cloud.google.com/sdk/auth_success
set quota project as i was using ADC https://cloud.google.com/docs/authentication/provide-credentials-adc
Create Service Accounthttps://cloud.google.com/iam/docs/service-accounts-create
Add roles to SA
Create Service Account Keyhttps://cloud.google.com/iam/docs/keys-create-delete#creating
Export key
Add service account impersonationhttps://cloud.google.com/docs/authentication/use-service-account-impersonation IAM is enabled on the project serviceAccountTokenCreator is on your user roles suspect I need to add to the SA list - my user - I do check access for user
check SA
|
Clean developer machine - Windows11 version - i9-13900k, 192g ram, dual 4090, dual samsung 990Already has JDK 17, git, git-bash, clean eclipse sts 4.4 but no certs, repos, configs, gcp-configs - currently being used only for VCC22 and cuda download sts 4.4 extract jar
move to /c/sts44 create keys
clone/adapt landing zone SDK java project
clone/adapt spring boot endpoint project
install maven
build on command line
build in eclipse
Test a commit
Developer machine - M1 Macbook ProTest API endpoints |
see #562
|
Use ADC credentials via SAhttps://cloud.google.com/docs/authentication/client-libraries set maven add to pom.xml as usual
Run a GCP GCS example
Working ADC GCP for GCS example from above |
Several client requests for development environment setup beyond the default google cloud shell
We have a containerized Dockerfile dev environment referenced in gcp-tools https://github.com/ssc-spc-ccoe-cei/gcp-tools/tree/main/devcontainer
We need some initial documentation on creating a minimal dev environment locally outside of a full containerized version
wiki entry
Include 1 or more specific examples of calling google apis to BigQuery for example via python or java client APIs
BigQuery Example API call from a local M1 Macbook pro
get auth token
https://cloud.google.com/bigquery/docs/authorization
https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to
https://github.com/GoogleCloudPlatform/shell-samples/blob/HEAD/bigquery/authorization/snippets.sh
after we work with
create a default big query table - in this case one of my GPS data exports
201611185_gps_distinct_rollerblad.csv
Developer Guide
The text was updated successfully, but these errors were encountered: