Skip to content

✨ support RUN --mount=type=cache #4301

Closed

Description

@robertu94

What are you trying to do?

I want to test if my app's code works on several Linux distributions using the system dependencies (I.e. dnf/apt). For these, I don’t have a lock file per se, and If I did I wouldn’t want one — I want the cache to invalidate as soon as apt or dnf says there is a newer version. In docker I would use something like mount-type=cache=locked https://docs.docker.com/engine/reference/builder/#run---mounttypecache

More info and context on discord

Why is this important to you?

My application is a moderate to small c++ code with a bunch of dependencies (200MB-8GB depending on configuration). Depending on which ones and how many downloading or building these can take between minutes to hours so caching is critical.

I use the python SDK because I and my team know Python 😄

How are you currently working around this?

I don't use dagger now, but am excited to use this. Before this, a host volume could be mounted for the APT cache, but this can be tedious and error prone if multiple containers are trying to use it simultaneously.

Activity

  1. helderco commented on Jan 4, 2023

    @helderco
    Contributor

    This is not Python specific, any API changes will be picked up by all SDKs automatically. So this is an engine request.

  2. changed the title [-]✨ support RUN --mount=type=cache in the Python SDK[/-] [+]✨ support RUN --mount=type=cache[/+] on Jan 4, 2023
  3. aluzzardi commented on Jan 5, 2023

    @aluzzardi
    Contributor

    /cc @jlongtine who picked up the "long tail" of supporting the entire API

  4. grouville commented on Jan 17, 2023

    @grouville
    Member

    @samalba @aluzzardi, can we bump this as a P1 ? I'll take it, as it's shouldn't be too hard

  5. self-assigned this
    on Jan 17, 2023
  6. shykes commented on Jan 21, 2023

    @shykes
    Contributor

    I may be missing something, but isn't this already supported with cache volumes? Under the hood they work exactly the same as RUN --mount=type=cache.

  7. robertu94 commented on Jan 21, 2023

    @robertu94
    Author

    It's the locking bit that I need so the cache doesn't become corrupted

  8. shykes commented on Jan 21, 2023

    @shykes
    Contributor

    Ah! Of course. Sorry for missing that. Indeed should be trivial to add.

  9. grouville commented on Jan 25, 2023

    @grouville
    Member
    Using this issue as source of truth

    Putting this issue as stuck for the moment being, even though I hope it can be closed by end of week.

    What is blocking

    A pending PR implements this behavior: #4437.
    It works for GraphQL queries, but breaks at the codegen level.

    Context
    I relied on an enum graphQL type to benefit from autocompletion when providing the cache sharing mode.
    However, none of our codegens implement this type.

    What are the next steps

  10. grouville commented on Feb 8, 2023

    @grouville
    Member

    Closed by #4437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/enginekind/user-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions