Commit Graph

14 Commits (1afe46676093bfdf93694075d45e029bf296930c)

Author SHA1 Message Date
Kohei Tokunaga 4c730ee96b
Enable to get build definition from Inspect API
This commit adds two fields to the response of Inspect API.

- Definition: Build definition of the first build executed by Build API.
- CurrentDefinition: Build definition of the latest build executed by Build or
  Solve API.

The client can use these information for debugging the build deeply.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Kohei Tokunaga f72ea677f1
Add Solve API for performing a build on a build definition
This commit adds Solve API to the controller. This receives a build definition,
performs that build using ResultHandler held by that session. After Solve
completes, the client can debug the result using other APIs including Invoke.
Note that the ResultHandle provided by Solve overwrites the ResultHandle
previously stored in that session (possibly generated by the past Build or Solve
API call).

Using this API, user can perform build-and-debugging loop on the same session.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Kohei Tokunaga de693264a8
Add BuildOptions.Debug for allowing lazy evaluation of ResultHandler
This commit adds BuildOptions.Debug that allows skipping the evaluation of the
ResultHandler. The ResultHandler is created without evaluated, so calling Build
API with this flag always returns an error with the reference ID of that
(errored) ResultHandler. Note that this state of ResultHandler doesn't contain
result nor error so any operation on that ResultHandler will result in an error.

Following commit will allow user to do further operations (e.g. evaluation of a
bulid) using the buildkit client held by that ResultHandler.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Justin Chadwell c6db4cf342 build: clarify NewResultHandle comment
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell b7f0b3d763 build: clear exports for secondary solve request
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell cd1648192e build: rename ResultContext to ResultHandle
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 8d822fb06c build: move main solve request into main gateway call
Now, we always perform the full solve request in the main gateway call.
This ensures that progress works properly, and makes the lifetime
semantics much clearer.

NewResultContext abstracts the details of a successful/failed build, to
always return a single ResultContext, even though the details of how a
gateway is created is different:
- For a failed build, we can just keep the gateway open.
- For a successful build, we immediately open another gateway and
  re-evaluate the build definition in that gateway. This should give an
  instant cache hit (since the build was just successful).

Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 45fccef3f3 debug: evaluate all refs to allow multi-platform debugging
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Kohei Tokunaga 8fd81f5cfd controller: avoid "context canceled" error on cleanup
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Justin Chadwell e5a0ed1149 debug: secondary client build should not reuse solve opt ref
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Justin Chadwell 2402607846 build: use gateway's solve context to allow cancelling getResultAt
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
Kohei Tokunaga fd5d90c699
remove unused fields from ResultContext
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Kohei Tokunaga ce48b1ae84
Enable to restore build options from the server
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago
Kohei Tokunaga b3340cc7ba
Enable to create container from error
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2 years ago