How to specify what version of nginx Google App Engine uses? - google-app-engine

Is there a way to specify which version of nginx is used by Google App Engine in a flexible environment?
The app.yaml reference doesn't specify it.
Is it just not possible?

Yes, you can specify the version of nginx if you use "Custom Runtimes".
Here is the quickstart and a sample for deploying an app in the flexible environment using custom runtimes.
You specify the version of nginx in the Dockerfile like this: FROM nginx:<version> for example I changed it to FROM nginx:1.14.2.

Related

Does my PHP project need appengine-web.xml

Setting up IntelliJ IDEA to run my PHP Wordpress (for App Engine) projects. Google Cloud Tools installed.
Have imported existing project files and then went to Tools > Google Cloud Tools > Run on a local App Engine Standard dev server.
An error is returned:
Project does not contain App Engine Standard modules: To use the App Engine Standard local development server, the project must contain at least one App Engine Standard module with an appengine-web.xml configuration file.
I read up on appengine-web.xml and apparently its used for Java projects. I'm trying to run PHP at the moment.
I haven't dealt with this file type before, is it similar to app.yaml?
Do I need this fie to set up my local server for PHP?
Actually the file appengine-web.xml corresponds to the App Engine Java runtime, you don't need to use it in your PHP project. It is similar to the app.yaml in the sense that it is where you define your default service.
In order to define the default service in your PHP app, you need the app.yaml. There are also optional configuration files, such as:
dispatch.yaml, queue.yaml, index.yaml, cron.yaml, dos.yaml
On a side note, maybe PHP Storm or Eclipse with the PHP Development tools are more suitable for your use case.

PhpStorm / Google AppEngine with PHP7

I recently deployed my app using Google App Engine. I installed Google Cloud SDK and I'm using PhpStorm.
When I run my app using runtime : php55, it works. But I need PHP 7!
When I try with
runtime: php
env: flex
A error occured : flex, only the following runtimes are allowed: ('python-compat', 'java', 'java7', 'go', 'custom')
Do you have an idea?
Here is my app.yaml config:
Here is my composer.json config:
Here is my PhpStorm config:
As answered in the comments to the question, I see you are working with the Development Server, which does not support the Flexible Environment. The Development Server only supports the runtime environments available for App Engine Standard, which are Java 7 (now deprecated) and 8, Go 1.6, Python 2.7 and PHP 5.5.
However, it also supports custom environments, which allows you to work in any programming language just by supplying a base Dockerfile image that configures the runtime environment (in your case you can build yourself an appropriate image with a PHP 7 environment or download it from an existent repository). It requires of course some more complex configuration and management than that of the provided Development Server, but right now, that is the only way you will be able to work with PHP in the development for App Engine.
So the configuration of your application should be correct, it is just that the Development Server does not yet support the Flexible Environment that you need to develop in PHP 7.

Substiitute of dev_appserver.py of Google App Engine [Need to upgrade to FLEXIBLE environment]

I have a Flask-restful API(micro-service) written in python 2.7 using Google Cloud STANDARD environment, and dev_appserver.py(gcloud sdk) helps to run it locally.
Now, I plan to do three things:
Upgrade the code from Python 2.7 to Python 3.5
Google Cloud STANDARD environment to Google cloud FLEXIBLE environment
Question: but standard environment uses AppEngine library and methods, that don't work in flexible environment, so, can Google Cloud Client libraries solve the purpose?
Run locally and test the micro-service
Question: Please give suggestions to replace dev_appserver.py
There are a lot of differences between the environments. A lot of methods and libs from standard won't work in flex.
See here for more info:
https://cloud.google.com/appengine/docs/the-appengine-environments
https://cloud.google.com/appengine/docs/flexible/python/flexible-for-standard-users
https://cloud.google.com/appengine/docs/flexible/python/migrating
You can't use dev_appserver.py in flex environment. You will need to run Flask the regular way. e.g (locally) FLASK_APP=main.py FLASK_DEBUG=1 python -m flask run --port 8080

How is my GAE app able to run without app.yaml?

Although I started development for Google App Engine using Endpoints a while ago, I hadn't noticed this - Google's ref. page for Project structure says this:
Your development file hierarchy should look like this:
MyDir/
[pom.xml]
[build.gradle]
[index.yaml]
[cron.yaml]
[dispatch.yaml]
src/main/
appengine/
app.yaml
docker/
[Dockerfile]
java/
com.example.mycode/
MyCode.java
webapp/
[index.html]
[jsp.jsp]
WEB-INF/
[web.xml]
You'll need to define an app.yaml file that looks like this:
...
Note that the app.yaml is deemed compulsory as per the docs. In my case, I spawned a backend module(through the Wizard) in Android Studio that builds on Gradle. I have been able to build and deploy this module on GAE successfully but now I needed to switch from automatic scaling to basic/manual scaling, I found this to be done through app.yaml file.
Here is the thing: I don't have an app.yaml in place and it works fine. Where is then the config info. that GAE requires to deploy the App.
Specifically,
app.yaml specifies the environment - Java. But, I found the java plugin in build.gradle for that. Aren't 2 config places for the same thing confusing?
Is it possible to ditch app.yaml entirely for equivalent config. in build.gradle?
Why is Google claiming app.yaml to be compulsory when I am able to do without it?
The App Engine Java runtime uses its own configuration schema in XML, while others are YAML.
To set the scaling elements, follow the official reference.

Is there a mandatory requirement to switch app.yaml?

Folks,
I'm using the recently released Google Cloud SDK 0.9.56 on Windows 7x64.
When trying to gcloud deploy my app using web.xml and appengine-web.xml, I get a response:
ERROR: Found no valid App Engine configuration files in directory
When trying to do the same with apps defined with app.yaml there were no issues.
Teammates with older SDK versions don't seem to have an issue.
Is there a mandatory requirement to use app.yaml in all apps?
P.S: This question might be related but its actually a different issue.
sorry about this.
That question you linked is actually the same issue. You can use the new maven plugin described there to translate your appengine-web.xml to app.yaml automatically. We have a gradle plugin coming out very soon to do the same thing.
If you'd like to keep using gcloud directly without Maven or Gradle, you'll need to translate the appengine-web.xml to an app.yaml for now.
Let me know if I can help.

Resources