[google-appengine] Re: Secure Cloud Scheduler App Engine route with X-Cloudscheduler

2020-04-24 Thread 'Olu' via Google App Engine
 Actually, the test was done on another Customer's setup in the past. You 
can be sure that the Internal Cloud Scheduler engineers are aware of this 
usage. In fact, there is an Internal Feature request with the Cloud 
Scheduler team for the use of these headers. 

At the moment, Our recommendation is to use these headers for informational 
purposes rather than using it for Security.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/3a389b1f-f447-49d1-aa9e-7a3a9ee3fa27%40googlegroups.com.


[google-appengine] Re: App Engine Flexible Environment - Dockerfile installing outdated version of GDAL

2020-04-24 Thread 'Olu' via Google App Engine
Hello,

Thank you for the information shared. I actually observed that it seems you 
posted the same issue on Stackoverflow[1] and one of the GCP Support 
Engineers is assisting you on the Thread. 

Configuring your application to listen on Port 8080, you can simply set a 
PORT environment variable set to 8080. Reviewing the information provided, 
it seems to me like you are simply following steps described in this 
documentation[1] and choosing to point the entrypoint to your WSGI server, 
MyApplication.wsgi using gunicorn for your Django application. As explained 
however, in this documentation[3], there might be other configurations 
required depending on your application in which it is recommended that you 
set up a gunicorn.conf.py file. You can consult this Gunicorn 
documentation[4] for details about available Gunicorn's configuration 
values. 

Also, as advised by the GCP Support engineer on Stackoverflow, I recommend 
that you review the details of this Sample AppEngine Django App on GitHub[5]

[1]https://stackoverflow.com/questions/61390259/app-engine-flexible-environment-dockerfile-installing-outdated-version-of-gdal
[2]https://cloud.google.com/appengine/docs/flexible/python/runtime#application_startup
[3]https://cloud.google.com/appengine/docs/flexible/python/runtime#recommended_gunicorn_configuration
[4]http://docs.gunicorn.org/en/19.3/settings.html
[5]https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/flexible/django_cloudsql

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/be23f3f9-5b2e-4098-98dc-da3023c3e33d%40googlegroups.com.


[google-appengine] Re: Secure Cloud Scheduler App Engine route with X-Cloudscheduler

2020-04-24 Thread James Watkinson
Thanks Olu for testing, 

Could you provide the scenario in which the header was not presented? Can 
you also raise a ticket to get this fixed / added to all Cloud Scheduler 
requests? 

login: admin is not available in Python 3.7 App Engine environment App.yaml 
reference: 
https://cloud.google.com/appengine/docs/standard/python3/config/appref

On Tuesday, 21 April 2020 16:39:28 UTC+1, Olu wrote:
>
> According to Cloud Scheduler documentation [1--See the App Engine HTTP], 
> App Engine endpoints can be secured with "login:  admin" in the app.yaml 
> file. While I understand that the admin login feature is not available for 
> some environments and not documented for some of the App Engine Standard 
> Language Runtimes, certainly it is not available for App Engine flex, I do 
> not have any information about the deprecation. At the least, I have no 
> documentation that confirms that at this point.
>
> About the use of X-Cloudscheduler:true as a header, following internal 
> tests completed on various types of requests, this may somewhat be relied 
> upon to filter requests for some of the cases. However, in one of the tests 
> done in the past for requests, we found the use flawed. Since using the 
> X-Cloudscheduler:true as a header may not be viable for all cases(at least, 
> from our internal tests in the past), I believe this may be the reason why 
> the documentation has not been duly updated.
>
> [1]https://cloud.google.com/scheduler/docs/creating#creating_jobs
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/874aa788-d794-4df7-a2b2-0bdf6327041d%40googlegroups.com.


[google-appengine] Re: App Engine Flexible Environment - Dockerfile installing outdated version of GDAL

2020-04-24 Thread j o
This is apparently happening as my app isn't running on port 8080 and App 
Engine is then crashing. How do I make sure that it is running on 8080? 

This is my app.yaml: 

EDIT:

My app.yaml:

