Git Product home page Git Product logo

Comments (7)

Abhishekghosh1998 avatar Abhishekghosh1998 commented on September 27, 2024 1

@dimgiagos44 Did you find any solution to this issue?
In my situation:

// Define provide definition of the workflow
func Define(flow *faasflow.Workflow, context *faasflow.Context) (err error) {
	dag := flow.Dag()
	dag.Node("n1").Apply("func1")
	dag.Node("n2").Apply("func2") 
	dag.Edge("n1", "n2")
	return
}

When I try to invoke this flow as:

$ echo "test" | faas-cli invoke async-chain

I get nothing on the terminal.

from faas-flow.

dimgiagos44 avatar dimgiagos44 commented on September 27, 2024 1

You can try storing the result in a db instance through the second function and persist it there. E.g., Redis, Minio, etc
@Abhishekghosh1998

from faas-flow.

dimgiagos44 avatar dimgiagos44 commented on September 27, 2024 1

inside the last function, write some code to store the result in a remote storage like Minio

from faas-flow.

Abhishekghosh1998 avatar Abhishekghosh1998 commented on September 27, 2024

@dimgiagos44 I tried your hack.
The log for the function:

2023-10-14T04:40:53Z 2023/10/14 04:40:53 Version: 0.9.12        SHA: 5d4cadcaf595f3d3d213e08cdd38a310c5bb3066
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Forking: ./handler, arguments: []
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Started logging: stderr from function.
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Started logging: stdout from function.
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Watchdog mode: http    fprocess: "./handler"
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Timeouts: read: 30s write: 30s hard: 30s health: 30s
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Listening on port: 8080
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Writing lock-file to: /tmp/.lock
2023-10-14T04:40:53Z 2023/10/14 04:40:53 Metrics listening on port: 8081
2023-10-14T04:40:53Z 2023/10/14 04:40:53 stderr: 2023/10/14 04:40:53 Using default state store (consul)
2023-10-14T04:40:53Z 2023/10/14 04:40:53 stderr: 2023/10/14 04:40:53 Using default data store (minio)
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stderr: 2023/10/14 04:41:10 Executing flow 10
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Created
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout:  StateStore overridden DataStore overridden[Request `ckl1npnerlqs71prejd0`] DAG state initiated at StateStore
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Executing node 0_1_n1
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Executing function `func1`
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Completed execution of Node 0_1_n1
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Intermediate result from Node 0_1_n1 to 0_2_n2 stored as 0_1_n1--0_2_n2
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] performing request for Node 0_2_n2, indegree count is 1
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: http://gateway.openfaas:8080/async-function/async-chainckl1npnerlqs71prejd0
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: &{POST http://gateway.openfaas:8080/async-function/async-chain/flow/ckl1npnerlqs71prejd0/forward HTTP/1.1 1 1 map[Accept:[application/json] Content-Type:[application/json] X-Faas-Flow-Callback-Url:[] X-Faas-Flow-Reqid:[ckl1npnerlqs71prejd0]] {0xc0002870b0} 0x675c10 270 [] false gateway.openfaas:8080 map[] map[] <nil> map[]   <nil> <nil> <nil> 0xc0000b4010}
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Request submitted for Node 0_2_n2
2023-10-14T04:41:10Z 2023/10/14 04:41:10 POST / - 200 OK - ContentLength: 0B (0.0965s)
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stderr: 2023/10/14 04:41:10 Partially executing flow 10, for id ckl1npnerlqs71prejd0
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Received
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout:  StateStore overridden DataStore overridden[Request `ckl1npnerlqs71prejd0`] Intermediate result from Node 0_1_n1 to Node 0_2_n2 retrieved from 0_1_n1--0_2_n2
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Executing node 0_2_n2
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Executing function `func2`
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Completed execution of Node 0_2_n2
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Completed successfully
2023-10-14T04:41:10Z 2023/10/14 04:41:10 stdout: [Request `ckl1npnerlqs71prejd0`] Calling completion handler
2023-10-14T04:41:10Z 2023/10/14 04:41:10 POST /flow/ckl1npnerlqs71prejd0/forward - 200 OK - ContentLength: 91B (0.0444s)

I see it is completed, but where do we retrieve the final result (of 91B here) from?

from faas-flow.

Abhishekghosh1998 avatar Abhishekghosh1998 commented on September 27, 2024

@dimgiagos44 Without changing the second function...? Does FaaS-Flow provide the same facility? Like it internally writes to some database or storage system, which we can later retrieve?

from faas-flow.

dimgiagos44 avatar dimgiagos44 commented on September 27, 2024

Yes exactly, internally write to some db...its a hacky approach but it is what it is

from faas-flow.

Abhishekghosh1998 avatar Abhishekghosh1998 commented on September 27, 2024

internally write to some db

@dimgiagos44 Did not get it... :(

Like I mean, I do not want to modify my function code for function1 or function2. Does FaaS-Flow allow us to get the final output without attaching some callback...

from faas-flow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.