GoogleCloudPlatform / GoogleCloudPlatform/esp-v2
local testing without --service_account/talking to GCP at all
- Dominant language
- Go
- Stars
- 307
- Forks
- 185
- Avg merge
- 14h 45m
- Merged PRs (30d)
- 6
Description
hi all,
I am looking into adopting Google Cloud Endpoints for our codebase. One thing I am trying to understand is what the local development story is. We have gRPC endpoints that we would like to expose as both gRPC and HTTP JSON-transcoded endpoints. From the (documentation)[https://cloud.google.com/endpoints/docs/openapi/running-esp-localdev], it looks like even the local development mode requires passing `--service_account_key` json file. Note that we are also using the `--service_json_path` flag with a json file from `gcloud endpoints configs describe` that we plan to check in to the repo.
1. Is there a way to turn talking to GCP off and not provide any kind of credentials? We would like to avoid any kind of outside network dependencies for local development.
2. What is ESP doing right now in local mode that requires talking to GCP? It looks like with the `--service_json_path`, it is already reading service definition completely locally (which is what we want). What is remaining that requires the dependency?
Just for posterity, this is currently how we are running esp locally via docker-compose:
```
esp:
image: gcr.io/endpoints-release/endpoints-runtime:2
command:
- --backend=grpc://backend=localhost:5000
- --non_gcp
- --service_json_path=/gcloud_config.json
```
Where /gcloud_config.json is taken from `gcloud endpoints configs describe`. The process would error with this unless we also provide `--service_account_key`:
```
Attaching to prodvana_esp_1
esp_1 | ERROR: If --non_gcp is specified, --service_account_key has to be specified, or GOOGLE_APPLICATION_CREDENTIALS has to set in os.environ.
```
Contributor guide
Assessment
This issue has not been assessed yet.