Skip to content

Support Extensions #4796

Closed as not planned
Closed as not planned

Description

@sipsma

Making this as a parent tracking issue for support for extensions, which are a way to define and share code that's re-usable across any Dagger SDK.

This goal was a fundamental part of the design of Dagger v0.3. We decided to start out simpler and just release the core API to start, but the original full vision of extensions are that they:

  1. Let you write code in the language of your choice which is then automatically converted into a graphql API
    • This code will itself have access to the Dagger API in addition to being able to run anything else you'd normally import in your language.
  2. Clients that want to use a set of extensions can generate an SDK which includes both the core API plus the APIs provided by the extension they depend on.

The end result is that you can write code once and then use it from any SDK in any language as easy as you would call the core API today. Extensions would also benefit from the same caching you get in the core API too.

We still have (hidden, undocumented) support for converting code->graphql schema in Go and Python. I believe our newer client codegen needs some updates to integrate with that but you can call extensions written in those languages with raw graphql today.


The details of how this will look and how we roll it out are still very much up in the air. A few selected open questions:

  1. Should we support truly extending any part of the API (i.e. adding methods to core types like Container) or should we force each extension to be more like a "module" where it can define its own types, use types from core and other extensions, but not add methods to those "external" types.
  2. Should we start simpler by just enabling users to provide implementations of pre-defined interfaces like "secret provider" or the With(...) mapper idea?
    • This may be easier to get going with as it temporarily avoids some of the hard questions around client codegen.

The idea here also extends into support for calling extensions from things we don't really consider an SDK today, such as calling your extensions from the dagger CLI using flags derived from the extension schema (which in turn suggests a relationship with support for standard project entrypoints)

Activity

  1. added
    area/engine
    on Mar 20, 2023
  2. verdverm commented on Jun 26, 2023

    @verdverm
    Contributor

    just stopping by to ask about how extensions will be versions, referenced, and dependency managed? Especially considering I can import the same extension@version in multiple languages.

    Would this code gen process create SDK code in all the target languages that we then have to tag, publish, and import via the usual means for the target languages?

  3. sipsma commented on Apr 2, 2024

    @sipsma
    ContributorAuthor

    Ancient issue, modules replaced this

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

    area/engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions