Consistently use bytes for memory statistics

For some reason, stat_collector assumed rss was reported in kilobytes
instead of bytes and multiplied it by 1024.  The rest of the code then
started to divide the 'used_memory_in_bytes' by 1024 to really get bytes
back.  Very odd.

This change simply removes the hacks that multiply and divide to get
expected data.
Make memory reported match cgroup usage data

The DEA was reporting 'used_memory_in_bytes' as the RSS returned from
warden.  RSS, however, is not what cgroup uses when checking container
memory limits so it's inappropriate memory statistic to report to end
users via cf stats.

The Linux cgroup implementation reports container memory usage in
memory/memory.usage_in_bytes and calculates this by adding
memory/memory.stat:cache and memory/memory.stat:rss so this change will
introduce the same logic to the DEA.  Instead of using cache and rss,
however, total_rss and total_cache will be used as it accounts for child
containers when present.
Update Java Buildpack

This change updates the Java buildpack submodule to version 2.0
Version 2.0 includes the following improvements:

* Output detection changes[1]
* Play Framework 2.2 support
* Spring Insight support[2]
* New Relic zero-touch support now works with user-provided services
  in addition to platform provided services[3]
* AppDynamics support[4]
* New abstractions and test support for building components
* Automatic download of MariaDB and PostgreSQL drivers

[1]: https://github.com/cloudfoundry/java-buildpack/commit/be124ef5a40fdc5e155a93f3f700410bd5687fc6
[2]: https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-spring_insight.md
[3]: https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-new_relic_agent.md#user-provided-service-optional
[4]: https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-app_dynamics_agent.md
Save warden job id to snapshot after staging task was spawned

Signed-off-by: Kris Kelly <kkelly@pivotallabs.com>
Don't emit staging output to loggregator

  * Since DEA logging agent is now listening to container sockets we don't need to emit them twice

[#63400876]
Fix flaky test: regenerate droplet sha1 in start message on every call

  * Starting message sometimes contained sha1 calculated before the app was staged.
This introduced flakiness in running_app_spec.
Newer versions of Vagrant are ok

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Update bcrypt to work with new heroku buildpack

[#63634414]

Signed-off-by: Michael Maximilien <maxim@us.ibm.com>
Assert that HTTP_PROXY is conveyed to staging env

[#63634414]

Signed-off-by: Michael Maximilien <maxim@us.ibm.com>
Update README.md

Must cd into the dea_ng directory before trying to submodule update.
Stop when shelling out fails

Signed-off-by: Michael Maximilien <maxim@us.ibm.com>
Switch back to latest, vanilla Heroku nodjs buildpack

[#63634414]

Signed-off-by: Michael Maximilien <maxim@us.ibm.com>
Only save logs after crash

Signed-off-by: Maria Shaldibina <mariash@pivotallabs.com>
Fix unit tests

Signed-off-by: Phan Le <ple@pivotallabs.com>
Copy the contents of logs folder only (not the logs folder itself)
Fix test that failed within a vagrant VM

Signed-off-by: Phan Le <ple@pivotallabs.com>
Merge branch 'used-is-rss-plus-cache' of https://github.com/sykesm/dea_ng into sykesm-used-is-rss-plus-cache

Signed-off-by: Michael Maximilien <maxim@us.ibm.com>

Conflicts:
	lib/dea/starting/instance.rb
	lib/dea/stat_collector.rb
	spec/unit/starting/instance_spec.rb
	spec/unit/stat_collector_spec.rb
Only update routes for instances that are running

If an update message is processed by a an instance that is not in the
proper state, a router registration message may get published with port
0 as the target port.  This is, obviously, unreachable. :)

This change will prevent updates to app instances that aren't in an
appropropriate state.  When app update messages are skipped because of
incorrect state, the app instance version remains at the old level so
the health manager can detect the problem and correct it.
Refactor instance uri update

Signed-off-by: Phan Le <ple@pivotallabs.com>
Add support for build pack branches

Add support for build pack branches
Fix test case to support proper URIs

Add Shell escaping back

Move git commands to its own class

Add integration tests

Signed-off-by: Abhijit Hiremagalur <abhi@pivotallabs.com>
Signed-off-by: Ruth Byers <rbyers@pivotallabs.com>