deploy multiple enpoint api google app engine - google-app-engine

I have 2 json files, I want to deploy on GCloud
With this command:
gcloud endpoints services deploy first_file.json
gcloud endpoints services deploy second_file.json
But after second file deploys the first one is removed.
Why?

If both files are for the same service you should check this documentation on how to deploy configuration files. You might be also having some issues with naming, as described in the description of the gcloud endpoints services deploy page.
Besides that, here you'll find tutorials on how to configure Endpoints on App Engine Standard.
If this is not the case, please add more information to the question, such as what is your use case and some code if possible.

Related

Google cloud Appengine standard environment deployment using Admin API: "Cant find import" Error

I am trying to deploy a simple "hello world" application in Appengine standard - Go environment. There is one source file hello.go with one import "google.golang.org/appengine"
I followed the documentation here to use the Admin API for deployment. But I got "can't find import: google.golang.org/appengine" error when I checked the status of the deployment.
So I uploaded the google.golang.org library folder to Cloud Storage, but documentation seems to only show how to include single files separately from GCS buckets, which is not feasible for big imported libraries.
I know all this will work with "gcloud app deploy", but I have to use the Admin API and standard environment.
Is there a way to tell Appengine to "go get" imported libraries?
Is there a way to include folders (not single files) from GCS bucket in
deployment config files?
The deployment works with gcloud because the appengine library is present in your GOPATH. gcloud fetches them from there.
In the case of the deployment using Admin API, in order to not include one per one all files from your libraries, the packages need to be present in Google Cloud Storage for ZIP deployment or you can use Cloud Source Repositories, build it with the CREATE call and then deploy it from a container with the Cloud Build image.

Can I have application versions in python27 and python37 in Google App Engine Standard (both types)

I want to test Python 3.7 on Google App Engine Standard.
I am afraid if I upload application with python37 old application will stop working and will be no revert to previous python27.
Can you share some experience if it possible to keep both runtime versions?
It is not clear for me.
I read Python 3.7 on Google App Engine - documentation but not found information.
You have 3 main options, ranked from easier to 'harder' to do:
Just deploy this test you want to do in a new project, and you don't have to worry about your old application getting replaced.
Deploy this test to a new service. Just add the line service: whatevername to the app.yaml file of your test, and deploy it as usual with $gcloud app deploy. VoilĂ , you have a new service.
You can deploy this test in your default service, but to avoid stopping the previous one, add the --no-stop-previous-version flag to your $ gcloud app deploy command. After that, you can split traffic between this test and your actual app.
To be honest, I would go with options 1 or 2, as they are far more simple to deploy, and you can later on delete the test project or delete the new service if you wish to.

How to deploy create-react-app to Google Cloud

I have a frontend create-react-app and a backend API using Expressjs.
I deployed the backend API to Google App Engine successfully.
But now I need to deploy the create-react-app to Google Cloud and it becomes very confusing, I tried to google for a while and there is no true/recommended way for this.
At least I saw that other people suggested doing it in 2 ways:
Using Google Cloud Storage:
Run "npm run build" to create the "build" folder
Upload this whole folder onto a bucket
=> I see that there is one drawback using this way: When I tried to reload page 'url/aboutUs', it's not found. So I have to go back to 'url' then click the About Us link
=> I guess that the React Router that I'm using is not working with Google Cloud Storage
Using Google App Engine
=> People just talked about using it, but I can't find any guide/tutorial for this.
So what is the recommended way to deploy create-react-app to Google Cloud?
And can you please provide a tutorial for that?
Thanks.
You just need to configure the Cloud Storage bucket to serve index.html as the 404 page.
For Google App Engine, you can use serve or set up nginx to serve index.html in the build folder.

Deploying Push Queues in Google Cloud

I'm deploying an app in Google Cloud that has multiple microservices. For one of them, I wish to use a push queue. I configured my queue.yaml file as follows:
queue:
- name: equeue
rate: 10/s
retry_parameters:
task_retry_limit: 1
task_age_limit: 2d
I spin up the SDK and the queue is working fine, just as it should. But then I go to push it to my app on Google Cloud using:
gcloud app deploy --project=<projectname> --promote --stop-previous-version
The code all loads correctly, but the queue never gets created. I am getting errors from my code as follows:
API error 1 (taskqueue: UNKNOWN_QUEUE)
And when I look in the console, on https://console.cloud.google.com/appengine/taskqueues, the queue has not been created.
I've read the documentation and it seems to indicate that all I need to do is create the queue.yaml file and deploy the app (and that has worked for me in the past, albeit with an older version of the SDK.)
In case it helps, here are the components I'm running locally:
Google Cloud SDK 164.0.0
app-engine-go
app-engine-python 1.9.57
bq 2.0.24
core 2017.07.25
gcloud
gsutil 4.27
Thanks!
Dan
The queue.yaml is an app-level configuration file, not a service-specific one. See (marginally related) Why do I need to deploy a "default" app before I can deploy multiple services in GCP?
While in a single service app case deploying the default service might also update one or more of these app-level configs that is not guaranteed in a multi-service app case. Which is why each of these configs also comes with an individual dedicated method of deployment which can be performed independently of and/or without updating any of the app's services.
For queue.yaml in particular deployment can be done using gcloud app deploy:
gcloud app deploy [...] queues.yaml
or, if you're using the GAE SDK, using appcfg.py update_queues:
appcfg.py update_queues -A <app_id>

Deploy and download a wordpress application to google compute engine

How to deploy a local wordpress instance to google compute engine and download the same. I manage to deploy to google app engine, looking around for the document to deploy to google compute engine and download the same. With the existing post I can see its defn possible, but not able to locate the right document.
Also is it possible to deploy using gcloud commands ?, what is the command to use ?
I tried this command gcloud preview app deploy app.yaml but it keep complaining [application] is not used by gcloud. When I remove this tag, it keeps complaning endlessly. Is there a different app.yaml structure for compute engine and app engine.
How can I generate app.yaml file that is compatible with compute engine ?. Can it be downloaded some where or using a gcloud command ?, gcloud config doesnt seem to generate one.
We just finished working on a tool and guide to help do exactly what you're asking:
https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/appengine/flexible/wordpress
Let us know if you run into any issues!

Resources