# [START django_app] runtime: custom env: flex entrypoint: gunicorn -b :$PORT 
MyApplication.wsgi runtime_config: python_version: 3 # [END runtime] handlers: 
# This configures Google App Engine to serve the files in the app's static # 
directory. #- url: /static # static_dir: static/ #- url: /MyApplication/static 
# static_dir: MyApplication/static/ # This handler routes all requests not 
caught above to your main app. It is # required when static routes are defined, 
but can be omitted (along with # the entire handlers section) when there are no 
static files defined. - url: /.* script: auto # [END django_app] resources: 
cpu: 1 memory_gb: 2 disk_size_gb: 10


On Thursday, 23 April 2020 16:34:29 UTC+1, j o wrote:
>
>  am trying to use a Docker image on Google App Engine Flexible Environment.
>
> FROM ubuntu:bionic
>
>
> ENV PYTHONUNBUFFERED 1
> ENV DEBIAN_FRONTEND noninteractive
> ENV LANG C.UTF-8
>
> RUN apt-get update -qq && apt-get install -y -qq \
> # std libs
> git less nano curl \
> ca-certificates \
> wget build-essential\
> # python basic libs
> python3.8 python3.8-dev python3.8-venv gettext \
> # geodjango
> gdal-bin binutils libproj-dev libgdal-dev \
> # postgresql
> libpq-dev postgresql-client && \
> apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/*
>
> # install pip
> RUN wget https://bootstrap.pypa.io/get-pip.py && python3.8 get-pip.py && rm 
> get-pip.py
> RUN pip3 install --no-cache-dir setuptools wheel -U
>
> CMD ["/bin/bash"]
>
>
>
>
> The docker image appears to build correctly but when the service deploys 
> the application crashes and i get this error message:
>
>  File 
> "/Users/NAME/Documents/gcp/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py",
>  line 183, in IsDone encoding.MessageToPyValue(operation.error))) 
> OperationError: Error Response: [9] 
>
> Application startup error! Code: APP_CONTAINER_CRASHED ERROR: 
> (gcloud.app.deploy) Error Response: [9] Application startup error! Code: 
> APP_CONTAINER_CRASHED
>
> This is failing as the Dockerfile is installing a significantly outdated 
> version of the GDAL package which conflicts with the more current python 
> installation.
>
> How do I ensure that the dockerfile has the correct package repository and 
> is installing the right, up to date, versions? Is there some line that I 
> can insert to update the repository, or at least print the repository, 
> before it starts installing?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/8c5b0d27-17fd-438d-bc1c-7769a7c79898%40googlegroups.com.


[google-appengine] Re: How to deploy grafana on App Engine ?

2020-04-24 Thread 'Olu' via Google App Engine
Thank you for providing more information and context to your inquiry. 

About 502 errors that you got, there might be a number of reasons for the 
errors[1]. Often times, this would require review of your logs to 
understand what may have caused requests to your App Engine applications to 
return the 502s. For example, as explained in this documentation[2], an App 
Engine 502 Bad Gateway would be returned if your App Engine Flexible 
application is running at a higher memory than is configured. App Engine 
would terminate the application if that is observed.

For better troubleshooting or evaluation of this issue, which may involve 
reviewing configurations on your Project, I recommend you contact the GCP 
Support Engineers[3] or if you think this issue is a bug and you are using 
the appropriate User account but it is failing, then open an issue using 
this link[4].

[1]https://serverfault.com/questions/951189/seeing-502-on-google-app-engine#answer-961560
[2]https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors#error_message_bad_gateway
[3]https://cloud.google.com/support-hub
[4]https://developers.google.com/issue-tracker/#public_users

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/95d66dea-0d94-4778-8632-8ff7b0e97bf9%40googlegroups.com.


Re: [google-appengine] Re: Understanding incremental upload in gcloud app deploy

2020-04-24 Thread Nikhil Tibrewal
My question isn’t about the default bucket though. That bucket is always empty.

I understand the cost is negligible, but I feel I should know what files are in 
that bucket and how it relates to GCR. I have 2 services, so 2 images in GCR 
that don’t get deleted even under the ttl-2h directory. They add up to 1GB. The 
size of my artifacts bucket is also 1GB. So it’s puzzling to me without a 
proper explanation as my app as a whole has less than 20 files, and is a test 
app not doing anything significant.

For a proper production app, I imagine the 5GB would be used up very quickly.

Best,
Nikhil

> On Apr 24, 2020, at 7:39 AM, 'barrado' via Google App Engine 
>  wrote:
> 
> Hi,
> 
> I believe the cost of GCS and GCR is almost negligible. Container Registry 
> images are stored in a Standard class buckets whose price is $0.026 per GB 
> per month. Also the first 5 GB in the App Engine default bucket are free. In 
> any case I would refer to the Cloud Storage pricing documentation for a 
> detailed description of the charges using this product.
>  
> 
>> On Friday, April 24, 2020 at 4:08:10 AM UTC+2, Nikhil Tibrewal wrote:
>> Thanks David. So I had to read a lot of Google cloud SDK code to figure out 
>> how GAE, CloudBuild, GCR and GCS are used to orchestrate a deployment onto 
>> GAE.
>> 
>> I'm doing all this because the files in GCS and GCR cost money, that storage 
>> is not free. So I'd like to understand it. My questions have narrowed down 
>> to the following:
>> 
>> 1) During `app deploy`, CloudBuild fetches source files from GCS, builds 
>> images (or uses cached ones if any in GCR), and pushes the latest image to 
>> GCR under the `ttl-2h` folder. I see that this ttl is respected for most 
>> images there, except the ones from 2 most recent builds. Why is this?
>> 2) Following point 1, it seems all images are stored in cloud also (maybe 
>> under us.artifacts?), but that's not free: 
>> https://cloud.google.com/container-registry/pricing. So can you point to any 
>> documentation to explain us.artifacts bucket and what temp files are in 
>> there?
>> 3) Link you shared for default and staging buckets only mentions pricing on 
>> the default bucket (which btw is always empty). Can you share any 
>> information on the pricing of staging and us.artifacts bucket? Are those 
>> free since they're used for intermediate steps which I have no visibility 
>> into?
>> 
>> Thanks in advance!
>> 
>>> On Thursday, April 23, 2020 at 10:41:20 AM UTC-4, David (Cloud Platform 
>>> Support) wrote:
>>> Hello,
>>> 
>>> Here is some information about the default and staging buckets. As for the 
>>> artifact, this is a bucket for the build cache which holds intermediary 
>>> build output. The staging and artifact buckets hold temporary files which 
>>> are part of the deployment process. It is not recommended to delete any of 
>>> these buckets but it won’t break your project if you do.
>>> 
>>> Manually running the command "gcloud app deploy" should check for any file 
>>> changes and only upload those files that were updated. The behavior may be 
>>> different if done from a Cloud Build step. In this case, it would need to 
>>> use previous builds in order to speed up the building time. For more 
>>> information about making your builds faster, please see our documentation 
>>> on best practices for speeding up builds.
>>> 
>>> Please review this document about running Django on GAE standard which 
>>> provides information about Django's collectstatic. Build steps wise:
>>>  
>>> args: ['-m', 'pip', 'install', '-t', '.', '-r', 'requirements.txt']
>>> args: ['./manage.py', 'collectstatic', '--noinput']
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Google App Engine" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/google-appengine/EpXRjvYSTjc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> google-appengine+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-appengine/bc90aeac-dc4c-4ff4-8521-6ad41cd82f4b%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/F878090F-4B11-4F0E-8E66-EDB87B36F793%40gmail.com.


[google-appengine] Re: Understanding incremental upload in gcloud app deploy

2020-04-24 Thread 'barrado' via Google App Engine
Hi,

I believe the cost of GCS and GCR is almost negligible. Container Registry 
images are stored in a Standard class buckets whose price is $0.026 per GB 
per month . Also the 
first 5 GB in the App Engine default bucket 

 
are free. In any case I would refer to the Cloud Storage pricing 
 documentation for a detailed 
description of the charges using this product.
 

On Friday, April 24, 2020 at 4:08:10 AM UTC+2, Nikhil Tibrewal wrote:
>
> Thanks David. So I had to read a lot of Google cloud SDK code to figure 
> out how GAE, CloudBuild, GCR and GCS are used to orchestrate a deployment 
> onto GAE.
>
> I'm doing all this because the files in GCS and GCR cost money, that 
> storage is not free. So I'd like to understand it. My questions have 
> narrowed down to the following:
>
> 1) During `app deploy`, CloudBuild fetches source files from GCS, builds 
> images (or uses cached ones if any in GCR), and pushes the latest image to 
> GCR under the `ttl-2h` folder. I see that this ttl is respected for most 
> images there, except the ones from 2 most recent builds. Why is this?
> 2) Following point 1, it seems all images are stored in cloud also (maybe 
> under us.artifacts?), but that's not free: 
> https://cloud.google.com/container-registry/pricing. So can you point to 
> any documentation to explain us.artifacts bucket and what temp files are in 
> there?
> 3) Link you shared for default and staging buckets only mentions pricing 
> on the default bucket (which btw is always empty). Can you share any 
> information on the pricing of staging and us.artifacts bucket? Are those 
> free since they're used for intermediate steps which I have no visibility 
> into?
>
> Thanks in advance!
>
> On Thursday, April 23, 2020 at 10:41:20 AM UTC-4, David (Cloud Platform 
> Support) wrote:
>>
>> Hello,
>>
>> Here is some information about the default and staging buckets 
>> .
>>  
>> As for the artifact, this is a bucket for the build cache which holds 
>> intermediary build output. The staging and artifact buckets hold temporary 
>> files which are part of the deployment process. It is not recommended to 
>> delete any of these buckets but it won’t break your project if you do.
>>
>> Manually running the command "gcloud app deploy" should check for any 
>> file changes and only upload those files that were updated. The behavior 
>> may be different if done from a Cloud Build step. In this case, it would 
>> need to use previous builds in order to speed up the building time. For 
>> more information about making your builds faster, please see our 
>> documentation on best practices for speeding up builds 
>> .
>>
>> Please review this document about running Django on GAE standard 
>> 
>>  
>> which provides information about Django's collectstatic. Build steps wise:
>>
>>  
>>
>> args: ['-m', 'pip', 'install', '-t', '.', '-r', 'requirements.txt']
>>
>> args: ['./manage.py', 'collectstatic', '--noinput']
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/bc90aeac-dc4c-4ff4-8521-6ad41cd82f4b%40googlegroups.com.


[google-appengine] Re: How to deploy grafana on App Engine ?

2020-04-24 Thread Deepak Natanmai
Hey Team,

I have uploaded grafana docker to GAE, but now it's throwing error 502, 
help me to fix this.

With help of this document I pulled grafana docker, and pushed to container 
registry and gcloud app deploy --image-url=
https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry
https://cloud.google.com/container-registry/docs/using-with-google-cloud-platform#deploying_to


On Friday, April 24, 2020 at 7:37:34 AM UTC+5:30, Deepak Natanmai wrote:
>
> Hey,
>
> I'm able to install grafana on GCE easily using package manager like yum 
> for cent os or apt-get for ubuntu.
> Now the question here is, I have grafana installed and working in GCE, how 
> should i deploy this grafana on GAE ?
> Grafana provide a tar.gz file, which i have downloaded which contains 
> grafana source code, now only uploading this to GAE won't work, there is a 
> grafana-server service which i need to run once deployed.
>
> So how should i do this ?
>
> On Friday, April 24, 2020 at 1:03:56 AM UTC+5:30, Olu wrote:
>>
>> From your comment, I am not absolutely clear about the assistance 
>> required. I believe you are attempting to deploy Grafana to GCP. I 
>> understand Grafana is an open source tool for monitoring and metric 
>> analytics for computer systems, however, I need more understanding as to 
>> what you are attempting. 
>>
>> If your plan is simply to use the Open source tool, you could launch it 
>> from the marketplace[1] on your GCP Console. Or am I missing something? 
>> Please provide more information about what you are trying to do and if you 
>> obtained an error attempting it. 
>>
>> [1]http://console.cloud.google.com/marketplace/
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/60ae1254-b5d0-47b0-a248-457ab708d0a9%40googlegroups.com.