Skip to content

Support arbitrary local dirs in new API  #3201

Closed

Description

@sipsma

Equivalent of {host { dir(id:...) { ... }}} in old API

Activity

  1. shykes commented on Sep 30, 2022

    @shykes
    Contributor

    Equivalent of {host { dir(id:...) { ... }}} in old API

    I think we should consider dropping support for host directories beyond workdir. I'm sure there will be complaints, but my feeling is that most users won't need it, and it would make our life easier in the short term not to worry about it.

    wdyt?

  2. sipsma commented on Sep 30, 2022

    @sipsma
    ContributorAuthor

    @shykes This was brought up as a need by @jlongtine for backwards compatibility.

    Besides that I'm totally fine with starting w/out this API as I agree it providing it opens lots of tricky questions around security and such.

    I can't immediately think of how to implement the old europa client API without this, but I also can barely remember many details of europa anymore so maybe I'm missing something.

    I suppose it's technically possible to make europa a special case and give it some undocumented way of accessing this ability; but there's no way we can 100% hide it from others, only make it obscure, so someone will eventually find it and make use of it.

    Worth more thought

  3. jlongtine commented on Sep 30, 2022

    @jlongtine
    Contributor

    _#clientFilesystemRead and core.#Source will be impossible to port without this, FWIW. Which will break much of universe.dagger.io, which will also impact a decent number of the dagger.#Plans out there.

  4. shykes commented on Sep 30, 2022

    @shykes
    Contributor

    Ah you're right, I didn't think of Europa compat.

    I think we should do a first pass where Classic returns an error when the plan requests an absolute path in client: filesystem. I believe most real-world plans use relative paths, which map well to workdir in cloak.

    I say we ship this version, wait for feedback, then decide what to do based on the feedback. If nobody complains (high likelihood IMO) then the problem takes care of itself.

    cc @jlongtine

  5. shykes commented on Sep 30, 2022

    @shykes
    Contributor

    _#clientFilesystemRead and core.#Source will be impossible to port without this, FWIW. Which will break much of universe.dagger.io, which will also impact a decent number of the dagger.#Plans out there.

    • _#clientFilesystemRead with absolute path: yes that will break
    • _#clientFilesystemRead with relative path: that can be implemented with workdir
    • core.#Source: OK that I don't know how to deal with.
  6. sipsma commented on Sep 30, 2022

    @sipsma
    ContributorAuthor

    core.#Source is from under cue.mod right? I'm 99% sure the answer is no, but is there any way of recreating the contents of cue.mod inside buildkit without loading them from the localdir? Can we redownload them directly inside buildkit?

    This is obviously awful in terms of performance, but I have to ask in case it's an option.

  7. jlongtine commented on Oct 3, 2022

    @jlongtine
    Contributor
    • _#clientFilesystemRead with absolute path: yes that will break

    💯

    • _#clientFilesystemRead with relative path: that can be implemented with workdir

    This is only true if the relative path we are given is under the current workdir. All other cases, such as ../src, won't work.

    • core.#Source: OK that I don't know how to deal with.

    I think it's a similar problem to the relative path. It could work if they're running from the root of the cue.mod, but not anything else. Also... not allowing our users the ability to give us focused directories to upload to Buildkit could get rather expensive. Lots of cache busting.

    core.#Source is from under cue.mod right? I'm 99% sure the answer is no, but is there any way of recreating the contents of cue.mod inside buildkit without loading them from the localdir? Can we redownload them directly inside buildkit?

    core.#Source isn't exclusive to cue.mod, no. You could have a folder as a part of your current module that held reusable components. Also, the user could have made changes to the cue.mod, which they would expect to be in the loaded CUE.

    We tried to see if we could get away with not providing this ability in Europa, and came to the conclusion that didn't really have the option. I don't think we're getting out of needing this API.

  8. vito commented on Oct 12, 2022

    @vito
    Contributor

    Done via #3304

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions