Skip to content

v2 IDs - #6158

Closed
vito wants to merge 25 commits into
dagger:mainfrom
vito:v2-ids
Closed

v2 IDs#6158
vito wants to merge 25 commits into
dagger:mainfrom
vito:v2-ids

Conversation

@vito

@vito vito commented Nov 26, 2023 •

Copy link
Copy Markdown
Contributor

Finally found some free time to revive this effort, making good progress. Completely exploratory, in dire need of refactoring.

Context: #3923 (comment)

TODO:

  • Get all tests passing, go over XXX's and TODOs
  • Write proper PR description
  • Figure out whether core.ModuleObject is needed, or how this should work for modules in general
  • Implement + understand impure / non-cached resolver semantics
    • Reconcile w/ ToCachedResolver usage - verify which resolvers can/cannot be cached
  • Implement + understand 'meta' resolver semantics
    • Pipeline, WithFocus should not cause cache misses
  • Do IDs need to bake in module dependencies, for them to be fully reproducible? (Probably)
  • Is the ID assignment methodology sound?
    • ID is assigned on IDable objects returned by resolvers, but only if not already present.
    • Clone copies an object and clears out its ID, therefore mutating resolvers will usually have above behavior
    • "Moving" / "impure" resolvers can return a pure ID, e.g. container.from("alpine") can choose to return container.from("alpine@sha256:...")
  • Document how it all works
  • (Probably) switch back to Cap'n'Proto
  • Pack (Cap'n'Proto) or compress IDs (prob lots of repeated things like withEnvVariable)

vito added 18 commits November 27, 2023 16:50
trying it out.

* super fast digest calculation vs. protobuf
* it hit 1.0 recently (if that matters to you)
* allows unions with Lists (protobuf required wrapper types)
* POSSIBLY less crusty toolchain? so far feels pretty similar. have to
  use submodule for Go codegen.

Signed-off-by: Alex Suraci <[email protected]>
...eh, nevermind. perf gains might be offset by all the copying being
done with the ID type. we can always change this later if we include a
version of some kind in the encoded ID format.

This reverts commit 0f36939b4997cfd72a9e3df56bf90219be038a73.

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
still need to draw the rest of the owl.

* query cache needs to be actually written to
* IDs need to be constructed as resolvers evaluate
* IDs need to be set on objects and chained as more queries are run
* service bindings hackery needs to be rebased on refactor - it's even
  more needed now

Signed-off-by: Alex Suraci <[email protected]>
* for module ID-able objects, add a ModuleObject type which stores an
  arbitrary value.
* start transitioning core APIs from IDs to Objects where possible
* still a big TODO for Decode

Signed-off-by: Alex Suraci <[email protected]>
this is still needed, I think, since it needs to know what type to
decode

Signed-off-by: Alex Suraci <[email protected]>
192 tests failing

query caching added, but possibly overly caching

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
hackety hack, but now secrets work

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
vito added 7 commits November 28, 2023 11:27
seeing the line number is slightly more helpful, the error isn't
descriptive anyway

Signed-off-by: Alex Suraci <[email protected]>
this is starting to show creakiness in this approach, really tempting to
just invent an ID-aware resolver that tracks it at every step

Signed-off-by: Alex Suraci <[email protected]>
should at least fix the expected *core.ModuleObject, got *core.Query
errors

Signed-off-by: Alex Suraci <[email protected]>
really shouldn't need to do any weird type conversion now that we always
start with *core.Query and have resolvers expect it

Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@vito vito mentioned this pull request Dec 19, 2023
@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant