cloudfoundry-attic / multi-buildpack

Cloud Foundry buildpack for running multiple buildpacks
Apache License 2.0
12 stars 14 forks source link

Exceeding buildpack max_package_size #3

Closed richard-cox closed 7 years ago

richard-cox commented 7 years ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

"api_version": "2.84.0", cf version 6.26.0+9c9a261.2017-04-06

What version of the buildpack you are using? v0.2.4

If you were attempting to accomplish a task, what was it you were attempting to do? Execute cf push on an application (https://github.com/SUSE/stratos-ui, see https://github.com/SUSE/stratos-ui/tree/master/deploy/cloud-foundry for deploy instructions) that uses the multi-buildpack and the following individual buildpacks

buildpacks:
  - https://github.com/cloudfoundry/go-buildpack
  - https://github.com/cloudfoundry/nodejs-buildpack
  - https://github.com/cloudfoundry/binary-buildpack

What did you expect to happen? Application push successfully completes

What was the actual behavior? Application push fails due to 'Disk quota exceeded' errors, for example

2017-08-23T17:07:33.29+0100 [STG/0] ERR cp: cannot create directory ‘/tmp/contents284822944/app/node_modules/gulp-angular-templatecache’: Disk quota exceeded

This will occur at different times per attempt, it seems that max_package_size is being exceeded when it was not before. Unfortunately I can't supply which version of the multi-buildpack or individual buildpack which caused this. However I can say rolling back to ...

buildpacks:
  - https://github.com/cloudfoundry/go-buildpack#v1.8.4
  - https://github.com/cloudfoundry/nodejs-buildpack#v1.6.0
  - https://github.com/cloudfoundry/binary-buildpack

Shows the issue more succinctly. With the above configuration and the default max_package_size of 1GB cf push will always fail before any application specific code is executed.

The logs show that GO is downloaded three times

-----> Download go 1.8.1
-----> Running go build compile
-----> Multi Buildpack version 0.2.4
-----> Running buildpacks:
       https://github.com/cloudfoundry/go-buildpack#v1.8.4
       https://github.com/cloudfoundry/nodejs-buildpack#v1.6.0
       https://github.com/cloudfoundry/binary-buildpack
-----> Download go 1.8.3
-----> Running go build supply
-----> Go Buildpack version 1.8.4
-----> Installing godep v79
       Download [https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v79-linux-x64-9e37ce0f.tgz]
-----> Installing glide v0.12.3
       Download [https://buildpacks.cloudfoundry.org/dependencies/glide/glide-v0.12.3-linux-x64-aa256363.tgz]
-----> Installing go 1.8.3
       Download [https://buildpacks.cloudfoundry.org/dependencies/go/go1.8.3.linux-amd64-32ec5ac6.tar.gz]
-----> Download go 1.8.1
-----> Running go build supply
-----> Nodejs Buildpack version 1.6.0
-----> Installing binaries
       engines.node (package.json): 6.x.x
       engines.npm (package.json): unspecified (use default)
-----> Installing node 6.11.0
       Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-6.11.0-linux-x64-2c8100a9.tgz]
       Using default npm version: 3.10.10
-----> Installing yarn 0.24.6
       Download [https://buildpacks.cloudfoundry.org/dependencies/yarn/yarn-v0.24.6-156eb82f.tar.gz]
       Installed yarn 0.24.6
-----> Creating runtime environment
-------> Buildpack version 1.0.14
cp: error writing ‘/tmp/contents624226720/app/tmp/src/golang.org/x/net/http2/go18.go’: Disk quota exceeded

So it seems something has changed and there's now a much greater disk impact which is forcing the build to exceed the max (default) 1GB size limt.

My real question here is has anything changed in the multi-buildpack that would facilitate an increase in size? Can anything be done to mitigate

Please confirm where necessary:

sclevine commented 7 years ago

Hi @richard-cox,

The max_package_size[1] Cloud Controller property limits the size of the application before staging, not after staging. The disk quota you're exceeding is the staging disk quota (confusing called dea_next.staging_disk_limit_mb[2], even for Diego), which default to 4GB.

The repeated downloads of Go are due to your use of Github repo URLs in multi-buildpack.yml. Go is required to compile each buildpack when an unpackaged repo URL is specified. If you use URLs to the zip files in the buildpack Github releases instead, Go won't be downloaded for each buildpack. That said, Go is only 271MB uncompressed, and it is overridden for each buildpack run.

I suspect your issue is due to pushing a large app, or due to a custom value of dea_next.staging_disk_limit_mb that is lower than 4GB.

[1] cloud_controller_ng/spec#L366 [2] cloud_controller_ng/spec#L663