示例#1
0
def occupy_port(context, port):
    """Execute  target"""
    ChildTerminatingPopen(
        ["nc", "-l", "0.0.0.0", port],
        env=context.env,
        cwd=str(context.root_project_dir),
    )
示例#2
0
def exec_viz_command(context, command):
    """Execute Kedro viz command """
    split_command = command.split()
    make_cmd = [context.kedro] + split_command

    context.result = ChildTerminatingPopen(make_cmd + ["--no-browser"],
                                           env=context.env,
                                           cwd=str(context.root_project_dir))
示例#3
0
def exec_notebook(context, command):
    """Execute Kedro Jupyter target."""
    split_command = command.split()
    cmd = [context.kedro, "jupyter"] + split_command

    # Jupyter notebook forks a child process from a parent process, and
    # only kills the parent process when it is terminated
    context.result = ChildTerminatingPopen(cmd,
                                           env=context.env,
                                           cwd=str(context.root_project_dir))
示例#4
0
def exec_notebook(context, command):
    """Execute Makefile target."""
    split_command = command.split()
    make_cmd = [context.kedro] + split_command

    # Jupyter notebook forks a child process from a parent process, and
    # only kills the parent process when it is terminated
    context.result = ChildTerminatingPopen(
        make_cmd + ["--no-browser"], env=context.env, cwd=str(context.root_project_dir)
    )
示例#5
0
def exec_kedro_target(context, command):
    """Execute Kedro target"""
    split_command = command.split()
    make_cmd = [context.kedro] + split_command

    if split_command[0] == "docker" and split_command[1] in ("ipython", "jupyter"):
        context.result = ChildTerminatingPopen(
            make_cmd, env=context.env, cwd=str(context.root_project_dir)
        )
    else:
        context.result = run(
            make_cmd, env=context.env, cwd=str(context.root_project_dir)
        )