Re: [google-appengine] Google Translate API & Permissions

2021-05-07 Thread wesley chun
@Joshua: your inquiry inspired me to do some research into this issue over
the past few months resulting in the following:

1. *Use Cloud client libraries:* yep, your experience was not fun for any
developer looking to use a Cloud API (whether App Engine or a simple
cmd-line script). One solution is to avoid the Google APIs client library
 and use the Google Cloud
client libraries 
instead, and in your case just the one for Cloud Translation
(basic/v2
 or
advanced/v3
).
(I'm also working on a blog post to outline the differences between
these *platform
vs. product* client libraries, so stay tuned for that.) With the Cloud
Translation client library (which hides a lot of low-level details), your
code sample can be as simple as:

from __future__ import print_function
import google.auth
from google.cloud import translate

TRANSLATE = translate.TranslationServiceClient()
_, PROJECT_ID = google.auth.default()
PARENT = 'projects/{}'.format(PROJECT_ID)
TARGET_LANG = 'es'
TEXT = 'Hello world'
DATA = {
'parent': PARENT,
'contents': [TEXT],
'target_language_code': TARGET_LANG,
}
try:# Python 3/advanced/v3
rsp = TRANSLATE.translate_text(request=DATA)
except TypeError:   # Python 2/basic/v2
rsp = TRANSLATE.translate_text(**DATA)
print(TEXT, '=', rsp.translations[0].translated_text)

It works in Python 2 and 3 without any modification:

$ python2 translate_demo2.py
Hello world = Hola Mundo
$ python3 translate_demo2.py
Hello world = Hola Mundo

You should be able to just drop something like this right into your App
Engine code (plus the necessary stuff in app.yaml and requirements.txt).
App Engine comes with a default service account
,
so you don't need to mess with all you did unless you need to (create a
separate service account and public/private key-pair) for other reasons. To
run this script *locally* (as I did above), you *do* need to do that
(create a service acct & keypair, download the JSON credentials file to
your local system, then point GOOGLE_APPLICATION_CREDENTIALS to it), but
not on App Engine (nor Cloud Functions nor Cloud Run) as *all 3* have
default service accounts.

2. *Sample app:* I created a simple Python 2 GAE app that uses that Cloud
Translation code to get an idea of what you went through and discovered it
wasn't that bad if the product client library is used. Then I wanted to see
how challenging it would be to port it to Python 3 (since you got to at
some point) as well as running it locally. Then I thought, "Why not try to
throw the app into a Docker container for Cloud Run?" *Bottom-line*: today
I pushed to GitHub this "nebulous" sample app
 that
can be deployed (at least) 8 different ways w/just minor config changes.
Eh, I'll write up a blog post on this one too when I get a chance.

I know the challenges weren't fun to deal with, but I hope these can help
you and other developers!
--Wesley

On Mon, Dec 7, 2020 at 10:10 AM Joshua Smith 
wrote:

> This problem is more systemic than that. The documentation lacks a
> step-by-step how-to. I understand that there are a lot of options, but I'm
> pretty sure my use case is very common:
>
> 1. I have a google app engine app
> 2. I want to call the translation API from that app
>
> I figured out how to do that from the translation API docs, but I lacked
> permission.
>
> I could not find any step by step instructions for giving permission. I
> found this:
>
> https://cloud.google.com/translate/docs/setup
>
> which pointed me to this:
>
> https://cloud.google.com/iam/docs/understanding-roles
>
> at which point a normal human is going to be ready to give up. Look at
> that second page! It's an endless stream of gobledegook.
>
> After getting the pointer from Amit that I need to add the role to IAM, I
> went to IAM & Admin in my console, and selected "roles". Spoiler alert:
> this is not where you do this.
>
> Amit mentioned "service accounts" so I went looking for that. I chose the
> "Service Accounts" section. I see my service account, and it has a "..."
> Actions menu. None of those actions are about adding roles.
>
> I click on the link for my service account, and see there's a tab for
> "permissions". Doesn't seem to be anywhere I can give it permissions there.
>
> Honestly, I've just given up again. I know that by fumbling around in the
> console I eventually ended up on a page where it wanted me to type an email
> address. And I eventually figured out that it wanted the email address of
> the service account. But for the life of me, I can't find that now.
>
> You need to write a how-to for giving an app engine app permission 

