Bigger app sizes with Cloud SDK than with AppCfg

253 views
Skip to first unread message

DIEGO GARCIA TEBA

unread,
Jan 28, 2020, 1:14:05 PM1/28/20
to Google App Engine
Hi,

I'm experiencing that deploying with Cloud SDK Maven Plugin is generating bigger apps than deploying with AppCfg. I've seen that inside target directory, a folder named "appengine-staging" is generated. I don't know if this is the cause of the file increment.

Anyone has the same behaviour?

Thanks in advance!

Regards,
Diego

Thomas Becker

unread,
Jan 28, 2020, 4:54:03 PM1/28/20
to Google App Engine
I am experiencing the same behavior. Everything seems to work well both ways, and yet, it would be nice to know what causes the difference.

Thomas

Blaine Garrett

unread,
Jan 28, 2020, 7:19:59 PM1/28/20
to Google App Engine
I am not familiar with the plugin, but is there an intermediate build additionally going on as part of CI/CD? You might be deploying the files needed for the build as well as the built files.

With my production node applications, I do a two step build and deploy to ensure unit tests pass before deploying. This triggers a cloud build independent of the cloud build for deploying (this might be node specific). Initially, I was deploying both the final build files as well as the src files needed to build in the first place. To get around this, I copied a separate deploy specific gcloudignore file in place upon successful run of tests right before deploying. This then skipped all src files that were otherwise needed to do the initial test build.

George (Cloud Platform Support)

unread,
Jan 29, 2020, 11:35:58 AM1/29/20
to Google App Engine
Hello Diego, 

The directory called "appengine-staging" is required, and created by default. You are able to modify its location using the stagingDirectory parameter of the appengine:deploy goal. It is the directory to which to stage the application. Default is ${project.build.directory}/appengine-staging. Related details are to be found on the "App Engine Maven Plugin Goals and Parameters" documentation page

How did you determine that the Maven plugin generates bigger apps? 

DIEGO GARCIA TEBA

unread,
Jan 30, 2020, 2:19:48 AM1/30/20
to Google App Engine
Hi George,

I've updated from the deprecated AppCfg to Apache Maven Cloud SDK based plugin. When I did it, the same app with the same dependencies have a different size. I'm attaching a screenshoot.

Any idea?

Regards,
Diego
Captura de pantalla 2020-01-30 a las 8.16.09.png

Olu

unread,
Jan 30, 2020, 2:21:20 PM1/30/20
to Google App Engine
Hi, Diego

There are a number of reasons that could account for the change in the Application size. In fact, there was a similar report in the past where the size of the application version using the Maven CloudSDK plugin actually was found to be lesser compared to the version from AppCfg. To evaluate specifically your version, I suggest you open an issue[1], with which a Support Engineer would be able to review your project and evaluate the specific App Engine versions to determine exactly what may be causing the difference in sizes for your application.

DIEGO GARCIA TEBA

unread,
Jan 31, 2020, 2:41:53 AM1/31/20
to Google App Engine
Thanks Olu!

I'll do it.

Regards,
Diego

Ludovic Champenois

unread,
Jan 31, 2020, 1:03:45 PM1/31/20
to google-a...@googlegroups.com

There is only 1 staging logic, inside appcfg tooling, which is used (as is) in the cloud SDK, so staging is technically the same.

In appcfg, it uses a temporary directory (deleted at the end unless you use a flag to retain the upload dir).

In cloud SDK and new plugins, the default location is visible to the customer (appengine-staging) and can be overwritten via a flag.

There is no reason at all I understand about why app size would differ based on the tooling. Maybe different default flags in compilers?

If you have a specific project that shows this behavior, I am all ears.

Ludo

--
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/b1024ee7-3f1b-475c-b89f-6c0696467acd%40googlegroups.com.
Message has been deleted

noverlyjoseph

unread,
Feb 3, 2020, 11:43:55 AM2/3/20
to Google App Engine

Hi Diogo,


I can see the support case you’ve opened is already being investigated. If you do have more general questions regarding this, you can follow up on here, otherwise communication will continue on the support case you’ve opened.


DIEGO GARCIA TEBA

unread,
Feb 4, 2020, 2:56:30 AM2/4/20
to Google App Engine
Thanks!

I'll share with the forum conclusions.

Regards,
Diego

DFB

unread,
May 30, 2020, 2:23:09 PM5/30/20
to Google App Engine
Diego, 

What was the conclusion? I'm seeing a similar issue.

Aref Amiri (Cloud Platform Support)

unread,
Jun 3, 2020, 11:35:16 AM6/3/20
to Google App Engine
Based on a discussion with an App Engine Specialist, the difference in size comes from the way each tool works. Cloud SDK uses Cloud Build in the background and containerizes the deployment along with the runtime selected ( i.e Java8 ), making the deployment itself bigger. On the other hand, AppCfg deploys the code and then uses the desired runtime directly from the repository, therefore making the deployment smaller.

DFB

unread,
Jun 3, 2020, 11:41:39 AM6/3/20
to Google App Engine
Thank you, Aref. It makes sense.

I noticed that when I go from maven-app-engine plugin v1.3.2 to v2.2.0, that's when the size increases. So has the plugin switched from using AppCfg to Cloud Build?

Aref Amiri (Cloud Platform Support)

unread,
Jun 4, 2020, 11:44:47 AM6/4/20
to Google App Engine
AppCfg is deprecated now and it is recommended to use gcloud command line which uses Cloud Build to build the app into a container and deploy the container to the runtime.

DFB

unread,
Jun 4, 2020, 12:08:41 PM6/4/20
to Google App Engine
My builds are done using aappengine-maven-plugin, which internally uses gcloud.

Olu

unread,
Jun 5, 2020, 8:43:27 AM6/5/20
to Google App Engine
@DFB, where did you get the information that appengine-maven-plugin uses gcloud internally? Did you see that on any article? This GCP doc[1] has no such information. 

AFAIK, as per this comment, there is "gcloud beta" which has been implemented within the Maven App Engine plugin, which can be used by replacing the following code in the pom.xml file:

<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>appengine-maven-plugin</artifactId>
  <version>2.1.0</version>
  <configuration>
    <gcloudMode>beta</gcloudMode>
     ...
  </configuration>
</plugin>
 

Is this what you are doing? I have no information suggesting that the appengine-maven-plugin uses gcloud under the hood. 


DFB

unread,
Jun 5, 2020, 8:52:11 AM6/5/20
to Google App Engine
@Olu

I also saw references to gcloudMode on their Github project.

I don't use AppCfg or gcloud directly for builds. I use the appengine-maven-plugin and invoke 'mvn package appengine:deploy' to build and deploy the app. Can someone explain to me what is causing the deployed application size to increase when I change the plugin from v1.3.2 to v2.2.0?

Elliott (Cloud Platform Support)

unread,
Jun 8, 2020, 5:34:40 PM6/8/20
to Google App Engine
Hello,

Google Groups is meant for general discussions about Google products. It seems you want to get help with something that is not working as you expect. In this case, I recommend using Google Issue Tracker, where the request could become private so that you can share project information.
Reply all
Reply to author
Forward
0 new messages