GoogleCloudPlatform / app-gradle-plugin

The library has moved to https://github.com/GoogleCloudPlatform/appengine-plugins/tree/main/app-gradle-plugin
Apache License 2.0
153 stars 40 forks source link

appengineRun ignores port when added scaling settings #185

Closed mpoehler closed 2 years ago

mpoehler commented 7 years ago

My build.gradle looks like this:

appengine { 
    run {
        port = 8082
    }
}

and my appengine-web.xml looks like this (no explicit scaling settings):

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>@appId@</application>
    <version>@appVersion@</version>
    <service>admin</service>
    <runtime>java8</runtime>
    <threadsafe>true</threadsafe>
    <static-files>
        <include path="/admin/**" expiration="30d"></include>
    </static-files>
    <ssl-enabled>true</ssl-enabled>
    <instance-class>B4_1G</instance-class>
    <!-- scaling settings disabled -->
    <!-- basic-scaling>
        <max-instances>1</max-instances>
        <idle-timeout>10m</idle-timeout>
    </basic-scaling -->
</appengine-web-app>

When I use appengineRun with this settings, I get an instance running on port 8082 as configured.

INFORMATION: Full scan of the web app in place every 5s.
Okt 26, 2017 12:33:00 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: Module instance admin is running at http://localhost:8082/
Okt 26, 2017 12:33:00 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: The admin console is running at http://localhost:8082/_ah/admin
Okt 26, 2017 2:33:00 PM com.google.appengine.tools.development.DevAppServerImpl doStart
INFORMATION: Dev App Server is now running

But when I uncomment the scaling settings in application-web.xml ...

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>@appId@</application>
    <version>@appVersion@</version>
    <service>admin</service>
    <runtime>java8</runtime>
    <threadsafe>true</threadsafe>
    <static-files>
        <include path="/admin/**" expiration="30d"></include>
    </static-files>
    <ssl-enabled>true</ssl-enabled>
    <instance-class>B4_1G</instance-class>
    <basic-scaling>
        <max-instances>1</max-instances>
        <idle-timeout>10m</idle-timeout>
    </basic-scaling>
</appengine-web-app>

... the instance starts up on a random port:

INFORMATION: Full scan of the web app in place every 5s.
Okt 26, 2017 12:35:43 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: Module instance admin instance 0 is running at http://localhost:53000/
Okt 26, 2017 12:35:43 PM com.google.appengine.tools.development.AbstractModule startup
INFORMATION: The admin console is running at http://localhost:53000/_ah/admin
Okt 26, 2017 2:35:43 PM com.google.appengine.tools.development.DevAppServerImpl doStart
INFORMATION: Dev App Server is now running

thanks in advance

Marco

patflynn commented 7 years ago

@loosebazooka potentially a devappserver issue?

loosebazooka commented 7 years ago

Yeah @ludoch ?

ludoch commented 7 years ago

Not sure... Either a gradle issue trying to tell which port to use to the devserver, or the devserver not honoring the used defined port number when basic scaling config is set?

loosebazooka commented 7 years ago

@ludo, this appears to be an issue with basic scaling on. It manifests itself in appcfg based tooling as well like com.google.appengine:appengine-maven-plugin

dmytro-grankin commented 5 years ago

Did you manage to solve the issue without turning off the basic scaling?