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

Add ability to scale Ephemeral storage along with memory, similar to CPU #5008

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

mcdan
Copy link
Member

@mcdan mcdan commented Oct 21, 2020

Building on setting a simple limit for k8s ephemeral storage this introduces another config setting to also allow scaling the storage based on the memory.

Description

Along with CPU it seems reasonable action developers may need more disk as their actions use more and more memory. Ideally, we'd start to tease all this apart to allow developers to request a variety of resources but this simply creates a similar setting as CPU to allow the disk capacity to stretch along with memory.

Related issue and scope

  • I opened an issue to propose and discuss this change (#????)

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@@ -108,7 +108,12 @@ class WhiskPodBuilder(client: NamespacedKubernetesClient, config: KubernetesClie
.getOrElse(Map.empty)

val diskLimit = config.ephemeralStorage
.map(diskConfig => Map("ephemeral-storage" -> new Quantity(diskConfig.limit.toMB + "Mi")))
.map(diskConfig =>
if (diskConfig.scaleFactor > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can diskConfig.scaleFactor be null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't think null was a valid value for a Double but, maybe I'm mixing up languages. Will test thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on KubernetesEphemeralStorageConfigsig it should not be null, but technically it might be possible; If null was allowed, it should be Option[Doube]; I would leave it as is

Copy link
Member

@dgrove-oss dgrove-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks reasonable to me.

.map(diskConfig => Map("ephemeral-storage" -> new Quantity(diskConfig.limit.toMB + "Mi")))
.map(diskConfig =>
if (diskConfig.scaleFactor > 0) {
Map("ephemeral-storage" -> new Quantity(diskConfig.scaleFactor * memory.toMB + "Mi"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should still be a limit - i.e. use the scale factor unless the result is > some limit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair critique. Will do that and adjust the docs.

@style95 style95 added the stale old issue which needs to validate label May 31, 2023
@style95 style95 merged commit b9f16dc into master Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale old issue which needs to validate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants