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

DSL Condition Feature/Bug #481

Closed
gaoning777 opened this issue Dec 5, 2018 · 2 comments
Closed

DSL Condition Feature/Bug #481

gaoning777 opened this issue Dec 5, 2018 · 2 comments

Comments

@gaoning777
Copy link
Contributor

gaoning777 commented Dec 5, 2018

For example:

import kfp.dsl as dsl

class FlipCoinOp(dsl.ContainerOp):

  def __init__(self, name):
    super(FlipCoinOp, self).__init__(
        name=name,
        image='python:alpine3.6',
        command=['sh', '-c'],
        arguments=['python -c "import random; result = \'heads\' if random.randint(0,1) == 0 '
                   'else \'tails\'; print(result)" | tee /tmp/output'],
        file_outputs={'output': '/tmp/output'})


class PrintOp(dsl.ContainerOp):

  def __init__(self, name):
    super(PrintOp, self).__init__(
        name=name,
        image='alpine:3.6',
        command=['echo', '"it was tail"'])


@dsl.pipeline(
    name='pipeline flip coin loop',
    description='shows how to use dsl.Loop.'
)
def flipcoinloop():
  flip = FlipCoinOp('flip')

  with dsl.Condition(flip.output=='tails'):
    PrintOp('tails')
    flip = FlipCoinOp('flip2')

  with dsl.Condition(flip.output=='heads'):
    PrintOp('heads')

if __name__ == '__main__':
  import kfp.compiler as compiler
  compiler.Compiler().compile(flipcoinloop, __file__ + '.tar.gz')

When users use the 'flip' variable a second time, the generated execution turns out to be:
screenshot from 2018-12-05 13-56-18

@rileyjbauer
Copy link
Contributor

It sounds like you just need to update your UI pod. There were some changes made in #293 that changed how the frontend generated these graphs (in sync with a change to the way the DSL compiled conditional pipelines). The most up-to-date UI shows the following. Let me know if this doesn't seem right:
image

@gaoning777
Copy link
Contributor Author

Cool. Thanks Riley

Linchin pushed a commit to Linchin/pipelines that referenced this issue Apr 11, 2023
* Fix bugs with cleanup of deployments and clusters

* Disable cache discovery in cleanup_ci.

* Fix kubeflow#480

* Add a K8s batch job to make it easy to do one off runs of the cleanup script.

* update the playbook.

* Stop using the delete_deployment script; its very outdated and is causing
  problems.

  Instead lets just issue a delete for the deployment and if that fails to
  properly GC everything we can rely on cleanup_ci.py

  * We should really be trying to use kfctl to delete things.

* Split up cleanup_deployments into 2 functions one for clusters and one
  for deployments.

* Log cleanup ops.
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this issue Mar 11, 2024
* KFP 1.4.0 Rebase

Resolves kubeflow#469

* Remove duplicated KFP samples

* Resolve api and backend and SDK test conflicts

* Upgrade kfp requirements to 1.4.0

* Update testdata regenerate YAML files

* Resolve CONTRIBUTING.md

* Regenerate KFP samples compile report

* Update README.md files for KFP version 1.4.0

* Resolve frontend conflicts

* Revert list-wrapped loop arguments

* Remove compiler_tests.py.rej
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

4 participants