Skip to content

Dagger build - resource requests/limits #4196

Closed

Description

@RealHarshThakur

What are you trying to do?

I'd like to set resource limits to build calls made to Dagger API.

Why is this important to you?

Having build resource limits will prevent abuse of the shared Dagger/Buildkit cluster we maintain

How are you currently working around this?

Not working around it currently.
Thanks to @sipsma pointing out that Buildkit already supports this so it would be something that Dagger API needs to support. https://discord.com/channels/707636530424053791/1050849192240750603/1050904512380026890

Activity

  1. shykes commented on Dec 15, 2022

    @shykes
    Contributor

    @RealHarshThakur what are your multi-tenancy requirements? Is your cluster shared internally to your team, or actually available by customers? In other words how much do you trust your tenants, and how much do they trust each other?

  2. RealHarshThakur commented on Dec 15, 2022

    @RealHarshThakur
    Author

    It would be for customers so don't really trust people using it. Having noisy neighbors is something that is acceptable for the most part. A resource limit would be a safeguard against someone who's trying to consume all the infra resources for themselves.

  3. shykes commented on Dec 15, 2022

    @shykes
    Contributor

    @sipsma can comment further, but I don't believe buildkit can be safely used in a multi-tenant way if tenants don't trust each other. It's reasonably sandboxed, but I wouldn't bet a customer's data on that. For example we run our API playground on a shared buildkit, but are very clear with users that they should not use it for anything critical, and they should not upload sensitive credentials or assets either.

    This doesn't invalidate the need limits to avoid noisy neighbour, since solving that problem is useful even between tenants that trust each other. But I thought it would be useful context nonetheless.

  4. RealHarshThakur commented on Dec 15, 2022

    @RealHarshThakur
    Author

    I wouldn't bet a customer's data on that.

    Oh, can you please expand more on that? What would be the attack surface? Some sort of cache reuse attacks?

  5. mircubed commented on Nov 19, 2024

    @mircubed
    Contributor

    @jedevc does your PR solve this? #8800

    We had a few commanders and a customer run into this issue.

  6. jedevc commented on Nov 20, 2024

    @jedevc
    Contributor

    @mircubed #8800 is just about allowing configuring existing options that today are configured through a different mechanism - it doesn't yet add any additional controls (but when we do add them, we would do so through the new engine.json mechanism it introduces).

    Oh, can you please expand more on that? What would be the attack surface? Some sort of cache reuse attacks?

    Yeah, buildkit's cache isn't separated per incoming user - it's shared across an entire instance. Essentially, if you can predict the graphql that a user made, you can also fetch results that the user got.

    I'd like to set resource limits to build calls made to Dagger API.

    I do really like this idea generally though, I think we should do it. Even on a personal computer, it can be annoying when different jobs consume huge amounts of resources, and slows down my web browser or text editor - it would be nice to be able to easily cap it.

  7. jedevc commented on Nov 20, 2024

    @jedevc
    Contributor

    In the original discord thread, the WithCgroupParent was mentioned - I think that's probably the right place to start?

    Not entirely what level of granularity we'd want - I think it probably makes sense for the client to set session-wide cgroup limits (we probably don't want modules to have that level of machine-specific granular control over their WithExecs, but maybe there's a use case).

    In terms of how to configure it: I think we'd want something like #9007.

  8. locked and limited conversation to collaborators on Mar 24, 2026
  9. converted this issue into a discussion #12529 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions