GS File Location on Local / Dev AppEngine

I am trying to fix some problems that I have with the export task that I created. I am trying to export CSV data using Google Cloud Storage and I seem to be unable to export all my data. I guess this has something to do with the FAR TOO LOW file limit (30 seconds) when trying to restart the task.

I need to worry about shooting, but I can not find where my local / development server writes files. I see numerous entries in the GsFileInfo table, so I assume something is happening, but I cannot find the actual output file.

Can someone tell me the location of Google cloud storage files in the local AppEngine development environment?

Thanks!

+4
source share
2 answers

As tkaitchuck mentioned above, you can use the included LocalRawGcsService service to pull data from local.db. This is the only way to get the file, as it is stored in the local database using blobstore. Here is the original answer:

which are uri files for GAE java to emulate cloud storage using the GCS client library?

+1
source

Looking at dev_appserver , it looks like you can specify a path, or it will calculate the default value based on the OS used.

blobstore_path = options.blobstore_path or os.path.join(storage_path, 'blobs') 

He then went this way to blobstore_stub (GCS storage is supported by the blobstore stub), which seems to be tricking files with its blobstore key.

  def _FileForBlob(self, blob_key): """Calculate full filename to store blob contents in. This method does not check to see if the file actually exists. Args: blob_key: Blob key of blob to calculate file for. Returns: Complete path for file used for storing blob. """ blob_key = self._BlobKey(blob_key) return os.path.join(self._DirectoryForBlob(blob_key), str(blob_key)[1:]) 

For example, I use ubuntu and start with dev_appserver.py --storage_path=~/tmp , then I could find the files in ~ / tmp / blobs and datastore under ~ / tmp / datastore.db. In addition, you can go to the local administrative console, the link to view blobstore will also display gcs files.

+1
source

Source: https://habr.com/ru/post/1487519/


All Articles