Skip to content

0.2: last call for CUE API changes #1650

Closed

Description

@shykes

Overview

This issue tracks final changes to our CUE APIs before the 0.2 release. This includes:

  • universe.dagger.io
  • dagger.io

Realistically, Universe will not be finished or even fully stabilized, before the release. But we should try to pick as many low-hanging fruits as possible, to minimize future pain.

Changes

To propose a change, or ask about its status, please post a comment. If you're not sure if the change is relevant to this issue, post it anyway.

Activity

  1. helderco commented on Feb 23, 2022

    @helderco
  2. self-assigned this
    on Feb 24, 2022
  3. shykes commented on Feb 24, 2022

    @shykes
    ContributorAuthor

    Thanks, I added those to the list.

    I haven't created an issue because I wanted to do investigate a bit and be more informed, but I think we need to check the usage around different combinations of having entrypoint, cmd, shell and argsescaped in the image config (in docker.#Run).

    There's also an idea of simplifying docker.#Run internally with dagger.#Set, which has a small chance of changing the API, although I don't think it will be necessary.

    Yes, I agree the new docker is important enough to deserve its own "last call" issue. I will create a placeholder and link to it from here.

  4. dubo-dubon-duponey commented on Feb 25, 2022

    @dubo-dubon-duponey
    Contributor

    Super exciting to see 0.2 coming along ❤️

    Just took a brief look at the source - here are some quick comments (hope I did not misunderstand something obvious).

    image:

    • couldn't find a way to #Pull an image for a specific platform
    • where to pass secrets that are used inside a Dockerfile on #Dockerfile (eg: RUN --mount=type=secret) - more generally, how do you pass mounts to #Dockerfile?
    • how to specify cache_to, cache_from on #Dockerfile
    • platforms is here on #Dockerfile but I do not understand how that would work (or for #Push for that matter) - then looking at Multi-platform containers #1371 makes me wonder if it's implemented at all? Maybe it's not part of the Europa milestone then (it would very likely impact the CUE API right?)

    docker:

    • at some point there was code to start containers on remote docker hosts (based on a wrapper around docker cli IIRC) - looks like #Run is now purely based on #Exec which doesn't seem to allow that anymore - maybe I missed something? or was the previous component removed from universe?
    • #Run seems to be missing a number of useful features (devices, group_add, caps, network, ...)

    Random other:

  5. shykes commented on Feb 25, 2022

    @shykes
    ContributorAuthor

    Good to see you back in the neighborhood @dubo-dubon-duponey :) As usual thank you for the detailed feedback, it is very appreciated.

    image:

    • couldn't find a way to #Pull an image for a specific platform

    It's planned but not yet implemented.

    • where to pass secrets that are used inside a Dockerfile on #Dockerfile (eg: RUN --mount=type=secret) - more generally, how do you pass mounts to #Dockerfile?

    If you don't see it, it's probably not implemented. But if it's a pass-through to buildkit or its dockerfile frontend, it's pretty easy to add. Perhaps a PR? 😇

    • how to specify cache_to, cache_from on #Dockerfile

    I'm guessing that's a client-side flag of the docker command-line? This one will probably require more design discussion.

    • platforms is here on #Dockerfile but I do not understand how that would work (or for #Push for that matter) - then looking at Multi-platform in Europa #1371 makes me wonder if it's implemented at all? Maybe it's not part of the Europa milestone then (it would very likely impact the CUE API right?)

    Yes correct, we want to implement it very much, but it's a beast of a design, we want to get it right, and had to prioritize to get 0.2 out. It's a high priority for 0.2.x

    • at some point there was code to start containers on remote docker hosts (based on a wrapper around docker cli IIRC) - looks like #Run is now purely based on #Exec which doesn't seem to allow that anymore - maybe I missed something? or was the previous component removed from universe?

    It was removed from universe but we plan on adding it back, possibly under universe.dagger.io/docker/client. We've deprioritized it in favor of implementing Docker features directly on top of buildkit. This will be better experience for 90% of developpers. Assuming you're in the remaining 10%, maybe we can collaborate on getting docker/client in as soon as possible :)

    • #Run seems to be missing a number of useful features (devices, group_add, caps, network, ...)

    If buildkit supports it, we can easily add it to dagger.#Exec and from there, to docker.#Run. If it's a feature specific to Docker engine, which buildkit has no equivalent for, then it will have to wait for docker/client and we will gladly collaborate with you to get it in.

    Thanks for filing!

  6. helderco commented on Mar 24, 2022

    @helderco
    Contributor

    @shykes, you mentioned a redesign for docker.#Run command composition in:

    Do you have any ideas on that?

  7. shykes commented on Mar 24, 2022

    @shykes
    ContributorAuthor

    @shykes, you mentioned a redesign for docker.#Run command composition in:

    Do you have any ideas on that?

    I don't have a precise idea, but my brain started pattern-matching in the background, based on various inputs:

    • The need to wrap a low-level command into a higher-level command. For example aws.#CLI that wants to expose subcommands of the aws command as if they were top-level commands.
    • Combining multiple commands in the same container, or independently of a specific container, is not possible. For example bash.#Run (command spec where you can bring your own container) is very useful, but what if I want the same thing with several commands? I have no choice but to merge then into a shell script for example.
    • You can't manipulate a docker command without running it.
    • docker.#Run and docker.#Image have a lot of similar fields, but they are completely different schemas. That feels like it could be improved in some way. Perhaps even the distinction between "image" and "container" the way they are defined in the docker engine, is becoming obsolete? For example there are several projects that argue that the "image" as a static artifact is not important, an implementation detail. You specify what you want to run, and it is assembled and run for you, on demand. See for example the "nixery" registry, a project by @fermayo the name of which eludes me right now, and more recently blog posts by the apko/alpine maintainer.
    • It's not just docker that needs a concept of command. Maybe we can define a portable abstraction for a command, and reuse it across implementations. For example there is the client.command schema which is very similar to docker.#Run but not quite. I'm sure ssh will need one as well; etc.
    • In a way, you could see a docker image 1) a rootfs + 2) a default command + 3) optionally an entrypoint command

    Like I said - just pattern matching at this stage.

  8. fermayo commented on Mar 24, 2022

    @fermayo
    Contributor

    a project by @fermayo the name of which eludes me right now

    ctr.run (currently shut down)

  9. shykes commented on Mar 24, 2022

    @shykes
    ContributorAuthor

    a project by @fermayo the name of which eludes me right now

    ctr.run (currently shut down)

    Thanks :) And hi!

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

Metadata

Metadata

Assignees

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