Skip to content

Treat dagger.io and universe.dagger.io as external packages #2506

Closed as not planned

Description

@helderco

Problem

We have a different behavior for built-in packages. dagger.io and universe.dagger.io are embedded in the binary and we have to extract the files from there, fixing the version to the binary version.

Solution

Handle built-in packages like external packages, fetching from git. Then stop embedding these files into the binary.

Version management

I think we can handle universe.dagger.io as a normal reusable repo that has multiple packages. It's the same as you'd use for your own private company repo with internal conventions. Or a personal dagger-packages repo you'd use in multiple projects.

As for dagger.io we can use it to "tie" into the engine, so it replaces the cue.mod/version.txt file.

Example:

// cue.mod/dagger.mod

require (
	dagger.io v0.2.10
	universe.dagger.io v0.2.10
)

replace (
	dagger.io => github.com/dagger/dagger/pkg/dagger.io
	universe.dagger.io => github.com/dagger/dagger/pkg/universe.dagger.io
)

This is compatible with the future upstream solution, just need to convert syntax into cue.mod/module.cue.

Version constraints

Do we want to keep the special compatibility constraints internally?

// ModuleRequirements specifies the MINIMUM version of the module dagger requires in order to work.
// This must be updated whenever we make breaking changes so users are prompt to upgrade the packages.
ModuleRequirements = map[string]*gv.Version{
	DaggerModule:   gv.Must(gv.NewVersion("0.2.11")),
	UniverseModule: gv.Must(gv.NewVersion("0.2.9")),
}

The advantage is not to require updating configs when upgrading the binary when not every release changes those .cue files.

If not, we need to ask the user to dagger project update -u dagger.io when a new binary version is detected that's different from what's required in cue.mod/dagger.mod.

Requires

Activity

  1. helderco commented on May 26, 2022

    @helderco
    ContributorAuthor

    Added version management sections.

  2. helderco commented on May 26, 2022

    @helderco
    ContributorAuthor

    @aluzzardi what do you think about using the require dagger.io v0.2.10 as a replacement for cue.mod/version.txt?

  3. aluzzardi commented on Jun 1, 2022

    @aluzzardi
    Contributor

    @aluzzardi what do you think about using the require dagger.io v0.2.10 as a replacement for cue.mod/version.txt?

    Yep, that was the intention, version.txt was a temporary hack

  4. helderco commented on Dec 22, 2022

    @helderco
    ContributorAuthor

    Closing. More context in parent issue: #2163.

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