google-app-engine-python

How to restrict access to GAE Flexible site only for GSuite account?

☆樱花仙子☆ 提交于 2019-12-23 02:01:28
问题 How to restrict access to GAE Flexible site only for all account from my domain in GSuite and eventually other Google accounts that I provide explicitely. AFAIR there where something simillar in Standard GAE version in app.yaml handlers section. So my scenario: prodution versions restricted until go-live dev and stage version restricted permanently I would like to do this on the IAM level, to reject traffic to the site. But I didn't found anything in docs. 回答1: Ok, after rethink the problem

How to run long cron jobs on App Engine flexible environment?

点点圈 提交于 2019-12-22 17:58:06
问题 I have an app on App Engine (flexible environment) and configured a few cron jobs. These jobs should take several minutes but I see them failing after ~30 seconds (502 error). The documentation is not very clear regarding the max time of cron jobs (Scheduling Jobs with cron.yaml), although it seems that "An HTTP request invoked by cron can run for up to 24 hours". Any ideas of how to overcome this? Thanks in advance 回答1: This is an answer to my own question. The problem I had was that I only

App Engine Flexible + App Identity (Python)

ぃ、小莉子 提交于 2019-12-20 04:55:28
问题 Is there a way to port the functionality of from google.appengine.api import app_identity from google.appengine.api import urlfetch in the flexible environment? I have a service running on the flex environment which needs to make a request to the standard environment and would like to use App Engine's native app identity and X-Appengine-Inbound-Appid header to do so. It seems that if the origin of the request is from the standard environment, the header is passed on to the flex environment

In Google App Engine, how can I work with eventual consistency in handling form submissions?

时光总嘲笑我的痴心妄想 提交于 2019-12-19 08:41:10
问题 I've noticed that, with eventual consistency, the common form-processing workflow that I am used to (submit -> create/update record -> redirect -> reload) doesn't work. Upon redirect, the new record (probably) won't be available for display. How should I handle forms so that updates are displayed upon reload? I could try to use strong consistency, but as the App Engine documentation notes, updates are limited to one update per second. So how can I process a form providing immediate user

Cannot run Google App Engine custom managed VM: --custom-entrypoint must be set error

冷暖自知 提交于 2019-12-18 11:44:24
问题 PROBLEM DESCRIPTION I am trying to create a custom managed VM for Google App Engine that behaves identically to the standard python27 managed VM provided by Google. (I'm doing this as a first step to adding a C++ library to the runtime). From google documentation, the following Dockerfile specifies the standard python27 runtime: FROM gcr.io/google_appengine/python-compat ADD . /app I have verified that this is the right Dockerfile by examining the one generated by gcloud preview app run when

Direct user upload to GCS with given name and parameters

纵饮孤独 提交于 2019-12-18 09:34:52
问题 I want to enable clients of my Python GAE app to upload files directly to GCS using a specific object name and GCS parameters I set up front (such as cache control and ACL), and perform some actions after the upload has finished. I currently use the blobstore.create_upload_url for this. However, since I cannot give any parameters or object name up front, I need to copy the entire file to a new location on GCS from within the 'uploaded' callback handler. This is time and (compute) resource

Migrating from App Engine Files API

一个人想着一个人 提交于 2019-12-18 09:18:14
问题 My app stores a bunch of images as blobs. This is roughly how I store images. from google.appengine.api import files # ... fname = files.blobstore.create(mime_type='image/jpeg') with files.open(fname, 'a') as f: f.write(image_byte) files.finalize(fname) blob_key = files.blobstore.get_blob_key(fname) To serve these images, I use images.get_serving_url(blob_key) . Here are my questions: Will I have to copy over all blobs to Google Cloud Storage? In other words, will I be able to access my

When will memory get freed after completing the request on App Engine Backend Instances?

徘徊边缘 提交于 2019-12-18 09:09:32
问题 Scenario- I am running B* instances on App Engine. I've a background ETL related task( written in python ) scheduled as a cron job on App Engine. When time arrives, cron initiates a http request to start the task and runs without returning a response till the task gets completed. When task was executing, it was typically consuming "X" MB of RAM. After the task got finished and returned 200 OK, App Engine Instance monitoring is still showing "X" MB of RAM in use. Please help me understand the

Google KMS on AppEngine Dev Server - logging clutter

半腔热情 提交于 2019-12-18 08:57:28
问题 This is a known issue: https://issuetracker.google.com/issues/63253097 Further to my question about getting Google KMS working with App Engine, I'm opening a new question about a related but problematic side effect. Namely, the Google Cloud API discovery appears to want to walk a number of paths outside the AppEngine sandbox. This itself is not a problem, but it makes testing and debugging very problematic because each attempt is logged, producing hundreds of lines like the following: INFO 03

Multiple services with different dockerfiles on GAE Flexible

徘徊边缘 提交于 2019-12-17 17:15:26
问题 I'm using Google AppEngine Flexible with python environment. Right now I have two services: default and worker that share the same codebase, configured by app.yaml and worker.yaml . Now I need to install native C++ library, so I had to switch to Custom runtime and added Dockerfile. Here is the Dockerfile generated by gcloud beta app gen-config --custom command FROM gcr.io/google-appengine/python LABEL python_version=python3.6 RUN virtualenv --no-download /env -p python3.6 # Set virtualenv