[google-appengine] Re: Free Trial Registration issue

2021-05-07 Thread 'Aref Amiri (Cloud Platform Support)' via Google App Engine
This is a known issue and has already been routed to the engineering team. 
You can refer to this Public Issue Tracker 
 to get the latest update on the 
issue.

On Thursday, May 6, 2021 at 3:54:31 PM UTC-4 vamsib...@gmail.com wrote:

> I am not able to register for Google cloud platform free trial. Also my 
> credit card was debited with 1rupee. Nothing is shown after the transaction.
> #googlecloudplatform
>

-- 
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/f52e37c2-767b-4e55-b9fc-958c0ee20f98n%40googlegroups.com.


[google-appengine] Re: Free trial registration issue

2021-05-07 Thread 'Shawn Wu' via Google App Engine
please try to use the  chrome incognito mode or try to clear the cookies 
and try again.
On Thursday, May 6, 2021 at 3:54:32 PM UTC-4 Animesh Sharma wrote:

> Please try firefox private window. I am able to do so by this only.
>
> On Thursday, May 6, 2021 at 7:37:54 PM UTC+5:30 pref...@gmail.com wrote:
>
>> I am not able to register for Google cloud platform free trial. Also my 
>> credit card was debitted with 1rupee. Nothing is shown after the 
>> transaction.
>> #googlecloudplatform
>>
>

-- 
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/1754b93f-3f3c-4b71-86c4-291f88503d92n%40googlegroups.com.


Re: [google-appengine] Re: Max 10,000 file limit is not suitable for modern full featured wordpress site or any PHP app

2021-05-07 Thread Sandeep Koduri
These are plugins which are in PHP not static files.
We are using a paid account.

On Fri, May 7, 2021 at 3:50 AM 'yananc' via Google App Engine <
google-appengine@googlegroups.com> wrote:

> Hi Sandeep,
>
> According to the documentation [1], Apps can serve static files from a
> Google Cloud option such as Cloud Storage, serve them directly, or use a
> third-party CDN. And also, the Google Cloud Platform free tier coverage
> does not provide quota increase requests, you may have to upgrade to a paid
> billing account if you would like to use features that are not included in
> the Free trial, such as GPUs, Windows servers, and quota increases [2].
>
>
> [1]:
> https://cloud.google.com/appengine/docs/standard/go111/serving-static-files
>
> [2]: https://cloud.google.com/free/docs/gcp-free-tier#how-to-upgrade
>
>
> On Wednesday, April 28, 2021 at 3:14:38 PM UTC-4 Sandeep Koduri wrote:
>
>> I was looking at what files/folders has most files. Realized its plugins,
>> I am not sure if I can use plugins from Cloud Storage.
>>
>> I dont understand the solution here, if appengine is infrastructure as
>> service and I am paying for resources I use., why do I need special support
>> plan.
>>
>> Addressing responses from Google here, Cloud Storage Cant be answer for
>> problem here. And its not App Engine Free Tire issue(we have a billing
>> account).
>>
>> On Wednesday, April 1, 2020 at 12:18:03 AM UTC+5:30 henry@gmail.com
>> wrote:
>>
>>> Thanks  Katayoon
>>> we are uploading just 1 file per POST request.  About 10'000 files per
>>> month.
>>> Henry
>>>
>>>
>>>
>>> On Tue, 31 Mar 2020 at 10:45, 'Katayoon (Cloud Platform Support)' via
>>> Google App Engine  wrote:
>>>
 Hello Henry,

 Looking into your issue report, it seems your issue is not related to
 the App Engine deployment quota and is related to the Blobstore
 . So,
 you may consider the maximum number of files in a single form POST which
 the limit is 500. I have reopened your issue tracker ticket for further
 investigation and you can continue with it.

 --

>>> 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-appengi...@googlegroups.com.

>>> To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-appengine/cb50ade3-c13b-4de0-a0ab-3ac9311157ef%40googlegroups.com
 
 .

>>> --
> 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/uxLbmkWZPqM/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/731d2dc7-490d-4c3b-80e5-fa1da8314bbcn%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/CAKDjjOTfAtSJ2NAo9PKwEbyX_vsYcWWicAJFu2rL__HRLuHkgQ%40mail.gmail.com.