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

[Serving] Support for graph step input/result redirection #1330

Merged
merged 7 commits into from
Sep 23, 2021

Conversation

yaronha
Copy link
Collaborator

@yaronha yaronha commented Sep 19, 2021

storey steps usually receive the entire event and return the entire event, it accepts input_path and result_path parameters to control which portion of the event goes into the step, and where is the result written to allowing for greater flexibility.

This PR add support of input_path and result_path and add the same behavior to sync engine and to remote steps.

Usage example:

def mul(x):
     return x*2

function = mlrun.new_function("multiply", kind="serving")
flow = function.set_topology("flow")

# function input will be event["x"] and result will be written to event["y"]["z"]
flow.to(handler=mul, name="x2", input_path="x", result_path="y.z").respond()

server = function.to_mock_server()
resp = server.test(body={"x": 5})

# expect y.z = x * 2 = 10
# resp == {"x": 5, "y": {"z": 10}}

@yaronha yaronha changed the title [Serving] add support for storey input/result_path (redirect step input/output) [Serving] add support for graph step input/result redirection Sep 19, 2021
@Hedingber Hedingber changed the title [Serving] add support for graph step input/result redirection [Serving] Support for graph step input/result redirection Sep 23, 2021
@Hedingber Hedingber merged commit d51ab29 into mlrun:development Sep 23, 2021
@yaronha yaronha deleted the graph-inout-paths branch November 2, 2021 15:49
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

2 participants