Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 Apps do not get the proper amount of memory for staging #1802

Closed
46bit opened this issue Aug 24, 2020 · 2 comments
Closed

V3 Apps do not get the proper amount of memory for staging #1802

46bit opened this issue Aug 24, 2020 · 2 comments
Labels

Comments

@46bit
Copy link
Contributor

46bit commented Aug 24, 2020

Issue

When apps are staged using the V3 API they are staged with only 1GB of memory, even if a higher limit is configured in the app manifest.

By contrast, apps staged via the V2 API are staged with however much memory is specified in their manifest (or 1GB, whichever is greater.)

Context

One of our tenants switched to the V7 CLI and discovered their app would no longer stage. It hit an Out Of Memory error when staging. But it still worked with the V6 CLI.

An additional issue: I tried working around that behaviour by increasing the platform-wide dea_next.staging_memory_limit_mb property, but it only worked the first time a new V3 app was staged.

I tried writing a failing test to demonstrate this but I don't understand the codebase enough to do that.

Steps to Reproduce

We will show that an app requiring lots of memory to stage cannot be staged with V3 but can with V2:

  1. Push https://github.com/ihuston/python-cf-examples/tree/master/01-simple-python-app with the V7 CLI. It should deploy fine.
  2. Add tensorflow==2.3.0 to its requirements.txt file. Also increase the memory limit in the manifest (e.g., to 8GB.)
  3. Push the app again. It should fail with Out Of Memory error when staging.
  4. Try pushing the app with the V6 CLI (using V2 API endpoints.) It stages fine.

By looking at the cgroups when the app was staging I could see the memory limit was only 1GB when using the V7 CLI, even though the manifest specified a lot more memory than that.

Expected result

The behaviour should match between the V2 and V3 APIs. Unless there's been a drastic decision to cap staging memory to 1GB, V3 should match the V2 behaviour and allow the manifest to configure more than 1GB of staging memory.

Current result

Apps requiring more than 1GB of memory for staging cannot be pushed with the V3 API. This causes problems for some of our users.

Possible Fix

VCAP::CloudController::V2::AppStage configures staging_memory_in_mb and staging_disk_in_mb onto BuildCreateMessage. This is then passed into a LifecycleProvider and then on to BuildCreate.

By contrast the V3 code doesn't appear to configure staging_memory_in_mb or staging_disk_in_mb anywhere. My best guess is that this issue will be fixed by configuring those properties like the V2 code did.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174473957

The labels on this github issue will be updated when the story is started.

@Gerg
Copy link
Member

Gerg commented Oct 16, 2020

Thanks for surfacing this issue! This was addressed in d9d1114 and released in https://github.com/cloudfoundry/capi-release/releases/tag/1.100.0.

@Gerg Gerg closed this as completed Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants