Skip to content

Improve CUE Package Management #2163

Closed as not planned
Closed as not planned

Description

@aluzzardi

Non exhaustive list of requirements, in random order [...]

Question is: should we rewrite our own vendoring system or can we contribute upstream instead?

Originally posted by @aluzzardi in #2052 (comment)


Essential

These are focused on freeing us from embedding the built-in packages in the binary, and from needing to vendor packages in cue.mod/pkg (i.e., committing them to VCS).

Enhancements

Incremental improvements mostly from the upstream proposal, until we have an official package management solution.

Upstream

Docs

Activity

  1. jlongtine commented on Apr 13, 2022

    @jlongtine
    Contributor

    I'd definitely vote for trying to contribute upstream, if we can.

  2. helderco commented on Apr 21, 2022

    @helderco
    Contributor
  3. samalba commented on Apr 21, 2022

    @samalba
    Contributor

    @morlay shared his project on Discord: https://github.com/octohelm/cuemod - maybe we could use it to improve our package support?

    @morlay is cuemod embeddable into other projects using CUE?

  4. morlay commented on Apr 21, 2022

    @morlay
    Contributor

    @samalba Yes it is.

    It could just use with github.com/octohelm/cuemod/pkg/cuemod.ContextFor https://github.com/octohelm/cuemod/blob/main/pkg/cuemod/context_test.go#L25

    But the spec is different from dagger.mod https://github.com/octohelm/cuemod#spec-cuemodmodulecue

    One more thing, if the vendor pkg is a go project, it will be transform to cue from go structs.
    (Not sure does dagger need it?)

  5. morlay commented on Apr 21, 2022

    @morlay
    Contributor

    In fact. the two tools could be split to use.

    https://github.com/morlay/dagger-cuemod-example (cuem required v0.3.0)

    once dagger.io/* and universe.dagger.io/* support go-get, We could remove the replace.

    replace: {
    	"dagger.io":          "github.com/dagger/dagger/pkg/dagger.io"
    	"universe.dagger.io": "github.com/dagger/dagger/pkg/universe.dagger.io"
    }
  6. morlay commented on Apr 21, 2022

    @morlay
    Contributor

    @samalba

    Here an exmaple to port domain to github for go get

    curl "https://go.opentelemetry.io/otel/trace?go-get=1"

    Response:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="go-import" content="go.opentelemetry.io/otel git https://github.com/open-telemetry/opentelemetry-go">
    <meta name="go-source" content="go.opentelemetry.io/otel https://github.com/open-telemetry/opentelemetry-go https://github.com/open-telemetry/opentelemetry-go/tree/master{/dir} https://github.com/open-telemetry/opentelemetry-go/blob/master{/dir}/{file}#L{line}">
    <meta http-equiv="refresh" content="0; url=https://pkg.go.dev/go.opentelemetry.io/otel/trace">
    </head>
    <body>
    Nothing to see here; <a href="https://pkg.go.dev/go.opentelemetry.io/otel/trace">see the package on pkg.go.dev</a>.
    </body>
    </html>%

    So we just need the the html meta when we request curl "https://dagger.io/dagger?go-get=1"

    <meta name="go-import" content="dagger.io/dagger git https://github.com/dagger/dagger">
    <meta name="go-source" content="dagger.io/dagger https://github.com/dagger/dagger https://github.com/dagger/dagger/tree/main{/dir} https://github.com/dagger/dagger/blob/main{/dir}/{file}#L{line}">

    universe.dagger.io is the be same

  7. linked a pull request that will close this issuefeat: allow http modules #2275on Apr 22, 2022
  8. morlay commented on Apr 24, 2022

    @morlay
    Contributor

    @samalba

    With some refactor. now just change oneline in compiler/build.go (github.com/octohelm/[email protected])

    buildConfig := cuemod.ContextFor(src).BuildConfig(context.Background())

    Before the "go-get" supported #2163 (comment)
    the replace directive have to added.

  9. aluzzardi commented on Apr 25, 2022

    @aluzzardi
    ContributorAuthor

    That's super interesting @morlay, we should definitely look into it /cc @helderco

    Do you think we could use cue-get=1 / cue-import / cue-source instead of go-*? I believe that's how CUE is going to implement it cue-lang/cue#851 (https://acme.com/quote?cue-get=1 from the spec) /cc @jlongtine

  10. jlongtine commented on Apr 25, 2022

    @jlongtine
    Contributor

    That is my understanding of how cue mod will work, but I don't think any system will respect it yet, including GitHub.

  11. morlay commented on Apr 26, 2022

    @morlay
    Contributor

    @aluzzardi

    i think we could support both go-get and cue-get.

    just need put those meta in html.
    query parameters could be ignored.

    as @jlongtine said, no vcs support cue-get now. 😂
    we could use the channel from go,
    private vcs like gitlab already support go-get.

    this will be easy to start.

  12. 10 remaining items

  13. helderco commented on May 24, 2022

    @helderco
    Contributor

    I've converted the remaining list items into issues and created a few more.

  14. mircubed commented on Dec 21, 2022

    @mircubed
    Contributor

    @helderco to clean up for the new year, can you determine what needs to be kept for this large issue or maybe we can just close it?

  15. changed the title [-]Improve Package Management[/-] [+]Improve CUE Package Management[/+] on Dec 21, 2022
  16. helderco commented on Dec 22, 2022

    @helderco
    Contributor

    This should only be relevant if we support any version using CUE. However, with the focus on the GraphQL based SDKs, the CUE package manager is no longer a major onboarding issue when adopting Dagger.

    Every other SDK uses their language's package manager. CUE is the exception because there isn't one yet, but there are some third party attempts for one and I don't think it's worth it for us to be another. The ideal situation has always been that the CUE project releases an official solution for its community.

    The current CUE SDK v0.2 is frozen and I'm not sure when we'll release a new one, but let's reassess the upstream situation then. In the meantime, you can still try some other tool, vendor manually or use the current implementation to the extent that it works for you.

    I'm going to close some of the issues in this epic but since there's still quite a few CUE related issues that are open I'm going to also leave open some of the more essential fixes and hand this over to @jlongtine to decide what to do with what's left.

  17. removed their assignment
    on Dec 22, 2022
  18. shykes commented on Dec 22, 2022

    @shykes
    Contributor

    Agreed completely.

  19. TomChv commented on Oct 31, 2023

    @TomChv
    Member

    I'm closing this issue since we no longer support the cue SDK

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