Repository navigation
Description
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:
- 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.
- 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:
- 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.- Being more like a module may let us treat extensions more naturally as libraries, especially in languages that don't have the equivalent of "type-classes" (e.g. Traits in Rust)
- See also Extensions: consider integration with language native package managers #3386
- 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
verdverm commentedon Jun 26, 2023
just stopping by to ask about how extensions will be versions, referenced, and dependency managed? Especially considering I can import the same
extension@versionin 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?
sipsma commentedon Apr 2, 2024
Ancient issue, modules replaced this