Skip to content

@kubernetes decorator should be ignored when running flows locally #2588

@SimonOlenik

Description

@SimonOlenik

Currently, when I decorate a step with @kubernetes(...), the step always tries to execute on Kubernetes — even when I simply run the flow locally with:
python myflow.py run

This is very inconvenient for local development:

  • With @resources(cpu=1, memory=2000) the flow runs locally and when we deploy it to argo workflows it also works (unfortunately limits are not set to pods so we need to use kubernetes decorator and qos='Guaranteed' ).
  • With @kubernetes(cpu=1, memory=2000, qos='Guaranteed') the flow immediately tries to schedule pods on the cluster, which breaks local iteration.

Expected behaviour

  • The @kubernetes decorator should be inactive when running locally (e.g. with python flow.py run) and only take effect when running with --with kubernetes.
  • This would match how @batch, @step, and @resources behave — they do not break local execution.

Is currently any way to achieve expected behaviour?

Suggested solution

  • Adjust the Kubernetes decorator plugin so that if the flow is being run with the local runner (python flow.py run), the decorator is a no-op.

Thank you in advance for any input on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions