Repository navigation
Conversation
2324091 to
2d74cb5
Compare
|
Hm, if we're doing this, I do wonder if we should just go all out and refactor the entire driver interface. Maintaining both is gonna be a pain.
I also propose |
565ed4f to
c079e31
Compare
IMO this can be done with hooks. It's not worth the considerable effort to support all this extra configuration in a way that is clean, well maintained, and supports all edge cases. Power users will prefer hooks anyway, and we will be grateful not to be on the hook for maintaining all that extra code.
Meh, it's just an escape hatch. Only power users will even think to use this. And they will now that it voids the warranty.
Again - meh. Yeah it voids the warranty, but so does
Great idea, I added that 👍 |
This comment was marked as outdated.
This comment was marked as outdated.
706670d to
2310985
Compare
f9bc5bb to
bc1e72c
Compare
|
@jedevc @jpadams @marcosnils @kpenfound @gerhard @matipan updated description. Please let me know your thoughts. Implementation works, just neefs tests & cleanup.
|
288a376 to
6eb8351
Compare
|
Got some comments 👀 It's better than what we have now! I'm not entirely convinced that splitting out all the config settings into lots of different env vars is easier than what we have now - some of the options don't work with each other (e.g. I can set
What's the priority on different vars? If I have all This was one of the main reasons I liked the idea of one unified env var, but as long as the behavior is clear and well-defined, I'm fine.
I think this should be
I'm wondering if these should even be available as environment variables. These essentially are equivalent to controlling the settings in Docker Desktop to assign the CPU and memory - we want them to be persistent. So maybe we should only allow configuration in Something like: {
"drivers": {
"apple": {
"cpus": 8,
"memory": "16G"
}
}
}
Thinking back, the only real reason these exist is to enable the See: I'd suggest removing these entirely. Once they're "official" environment variables, we need to support them indefinitely. Until we have an actual end-user case, I think we should either have them only configurable as part of the legacy
Discussed this a bit with @matipan:
|
|
I realize it's frustrating to suggest another approach with an almost complete implementation - I would have liked to discuss this more before an implementation appeared. But I wonder if instead, we should only expose two environment variables:
All configuration details for provisioning must be configured in the For more fine-grained configuration, we could potentially support reading a I feel like we should lean into the config file approach - I feel like is what we'll end up with anyways, there's too many environment variables to carry around, so users will just put them into a |
The argument against a config file for me is what happens in a CI environment. Having to manually write a config file to then run the dagger command feels like a paper cut. However, I don't think that will be a problem. The majority of the configs that you mention should not be applicable to a CI environment, so users shouldn't have the need to set up the config file. And if we find a case where it's needed, then that's a great excuse to improve our CI integrations (e.g., our Dagger GitHub action) and let it take care of creating the file with the right properties.
I would prefer to stay away from letting users define custom resources in our cloud environment. It complicates things quite a bit, and based on our experience, I think it's best to stick to instance "classes" and let users choose based on that. That said, I do wonder how we might want to let other properties be configurable. The most relevant one that comes to mind is whether a user needs a dedicated or shared engine. There's the option of hiding this property away in the engine config and not letting the CLI specify it. But it's worth considering when thinking about how to configure these options. |
6eb8351 to
618fdf6
Compare
Right. In this PR there are 3 "tiers" of configuration: cloud, host, image. Note that in main there are already 2 tiers: cloud, and everything else.
At the moment the lookup order is: cloud, host, image. We could possibly switch it to: host, cloud, image.
I agree that was an advantage of the unified URL (with the caveat that we already had to support
Ah. Sorry, the complexity of the code made me miss that important detail 😛 Indeed the
I don't mind, but we should have a consistent rule for which configuration goes in env variable, CLI flags, and config file. Lacking that, we should just default to supporting all of them in all three places, which is easier to reason about.
Wouldn't this mean continuing to maintain the code for our own use case, and being forced to keep I would be all for a clean cut. But not a messy partial cut. |
I think the rule should be that the configuration of any specific driver should be in the config file. The only env vars we should support should be the ones that select which driver to use, i.e. the proposal here: #10790 (comment)
The main reason to have Lines 13 to 14 in 5fd1f23 If we're just building them in, we could also just add args for those above there, so that they can be set at build time, but never at runtime. That's still a little bit of special casing? But not exposing any configuration surface, if we do this, there's no reason to have those. |
My view on this is that when using Dagger Cloud, the client should have no input at all on the infrastructure configuration. Those should all be configured out-of-band by administrators of the Dagger Cloud account, and mapped at request time by user, module, function name, CLI version, API token... maybe by freeform tags, and even that I'm worried will be abused. |
|
@jedevc the split between |
618fdf6 to
983470e
Compare
|
We can keep I guess it's useful if I'm setting up a mirror? But in that case, I'd want something where I can configure it in a more persistent way, not just as a temporary environment variable. |
c9d1d85 to
52e96bf
Compare
|
I think |
…gine from the dagger CLI. - `DAGGER_HOST`: Connect directly to a Dagger Engine. Supports `tcp://`, `ssh://`, `unix://`, `container://`, `kube-pod://`. You are responsible for engine provisioning, and version management. Warranty is void. | - `DAGGER_IMAGE`: Provision a Dagger Engine from the given container image. Tag is optional: if omitted, the current CLI version is used | - `DAGGER_IMAGE_VERSION`: Provision a Dagger Engine of the given version. Can be used in combination with `DAGGER_IMAGE`, or standalone. | - `DAGGER_IMAGE_RUNNER`: Provision a Dagger Engine with the given container runner. If omitted, a runner is auto-discovered. Supports `docker`, `podman`, `containerd`, `apple` | - `DAGGER_IMAGE_MEMORY`: Provision a Dagger Engine with custom memory configuration | - `DAGGER_IMAGE_CPUS`: Provision a Dagger Engine with custom CPU allocation | - `DAGGER_IMAGE_PORT`: Provision a Dagger Engine with a custom port number | - `DAGGER_IMAGE_CONTAINER_NAME`: Provision a Dagger Engine with a custom container name | - `DAGGER_IMAGE_VOLUME_NAME`: Provision a Dagger Engine with a custom volume name | - `DAGGER_IMAGE_VOLUME_NAME`: Provision a Dagger Engine with a custom volume name | `_EXPERIMENTAL_DAGGER_RUNNER_HOST` is deprecated, but we maintain backwards compatibility, with a warning. Signed-off-by: Solomon Hykes <[email protected]>
52e96bf to
df2294d
Compare
|
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. |
Overview
Stable configuration for provisioning and connecting to the dagger engine from the dagger CLI.
DAGGER_CLOUD_ENGINEDAGGER_HOSTtcp://,ssh://,unix://,container://,kube-pod://. You are responsible for engine provisioning, and version management. Warranty is void.DAGGER_IMAGEDAGGER_IMAGE_VERSIONDAGGER_IMAGE, or standalone.DAGGER_IMAGE_RUNNERdocker,podman,containerd,appleDAGGER_IMAGE_MEMORYDAGGER_IMAGE_CPUSDAGGER_IMAGE_PORTDAGGER_IMAGE_CONTAINER_NAMEDAGGER_IMAGE_VOLUME_NAMEDAGGER_IMAGE_VOLUME_NAMECompatibility
_EXPERIMENTAL_DAGGER_RUNNER_HOSTis deprecated, but we maintain backwards compatibility, with a warning.Hooks
An experimental hook is included, to override how to provision and connect to the engine:.config/dagger/hooks/engine-run.I removed the hook implementation, for simplicity. We may not need it after all?
Implementation
This is built on top of #10714 by @jedevc . It acts as a facade to the driver system. Drivers are still used, but they are no longer presented directly to the user via a URL scheme system. This implies a follow-up, which can collapse much of the driver system to simplify the code. For now, I am prioritizing continuity with Justin's work at the expense of overall simplicity, seems worth it!