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

Add refKey to process map and execution #1557

Closed
NicolasMahe opened this issue Dec 12, 2019 · 2 comments
Closed

Add refKey to process map and execution #1557

NicolasMahe opened this issue Dec 12, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@NicolasMahe
Copy link
Member

NicolasMahe commented Dec 12, 2019

Currently, the map node of the process is using nodeKey to reference from which node the mapping should be done against.
The problem is only execution nodes can be reference from the map.
My suggestion is to add a new refKey parameter only to the Task node and rename nodeKey to refKey in the Reference struct.
Like this, by construction, it's only possible to reference the output of an execution and nothing else!

Change to do in protobuf/types/process.proto:

    message Task {
      // Hash of the instance to execute.
      bytes instanceHash = 2 [
        (gogoproto.moretags) = 'hash:"name:2" validate:"required"',
        (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash",
        (gogoproto.nullable) = false
      ];

      // Task of the instance to execute.
      string taskKey = 3 [
        (gogoproto.moretags) = 'hash:"name:3" validate:"printascii,required"'
      ];

+      // RefKey of this execution's node. Must to set to reference an output of this task from a map node.
+      string refKey = 1 [
+        (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
+      ];
    }
        message Reference {
-          // Key of the node in the graph. If empty, will be using the src of the edge.
-          string nodeKey = 1 [
+          // RefKey of the execution's node in the graph.
+          string refKey = 1 [
            (gogoproto.moretags) = 'hash:"name:1" validate:"printascii"'
          ];

          // Key of a specific parameter of the referenced node's output data.
          string key = 2 [
            (gogoproto.moretags) = 'hash:"name:2" validate:"required"'
          ];
        }
@NicolasMahe NicolasMahe added the enhancement New feature or request label Dec 12, 2019
@NicolasMahe
Copy link
Member Author

Some correction about this issue:
The refKey is not required either in the task or in the reference.
If it is not set in the task, then this task's output cannot be referenced.
If it is not set in the reference message, then the reference should be done against the previous node outputs (outputs variable in the orchestrator file)

@antho1404
Copy link
Member

See comment on the associated PR #1558 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants