dap: utilize the container filesystem for the file explorer#3450
dap: utilize the container filesystem for the file explorer#3450jsternberg wants to merge 1 commit intodocker:masterfrom
Conversation
af9b8a1 to
144a51e
Compare
144a51e to
f4f3898
Compare
f4f3898 to
fe002ca
Compare
98779f9 to
e9d6ba0
Compare
|
Finally had time to come back to this and update it for what got merged. It's tested and works with the capability detection. When the capability isn't present, it will not attempt to use the result handle which causes it not to include cache mounts. When the capability is there, cache mounts are present. |
dap/thread.go
Outdated
| rCtx := t.rCtx | ||
|
|
||
| getContainer := sync.OnceValues(func() (gateway.Container, error) { | ||
| return rCtx.NewContainer(ctx, &build.InvokeConfig{}) |
There was a problem hiding this comment.
Is there a way this calls ReleaseContainer.
The resources should be released anyway when the gateway session expires, but I am wondering if we can be explicit.
There was a problem hiding this comment.
Discussed this offline. This was intended to use build.NewContainer which registers this cleanup with the result context and executes it when Done() is called. I mistakenly called the function directly instead of through build.NewContainer. I've modified this to use build.NewContainer and added for methods to forward the ReadFile/ReadDir/StatFile calls to the container directly to *build.Container so we can just reuse that code here.
e9d6ba0 to
c9f31cd
Compare
…ile system The container filesystem request API that has been added to buildkit allows a container created through the `NewContainer` API to also access the filesystems. This is useful when an error occurs because it allows us to grab the mutable state of the mounts used during the actual build rather than the input version copies which don't contain any files that were added as part of the failed command. This gives us a more accurate view of the filesystem that was previously only accessible through using `exec` and `ls`/`cat` commands that may not always exist. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
c9f31cd to
1da36d1
Compare
This utilizes the container filesystem for the file explorer instead of
using the reference directly. For the error condition, this allows us to
gain access to the filesystem when the error happened with its current
state at the time of the error rather than before the step even ran.
A better solution for resolving #3410. Relies on functionality in moby/buildkit#6262.