3
votes

I'm running Google App Engine dev_appserver (golang) and have it working with the production Google Cloud Storage (GCS) such that it can read and write files via HTTPS to an actual GCS bucket. But how do I get the local dev_appserver to simulate GCS locally? I keep seeing people mention it's possible but can't find any documentation on how to set it up so that you can use the same cloud storage client library for development where all cloud files are stored locally.

Even Google's documentation seems to imply it is possible with the devserver in that you can change the storage path for "Google Cloud Storage Files": https://cloud.google.com/appengine/docs/go/tools/devserver

So if I can specify where to save Google Cloud Storage files then how do I setup the Client for Google Cloud Storage (https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/) to work locally?

1
I already had that link in my post. Do you know if cloud storage can be simulated locally or not?tmoore
I use the Python SDK cloudstorage client. It uses the blobstore for storing GCS buckets locally.voscausa
So the Go version does not support this?tmoore

1 Answers

2
votes

The Go dev_appserver does not currently support local Google Cloud Storage emulation. What is recommended is that you create a real GCS bucket for testing purposes and then you can start your dev_appserver to talk to the "test" GCS bucket.

This tutorial: https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/getstarted gives detailed instructions on how you can set up your local app to use a real GCS bucket. (Make sure you carefully follow the linked instructions to enable the two Cloud Storage APIs and set up and download your private key.)

Also, just FYI, the google-appengine-go Google Group is a great place to ask questions like this and also search through the posts to find answers. There are a lot of really helpful people on that list to help you get up and running quickly.