How can I deploy multiple applications from same or different language/runtime originating from a single project in google cloud app engine?
-
So what's the question?Dan Cornilescu– Dan Cornilescu2017-09-04 13:49:19 +00:00Commented Sep 4, 2017 at 13:49
-
sorry for the misleading language. Just edited.Akash Mishra– Akash Mishra2017-09-04 13:52:07 +00:00Commented Sep 4, 2017 at 13:52
-
Also check if that wouldn't be in violation of section 3.3 (d) of the Terms of Service: cloud.google.com/termsDan Cornilescu– Dan Cornilescu2017-09-04 13:53:53 +00:00Commented Sep 4, 2017 at 13:53
-
Think not, because I dont intend "to simulate or act as a single Application, Account, or Project (respectively) or otherwise access the Services in a manner intended to avoid incurring Fees;". I would still want to deploy it as two different apps, with different versions accessible with different URLs. Secondly, google cloud does provide the facility to deploy multiple services on a project: cloud.google.com/appengine/docs/standard/python/…Akash Mishra– Akash Mishra2017-09-04 14:09:56 +00:00Commented Sep 4, 2017 at 14:09
-
OK. But you need to give a lot more details. Do you want multiple services? Multiple apps? What's your app doing? What are the difficulties? Otherwise the answer is simple (and likely useless): Yes - you just re-write/adjust your app code as needed :) But note that depending on your app specifics it might not be possible or it might require a lot of work. For example sharing the datastore across multiple apps require extra work, task enqueueing across apps is impossible.Dan Cornilescu– Dan Cornilescu2017-09-04 14:19:28 +00:00Commented Sep 4, 2017 at 14:19
2 Answers
Deploying Multiple Services to Google Cloud App engine.
Create the following files in the app root directory
Create app.yaml file with content:
runtime: nodejs14
service: default
Create myserviceone.yaml file with content:
runtime: nodejs14
service: myserviceone
Create myservicetwo.yaml file with content:
runtime: nodejs14
service: myservicetwo
Deploy using command
gcloud app deploy --project your_project_id app.yaml myserviceone.yaml myservicetwo.yaml
This will deploy the default service as well as my service one and my service two. Check out your cloud console.
You can access them using:
https://myserviceone-dot-yourProjectID.appspot.com/ or http://myserviceone.yourProjectID.appspot.com/
https://myservicetwo-dot-yourProjectID.appspot.com/ or http://myservicetwo.yourProjectID.appspot.com/
2 Comments
Today, App Engine has a one-to-one correspondence with a Google Cloud Console project. You cannot deploy multiple "apps" in the same project. However, you might still be able to do what you want depending on your application(s).
App Engine has the concept of "services," which are independent aspects of your application. Your App Engine app can have many services and each service can have its own language/runtime and even be on different App Engine environments.
You could have say a Python service on App Engine standard environment that is used to serve your simple Flask site, could have service that serves an API written in Java 8 on the Standard Environment, and could have yet another service in say Node.js running in the App Engine flexible environment.
Your "default" service is defined in your app.yaml file. Your other services can be defined in different folders and can have either an app.yaml with their service definitions or you could name them something else like backend.yaml. See this simple Python project for the layout of the configuration files.
For more conceptual information about services on App Engine, see Microservices Architecture on Google App Engine.