Skip to content
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

Determine how to support emulators consistently across all clients. #10300

Closed
theacodes opened this issue Feb 5, 2018 · 7 comments
Closed

Determine how to support emulators consistently across all clients. #10300

theacodes opened this issue Feb 5, 2018 · 7 comments
Labels
api: bigtable Issues related to the Bigtable API. api: core api: datastore Issues related to the Datastore API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API. type: process A process-related concern. May include testing, release, or the like.

Comments

@theacodes
Copy link
Contributor

There are emulators available for several APIs (such as Datastore and Pub/Sub). We need to figure out the right client patterns to support these across the board. This issue is to discuss our options.

Also relates to #3920

@chemelnucfin
Copy link
Contributor

See #4897 also for storage related questions.

@rvandegrift
Copy link

Shouldn't the libraries just use the env vars that trigger the SDK to connect to the emulators?

For instance, to use the Datastore emulator, you set DATASTORE_EMULATOR_HOST=<host>:port. That's enough indication that google.cloud.datastore.Client should skip credentials and connect directly to the emulator.

What is the reason for thinking that some other interface is required? IMO, if I have to set anything else, it's a worse developer experience.

@theacodes
Copy link
Contributor Author

That's one option. The description of the bug is the figure out the right client patterns, and that includes considering implicitly using emulators when env vars are set.

@rvandegrift
Copy link

Would an implementation of this approach be merged? Seems like there hasn't been another idea in the past year

@brandonjbjelland
Copy link

brandonjbjelland commented Mar 21, 2019

Requisite: Thank you much for maintaining these libraries. They're super dope and I want to see them continue growing in awesome ways!

Chiming in to support @rvandegrift 's approach and hopefully nudge this forward. This approach mostly aligns with the way the Node.js library supports working with the emulator. Same concept but a different environment variable pitched here.

If another option is needed to debate, I'll pitch passing a configuration dict/object when instantiating a client. This would would feel plenty idiomatic (boto3.client or Session are reasonable examples) though I gather aren't typically necessary when running against (for example) a production Firestore instance in a given project. I think that's the right consideration - is a configuration block valuable for any of these client libraries when establishing a session (e.g. would it enable some intrepid user to authenticate distinct client sessions to multiple projects/instances of a given product within the same python module space)?

In terms of local development and testing, some solution here seems critical. What's needed to keep this moving?

@deanberris
Copy link

Is there an update on this? I'm in the process of attempting to migrate an AppEngine service running in the python27 environment towards using the google-cloud-* client libraries for use in the python37, and testing locally with emulation is critical for integration testing to ensure we're not breaking anything. Is this a regression, maybe something we can work around?

@plamut plamut transferred this issue from googleapis/google-cloud-python Jan 31, 2020
@plamut plamut transferred this issue from googleapis/python-pubsub Jan 31, 2020
@plamut plamut added api: bigtable Issues related to the Bigtable API. api: core api: datastore Issues related to the Datastore API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API. type: process A process-related concern. May include testing, release, or the like. labels Jan 31, 2020
@parthea
Copy link
Contributor

parthea commented Oct 21, 2023

Closing as obsolete as there is no recent activity.

@parthea parthea closed this as completed Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. api: core api: datastore Issues related to the Datastore API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

10 participants