Repository navigation
Conversation
Signed-off-by: Andrea Luzzardi <[email protected]>
|
I've written I've also opened this issue regarding attributes and what I was trying for dagger (cuelang/cue#774) Attributes need a bit of UX improvement on the Cue side (as a dev importing Cue into my tool), I have several issues / PRs on this |
|
@verdverm nice. We certainly can use attributes internally to flag our operations, but I'm not sure we want to expose them to end users:
|
|
That will make implementing eject easier today, thanks for the context |
If these two I also don't think annotations are coming through imports currently Marcel is working on them apparently cuelang/cue#529 (comment) |
|
We discussed this with @aluzzardi yesterday, here is a summary of our conclusion. On the use of annotations:In order to decide if we want to use annotations for this, we must first decide whether using our helper types is the only recommended way to write a dagger configuration, or if writing “naked” configurations (without helper types) is equally correct.
Additionally, it may be premature to address namespace conflicts because it’s possible that in the future Cue will support namespacing of definitions by package (from a past conversation with Marcel). And in the meantime namespace conflict on |
|
Based on our last discussion, I suggest the following:
WDYT? |
👍 I'm starting to form an opinion on this after writing some configs, I'd be happy to have a conversation soon. Would be curious to hear from others. That being said, I agree it should be its own conversation and shouldn't hold back these incremental changes.
👍 Really depends on figuring out naked vs helper-types
Either refresh #118 or start fresh, whichever is easier. There's one more thing though this proposal tried to address, it's @dubo-dubon-duponey's feedback (#118 (comment)):
This PR addressed that with the following: Which you would use like so: As you can see, this is purely a UX change, there's no impact in how dagger sees things (e.g. it's a Even though it's a fairly minimal change, in a "helper types only" config, you can write the entire configuration using the dagger package, without "magic" keywords (e.g. |
Ok I will refresh #118 then, seems easier as it’s mostly manual search-replace.
What I don’t understand about that part is that you still have to write In any case, if this change could potentially be useful regardless of whether helper types are optional or mandatory, I guess it makes sense to spin it out into its own PR and continue the discussion there? |
The difference is that I'll let @dubo-dubon-duponey chime in here
Yes agreed. I believe it's useful in both scenarios. Of course you'd only want to use this on helper-based configs, not on naked ones. |
|
Closing this -- superseded by #118 |
docs: small improvements/fixes
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks #120, #122-#124) - init reshape to positional + dynamic SDK flags (tasks #125-#128) - initModule/initClient capability semantics + targetRuntime wiring (task #129) - dagger exec → dagger api exec (task #130) - cloneModuleAsSDK empty-marker preservation (task #121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state.
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks dagger#120, dagger#122-dagger#124) - init reshape to positional + dynamic SDK flags (tasks dagger#125-dagger#128) - initModule/initClient capability semantics + targetRuntime wiring (task dagger#129) - dagger exec → dagger api exec (task dagger#130) - cloneModuleAsSDK empty-marker preservation (task dagger#121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state. Signed-off-by: Solomon Hykes <[email protected]>
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks dagger#120, dagger#122-dagger#124) - init reshape to positional + dynamic SDK flags (tasks dagger#125-dagger#128) - initModule/initClient capability semantics + targetRuntime wiring (task dagger#129) - dagger exec → dagger api exec (task dagger#130) - cloneModuleAsSDK empty-marker preservation (task dagger#121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state. Signed-off-by: Solomon Hykes <[email protected]>
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks #120, #122-#124) - init reshape to positional + dynamic SDK flags (tasks #125-#128) - initModule/initClient capability semantics + targetRuntime wiring (task #129) - dagger exec → dagger api exec (task #130) - cloneModuleAsSDK empty-marker preservation (task #121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state. Signed-off-by: Solomon Hykes <[email protected]>
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks #120, #122-#124) - init reshape to positional + dynamic SDK flags (tasks #125-#128) - initModule/initClient capability semantics + targetRuntime wiring (task #129) - dagger exec → dagger api exec (task #130) - cloneModuleAsSDK empty-marker preservation (task #121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state. Signed-off-by: Solomon Hykes <[email protected]>
…state The section's checkboxes had drifted — nearly everything implemented shipped under a [ ] marker. Replace with explicit status legend: ✅ shipped on this branch 🟡 partially shipped (different shape than design) ⬜ designed, not yet implemented Categorized by surface area: - Shipped — top-level / module / api / cloud / workspace / config / schema / flag rename / removals / hidden aliases - 🟡 Partial — current --sdk-flag init shapes vs. designed positional dispatch (module init, api client init). Includes the note that --option on client init is dead plumbing today. - ⬜ Not yet implemented — handoff items with task references: - dagger sdk top-level group (tasks #120, #122-#124) - init reshape to positional + dynamic SDK flags (tasks #125-#128) - initModule/initClient capability semantics + targetRuntime wiring (task #129) - dagger exec → dagger api exec (task #130) - cloneModuleAsSDK empty-marker preservation (task #121) - Default-SDK inference, SDK codegen regen, --option removal - Known unfixed items reduced to just the legitimate one (workspace concept needs a one-liner definition). Status line updated from "Proposed" to reflect actual landing state. Signed-off-by: Solomon Hykes <[email protected]>
NOTE: this PR is for illustration purposes only, tests etc are broken.
This is a follow up to #118 (read that PR for context) and a mashup of:
What this does is provide a
dagger.#Componentdefinition that users embed into their Cue types to add dagger computation (no "magic"#daggeranymore)The embedded
dagger.#Componentdefines a#run-- from this point on it's exactly the same as #118 with a twist: the#rundefinition has a@dagger()annotation. The runtime specifically checks for this annotation, ignores everything that doesn't have it.This is to avoid namespace collisions: The downside of using
#runinstead of#daggeris we might clash with user configuration that has nothing to do with dagger. Because of the (internal)@dagger()annotation, user config can make use of the keyword#runfor their own purposes without clashing.The syntax needs some work, I think it can look better. Here's an example:
For "data-less" components it looks like this:
The
#Componentdefinition is as simple asI have a feeling annotations are super powerful and might unlock an even better UX, I just don't see it yet. @shykes @verdverm any thoughts?
For instance, half baked idea: we could have a definition like
#Run: [...#Op] @dagger(), which would allow to write anywhere in the configdagger.#Run & [dagger.#FetchContainer{ ... }].