Ejemplo n.º 1
0
 def test_get_root_caller_filename(self):
     func_name = utils.workflow_filename()
     # Here we assume that we are using `pytest` or `python -m pytest`
     # to trigger the unit tests.
     self.assertTrue(func_name in ["pytest", "runpy"])
Ejemplo n.º 2
0
from collections import OrderedDict

from couler.core import utils
from couler.core.templates import Workflow

_sub_steps = None
# Argo DAG task
_update_steps_lock = True
_run_concurrent_lock = False
_concurrent_func_line = -1
# Identify concurrent functions have the same name
_concurrent_func_id = 0
# We need to fetch the name before triggering atexit, as the atexit handlers
# cannot get the original Python filename.
workflow_filename = utils.workflow_filename()
workflow = Workflow(workflow_filename=workflow_filename)
# '_when_prefix' represents 'when' prefix in Argo YAML. For example,
# https://github.com/argoproj/argo/blob/master/examples/README.md#conditionals
_when_prefix = None
_when_task = None
# '_condition_id' records the line number where the 'couler.when()' is invoked.
_condition_id = None
# '_while_steps' records the step of recursive logic
_while_steps: OrderedDict = OrderedDict()
# '_while_lock' indicts the recursive call start
_while_lock = False
# dependency edges
_upstream_dag_task = None
# dag function caller line
_dag_caller_line = None