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

Serverless zanzibar #676

Merged
merged 32 commits into from Dec 18, 2019
Merged

Serverless zanzibar #676

merged 32 commits into from Dec 18, 2019

Conversation

tejaswiagarwal
Copy link
Contributor

Adds a new feature in Zanzibar to have a serverless mode. Endpoints can be created without a downstream, the workflow is short-circuited together to return a response to the caller. A new type convertor flow was added to convert Request to Response type, which is used by the serverless middleware.

codegen/gateway.go Outdated Show resolved Hide resolved
codegen/method.go Outdated Show resolved Hide resolved
codegen/module_system.go Outdated Show resolved Hide resolved
codegen/service.go Outdated Show resolved Hide resolved
codegen/service.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Dec 13, 2019

Coverage Status

Coverage increased (+0.2%) to 69.848% when pulling d68155d on serverless-zanzibar into 4abd6ea on master.

*compile.DoubleSpec,
*compile.StringSpec:

dummyConverter.append("out", " := in\t\n")
Copy link
Contributor

@argouber argouber Dec 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this just "out := in\n"
There is no point in having a trailing \t

codegen/module_system.go Outdated Show resolved Hide resolved
Copy link
Contributor

@argouber argouber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. But please ask rohit.patali to review as well.

Copy link
Contributor

@rpatali rpatali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see at least one example each for the following cases:

  • no request/response payload
  • primitive type request/response payload

@@ -275,6 +279,8 @@ type EndpointSpec struct {
ClientMethod string `yaml:"clientMethod,omitempty"`
// The client for this endpoint if httpClient or tchannelClient
ClientSpec *ClientSpec `yaml:"-"`
// DummyEndpoint checks if the endpoint is serverless
IsDummyEndpoint bool `yaml:"-"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call it clientless and other places throughout the code.

@@ -1000,6 +1003,61 @@ func (ms *MethodSpec) setTypeConverters(
return nil
}

func (ms *MethodSpec) setDummyTypeConverters(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call it ClientLessConverter

@abhishekparwal
Copy link
Contributor

This is a clientless feature and not a serverless. server has a standard meaning and lets not change it. server is in this case zanzibar.

codegen/templates/serverless-workflow.tmpl Outdated Show resolved Hide resolved
codegen/templates/endpoint.tmpl Show resolved Hide resolved

{{with .Method -}}
// {{$workflowInterface}} defines the interface for {{$serviceMethod}} workflow
type {{$workflowInterface}} interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interface should not be redeclared, it should be common b/w various workflows. program to interface and not to implementation.

@tejaswiagarwal tejaswiagarwal merged commit 6d20f85 into master Dec 18, 2019
@ChuntaoLu ChuntaoLu deleted the serverless-zanzibar branch July 8, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants