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

Nested foreach fails at runtime, but validation succeeds #246

Open
sebastianrosch opened this issue Feb 13, 2019 · 2 comments
Open

Nested foreach fails at runtime, but validation succeeds #246

sebastianrosch opened this issue Feb 13, 2019 · 2 comments

Comments

@sebastianrosch
Copy link

I have a workflow with a nested foreach.
The workflow passes validation, the following call does not return any output:

fission wf validate nested.wf.yaml

Creating the workflow works:

fission fn create --name nested --env workflow --src nested.wf.yaml

When running the workflow with

curl ${FISSION_ROUTER}/fission-function/nested

it fails with input 'do' is not a validType type (expected: [fission.workflows.types.TaskSpec], was: string)

Are nested foreach supported? Or is there something wrong with my workflow definition?

nested.wf.yaml:

apiVersion: 1
output: Iterate
tasks:

  # Builds a list of details
  BuildObjects:
    run: foreach
    inputs:
      foreach: ["test","test2","test3"]
      do:
        run: compose
        inputs:
          parentInvocationId: "{$.Invocation.Id}"
          name: "task().element"
          resources: ["r1","r2"]

  # Iterates over all objects and their resources
  Iterate:
    run: foreach
    inputs:
      foreach: "{$.Tasks.BuildObjects.Output}"
      do:
        run: foreach
        inputs:
          foreach: "{task().Inputs._item.resources}"
          do:
            run: nop
            inputs: "{ task().element }"
    requires:
      - BuildObjects

$ fission --version
client:
  fission/core:
    gitcommit: ee988f5a8b423926056f64bc64b5a8ed516a7261
    builddate: 2019-02-08T12:57:56Z
    version: "1.0"
  workflows:
    gitcommit: ""
    builddate: ""
    version: 0.6.0
server:
  fission/core:
    gitcommit: ee988f5a8b423926056f64bc64b5a8ed516a7261
    builddate: 2019-02-08T12:57:56Z
    version: "1.0"
@erwinvaneyk
Copy link
Member

Hi @sebastianroesch - nested foreach-es should work. However, foreach is really a prototype feature right now, so this might be a bug. I will look into it.

@erwinvaneyk
Copy link
Member

Seems related to #196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants