Repository navigation
Conversation
There was a problem hiding this comment.
I am torn on this.
On the one hand, I kind of feel like this should happen in a static, declarative config file (dagger.json in the environment source, basically).
- I love that I can programmatically load and execute environments from anywhere - github, universe etc.
- But I also would like an easy way to add, remove and generally manage my extensions without having to write code. For example in a GUI. Also dependency management is a feature that users expect to have access to directly - to wrap it in code would probably be surprising and confusing to most.
On the other hand, a config file will have to choose between being very constrained (no arbitrary pipelines to produce the environment directory), or "shadow code" with an increasingly complex DSL. I don't see a good solution to this.
There was a problem hiding this comment.
or "shadow code" with an increasingly complex DSL.
Agree we should avoid this at all costs. I'm okay with simple stuff like URIs (local://, git://, universe://, etc.), but we should cut it off at that level of complexity.
But I also would like an easy way to add, remove and generally manage my extensions without having to write code. For example in a GUI. Also dependency management is a feature that users expect to have access to directly - to wrap it in code would probably be surprising and confusing to most.
I think this sort of approach would be viable:
- The default is to put it in
dagger.json, we support only simple URIs as mentioned above.- This would either be automatically included in your environment or we could require an explicit
WithExtensionsFromConfigtype of call. Automatic inclusion is probably my preference atm.
- This would either be automatically included in your environment or we could require an explicit
- Very advanced use cases that need on-the-fly customization of the extension can still use the explicit
WithExtensioncall.- This loses the simplicity of the static config, but it would only be needed for advanced users, so I think it's okay to make that tradeoff.
- Also, if you ever need to do this, it means you are customizing an environment on the fly, which means you could instead just define a new environment that wraps the existing one with your customizations and then load that from your config instead.
tl;dr default to simple config, explicit withExtension is reserved for unblocking advanced use cases and has a clear pattern for migrating to the simple config.
There was a problem hiding this comment.
another possibility, perhaps too crazy: what if we assumed that with the advent of LLMs, software tools can be programmed to query and modify code as easily as a config file. And therefore we don’t need a “dumbed down” version of that code in a simplified json dsl: just regular code for everybody.
Maybe too radical?
There was a problem hiding this comment.
tl;dr default to simple config, explicit withExtension is reserved for unblocking advanced use cases and has a clear pattern for migrating to the simple config.
Sounds good to me! Placing environments in a static file also seems like it would make codegen easier. If we needed to run the code to just to learn the environments to codegen, you could get stuck if/when the new codegen introduces compiler errors. Compared to dagger.json which can be processed statically.
Can we have commands for modifying the dagger.json file?
Some ideas: (edit: new PR for CLI feedback: #5420)
# shorthand for git:// + setting a branch (otherwise uses remote default branch)
dagger use github.com/vito/progrock@main
# shorthand for local://./ci
dagger use ./ci # shorthand for local://./ci
# shorthand for universe?
dagger use goSide note: this is also a good reason to have a lock file of some kind. Might make sense to have dagger.json refs update the same .lock file as everything else.
There was a problem hiding this comment.
If we have static file + code, how do we deal with possible conflicts between them?
There was a problem hiding this comment.
Can we have commands for modifying the dagger.json file?
Yeah we currently have dagger project for creating/reading dagger.json, but in the old incarnation of dagger project last year it also had commands for adding/updating dependencies.
Will take a closer look at the CLI PR soon, but at a first glance looks great!
If we have static file + code, how do we deal with possible conflicts between them?
Same way that we deal with conflicts within the static file or conflicts within the code, error out.
I normally don't like two sources of truth, but as long as the static file is the "standard blessed way" and the code approach is reserved for our "Advanced Use Cases FAQ" type of documentation, I think it's totally fine. Express as much as you can in the file, if you are the 1% of users who need more flexibility, write some code too.
There was a problem hiding this comment.
You mean to save in dagger.json the environment schema when doing dagger use github.com/vito/progrock@main ? I was thinking that would just save the URL in that file instead.
I get the performance benefits of having a "pre-loaded" schema though but it opens a can of worms in my mind so I need to catch up a bit more to have a more solid idea.
There was a problem hiding this comment.
One example for an advanced usage of WithExtension in code is to load extensions dynamically based on what's in the project. Like buildpacks.
Project Zenith is a reinvention of the Dagger UX to make it more approachable. * Draft README * Draft GraphQL schema * Mockup examples Signed-off-by: Solomon Hykes <[email protected]>
|
|
||
| ## What kind of environments? | ||
|
|
||
| In theory, any software environment can be daggerized, as long as its individual components can run in a container. In practice, Dagger is most commonly used for non-production environments, such as: |
There was a problem hiding this comment.
Dagger is most commonly used for non-production environments
I don't think this is accurate. Do you mean "outside the application runtime" instead of "non-prod environments"? In practice, a release process or a CI systems are both production environments where Dagger is used.
There was a problem hiding this comment.
I think this means that CI is part of the development environment and that it isn't a separate entity that sits in limbo between development and production.
There was a problem hiding this comment.
I think the disconnect here is that some folks consider CI/CD "production" if it implements (especially if continuously/automated) the "path to production" whereas this comment is more saying that you don't literally use Dagger to run your actual production environments (like the running webserver etc).
There was a problem hiding this comment.
Most people use "production environment" in a sense that does not include their CI. So I used the terminology in that way. But we can make it work either way, it's not core to Dagger or Zenith. We just need to make sure we use the words in a way that doesn't confuse our audience.
| Container | ||
| } | ||
|
|
||
| type Checks { |
There was a problem hiding this comment.
| type Checks { | |
| type Check { |
| type EnvironmentGraph { | ||
| # This type will be extended by an environment-specific graphql schema | ||
| } |
There was a problem hiding this comment.
Can you give examples on how this can be used?
| commands: [ToolCommand!]! | ||
| } | ||
|
|
||
| type ToolCommand { |
There was a problem hiding this comment.
Bikeshed: simplify to Command?
| name: String! | ||
| description: String | ||
| subcommands: [ToolCommand!] | ||
| # invocation? |
There was a problem hiding this comment.
Is the question about wether to have it or how to design it? +1 for having it. I also wonder how the environment author can easily run another command from a command.
| // Add env-specific data to the graph, | ||
| // for scripting, inspection and composition | ||
| WithGraph( | ||
| Biome, | ||
| Generate, | ||
| Nixpkgs, | ||
| NixBase, | ||
| NixDerivation, | ||
| ). |
There was a problem hiding this comment.
Same as before, not sure how this is meant to be used.
| WithWarmup( | ||
| func(ctx dagger.Context, area string) error { | ||
| Biome.Sync(ctx) | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Maybe also a WithCleanup?
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
This is not even close to finished... It is meant to start discussions on the design and marketing of Project Zenith - an initiative to reinvent the Dagger user experience around the CLI, to make it more approachable.
This draft PR contains the following drafts:
Notable design topics
Standalone environments
One important aspect of the Zenith design: you use Dagger/zenith to develop environments, and environments have their own source code repository.
This is different from the current best practice, where environment code is embedded into the repository that will be used as its working directory. From the point of view of the environment's programmer, this mixes data and code. In the Zenith design, the environment's code will be cleanly separate from its data.
Note by @tiborvass (from discord)
Note by Conor at Airbyte:
From me addressing the questions: