Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access gateway API from client #533

Merged
merged 7 commits into from
Aug 16, 2018
Merged

access gateway API from client #533

merged 7 commits into from
Aug 16, 2018

Commits on Aug 8, 2018

  1. gateway: support direct creation/running of a client.

    Provide a `New` method and a new `Run` method on the `grpcClient` to allow
    manual creation of a client in addition to the current ability to initialise
    from the environment. Accordingly the existing `Run` method becomes
    `RunFromEnvironment`.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    682dce6 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2018

  1. gateway: Return an interface from grpcclient.New.

    Returning an interface rather than a private-struct from a public interface is
    good practice.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    5485309 View commit details
    Browse the repository at this point in the history
  2. gateway: make Return a one shot operation and check for various edg…

    …e cases.
    
    Refactor the setting/getting of the result for a `llbBridgeForwarder` in order
    to check that `Return` is only called once and only with the correct options.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    3f5276b View commit details
    Browse the repository at this point in the history
  3. gateway: tolerate Solve being called with no creq.Definition

    Avoids panicing when accessing `creq.Definition.Metadata`.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    13f53d5 View commit details
    Browse the repository at this point in the history
  4. gateway: call Return if call to BuildFunc returns an error.

    Reorder the code slightly so that an error returned by the call to the
    `BuildFunc` is picked up by the `defer`d error handling.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    2a4ec0b View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2018

  1. allow frontends to be run directly on the control client side

    This allows builder code to be written which can be built as either a gateway
    container or in a purely client side configuration, giving implementors more
    flexibility.
    
    Now when `Solve` sees a request with neither a definition nor a frontend
    specified it will make the job available via new LLBBridge endpoints on the
    control socket which the client can then use. These end points require the job
    id to be present in the gRPC metadata and a client side object is added to
    facilitate this.
    
    The `llbBridgeForwarder` type is now exposed as a public `interface
    LLBBridgeForwarder` which satisfies the underlying gRPC server interface
    (`pb.LLBBridgeServer`) as well as a new `Done()` & `Result()` pair which can be
    used to wait for the client to call `Return()` (using a model similar to
    `context.Context`).
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 14, 2018
    Configuration menu
    Copy the full SHA
    22f632f View commit details
    Browse the repository at this point in the history
  2. examples: demonstrate client-side Build() interface.

    Adds an option/envvar to `examples/build-using-dockerfile` which uses a client
    side instance of the dockerfile frontend.
    
    Signed-off-by: Ian Campbell <ijc@docker.com>
    Ian Campbell committed Aug 14, 2018
    Configuration menu
    Copy the full SHA
    5383270 View commit details
    Browse the repository at this point in the history