Repository navigation
feat: support tmpfs size in withMountedTemp - #8652
Conversation
35b1325 to
116051d
Compare
Signed-off-by: Connor Braa <[email protected]>
116051d to
9b8ca54
Compare
sipsma
left a comment
There was a problem hiding this comment.
I don't particularly like the structure of the test, adding a whole additional test that's 99% repeated code, but it seems hard to parameterize around optional params; putting 2 WithMountedTemps in parallel creates a marshaling-into-struct ambiguity that's unresolvable.... should I be chaining or something?
The test LGTM as is, but if you want to de-dupe it a bit more you could:
- Switch away from the "raw gql query" approach, which only exists because a lot of these tests were added in ancient times before the Go SDK was fully formed. If you look later in
container_test.goyou'll see them switch to using the Go SDK (e.g. https://github.com/sipsma/dagger/blob/9cf2e8bfdb443223bae84329cd157b3ea7b7e061/core/integration/container_test.go#L3740-L3740) - If you do that, you can split out into subtests but have them share some common code, or you could do a table driven test approach (e.g. here), etc.
Is the "size" parameter in the appropriate place in the graphql schema? it can only be supplied for tmpfses, but it lives on the same level. do we want errors if folks try to supply sizes for other mounts? where would one add that logic?
The change here looks like it only adds size to the withMountedTemp API, so it should be scoped just to tmpfs mounts, which is what we want I think.
If you were referring to the new Size field in the ContainerMount struct in core/container.go, that's actually just internal only and doesn't get into the user-facing gql schema. I don't have a problem with Size existing there even if it's only used for when Tmpfs==true at the moment.
corollary question, should we be adding a more open-to-extension TmpfsOptions sort of struct here?
You could but it just doesn't make a big difference right now IMO; if I was to leave that comment it would be an uber-nit 🙂
In schema/container.go, do I need to expand env vars for size the same way it's done for paths?
Wouldn't consider that a blocker at all, I think the use case of configuring the size of a tmpfs mount from an env var in a container is extremely obscure. No objections if you do add it, but I'd personally just leave that out for simplicity for now.
there's a TODO regarding handling of optionals in dagql -- can I just blindly traverse these structs without worrying about nil deferences? it kinda seems like it from the test results.
Left a comment about this one
do the SDKs just work themselves out from API level changes? or am I missing some steps here?
Ah no, we should add this to CONTRIBUTING.md. You need to generate them all by running dagger call sdk all generate export --path . locally from your repo and committing the resulting changes.
I'm sure I have unknown-unknowns, plz look for them :)
This is worth a changelog entry (I added the needs changelog label so our CI guards that one is added). Based on parallel discord conversations I think you saw that but let me know if more pointers needed
Signed-off-by: Connor Braa <[email protected]>
fd61bac to
6205921
Compare
Signed-off-by: Connor Braa <[email protected]>
Signed-off-by: Connor Braa <[email protected]>
2357428 to
bc1c76e
Compare
sipsma
left a comment
There was a problem hiding this comment.
LGTM! I forgot that in addition to generating the SDKs you also need to regenerate the docs (specifically some generate graphql schema files that get consumed by our docs website), which is currently a separate command unfortunately:
dagger call docs generate export --path .
(we should probably just make a function for generating everything, sdks+docs included, but separate issue)
That's the cause of the Docs failure in CI.
The rest of the SDK failures are from an annoying infra issue that should be fixed by #8438, they pass on a re-run
Signed-off-by: Justin Chadwell <[email protected]>
|
Regenerated the docs, in the interest of getting this in for the release 🎉 LGTM! |
fixes #8573, at least partially
this pr adds a size parameter to withMountedTemp and passes that down to buildkit's mount initialization.
I had many questions that @sipsma answered in the comments.