question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom task condition doesn't generate status result in some cases

See original GitHub issue

/kind bug

What steps did you take and what happened: The below example doesn’t generate the condition status for the first custom task.

from kfp import dsl
from kfp_tekton.tekton import CEL_ConditionOp


@dsl.pipeline("example-ab")
def example_ab(num: int = 42):
  isNumZero = CEL_ConditionOp(f"{num} == 0").output
  zero = CEL_ConditionOp(f"0").output

@dsl.pipeline("example-ba")
def example_ba(num: int = 42):
  zero = CEL_ConditionOp(f"0").output
  isNumZero = CEL_ConditionOp(f"{num} == 0").output

def main():
  from kfp_tekton.compiler import TektonCompiler as Compiler
  Compiler().compile(example_ab, __file__.replace('.py', '-ab.yaml'))
  Compiler().compile(example_ba, __file__.replace('.py', '-ba.yaml'))

if __name__ == '__main__':
  main()

outputs: Note that the first cel-condition custom task didn’t generate the condition statement as status.

spec:
  params:
  - name: num
    value: '42'
  pipelineSpec:
    params:
    - name: num
      default: '42'
    tasks:
    - name: cel-condition
      taskRef:
        name: cel_condition
        apiVersion: cel.tekton.dev/v1alpha1
        kind: CEL
    - name: cel-condition-2
      params:
      - name: status
        value: $(params.num) == 0
      taskRef:
        name: cel_condition
        apiVersion: cel.tekton.dev/v1alpha1
        kind: CEL
  timeout: 0s

What did you expect to happen:

Additional information: [Miscellaneous information that will assist in solving the issue.]

Environment:

  • Python Version (use python --version):
  • SDK Version:
  • Tekton Version (use tkn version):
  • Kubernetes Version (use kubectl version):
  • OS (e.g. from /etc/os-release):

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Tomclicommented, Apr 19, 2021

@Udiknedormin I reverted back to 6adfcc64f3c4deb0a90411b9f72347d6cc418e6d but still don’t see this issue. Probably it happened when it was in the old PR stage. Since then, I did some bug fixes on the custom task such as fixing the regex on parameter mapping b74d4a5cbf71fbe64677cf55693973a48a6b669c.

0reactions
google-oss-robotcommented, Apr 28, 2021

@Tomcli: Closing this issue.

In response to this:

/close reopen it if this issue still exist

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

azure devops - run task when previous failed or timed out
It is possible to add a custom condition. If you want the task to be executed when previous task failed or skipped, you...
Read more >
Conditions - Azure Pipelines | Microsoft Learn
Learn about how you can write custom conditions in Azure Pipelines or Team Foundation Server (TFS).
Read more >
azure pipelines failed task does not stop pipeline
In your case, your custom condition doesn't consider the state of any other node so it should be run regardless of how previous...
Read more >
do...while - JavaScript - MDN Web Docs - Mozilla
The condition is evaluated after executing the statement, resulting in the ... In some cases, it can make sense to use an assignment...
Read more >
Customize pipeline configuration - GitLab Docs
Other users, including guest users, can only view the status of pipelines and jobs, ... To get the coverage report from a specific...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found