How to debug GAE compiler?

127 views
Skip to first unread message

Mihai B

unread,
May 25, 2016, 5:52:25 AM5/25/16
to google-appengine-go
What compiler does GAE use? I have an application which compiles locally(i.e. goapp serve works) but fails on deployment 

12:48 PM Getting current resource limits.
12:48 PM Scanning files on local disk.
12:48 PM Cloning 275 application files.
12:48 PM Compilation starting.
12:48 PM Compilation: 254 files left.
12:48 PM Error 422: --- begin server output ---
Compile failed:
2016/05/25 02:48:42 go-app-builder: build timing: 98×compile (27.491s total), 0×link (0 total)
2016/05/25 02:48:42 go-app-builder: failed running compile: exit status 255
--- end server output ---
12:48 PM Rolling back the update.
Error 422: --- begin server output ---

--- end server output ---
, exit status 1


app.yaml :

application: **myapp
runtime: go
version: ""0-6-0-missing-build-no"
module: default
api_version: go1
handlers:
- script: _go_app
  secure: always
  url: /.*


- Mihai.

Mihai B

unread,
May 25, 2016, 5:54:02 AM5/25/16
to google-appengine-go
$ goapp version
go version go1.6.1 (appengine-1.9.37) darwin/amd64

Mihai B

unread,
May 25, 2016, 6:44:17 AM5/25/16
to google-appengine-go
After some investigation I've found the issue is due the combined size of the files. I think the remote GAE builder doesn't have enough memory thus the reason why it fails to deploy. Is there any way to change that?   To reproduce it I've generated some files with data embedded (e.g. map[string]string). After it reaches about 30 - 40 MB the deployment fails even if in app.yaml is specified an F4_1G instance. I think the builder should support the instance class defined in yaml or at lest should have more decent limits. 

$ ls -lha | awk '{print $5, $6, $7, $9}'
   
578 May 25 .
102 May 25 ..
442 May 25 .git
14 May 25 .gitignore
175 May 25 app.yaml
12M May 25 bingen_android.go
12M May 25 bingen_android2.go
4.5M May 25 bingen_desktop.go
3.5K May 25 bingen_favicon.ico.go
2.6M May 25 bingen_tablet.go
136 May 25 build
567 May 25 edoc.json
66 May 25 ek_config.json
2.1K May 25 init_gen.go
528 May 25 main.go
5.3K May 25 main.json
272 May 25 vendor

bash-3.2$ du -sh
86M .



- Mihai.

Adam Tanner

unread,
May 31, 2016, 4:57:37 PM5/31/16
to google-appengine-go
The standard Go runtime has a hard max limit on total binary size of 32MB, which is fairly large for a Go app. Based on the ls output you posted it looks like you may be using a tool similar to go-bindata or statik to bundle binary blobs into your application? I would recommend against doing that for App Engine applications as App Engine already has support for serving static files directly (static_dir and static_files in app.yaml).

Mihai B

unread,
Jun 1, 2016, 11:43:29 AM6/1/16
to google-appengine-go
Hi Adam, 

Thanks for your help. It would nice to have this limitation documented somewhere. I was aware of 32MB max limit for a single static file but not for the app binary. After several hours I ended-up encoding the data in json files/chunks and I load it on initialisation which just slows the application compared with a generated binary. App Engine static server is nice but it has its own drawbacks:
  - it's less powerful -  e.g. You can't do UA sniffing. This is the main reason why I'm not using it. 
  - it's slower - can't be faster than in-memory 
  - more fragmentation - you have your routes split between GAE yaml config and the app router
  - less portability - you can't move it off GAE


Mihai.
Reply all
Reply to author
Forward
0 new messages