def occupy_port(context, port): """Execute target""" ChildTerminatingPopen( ["nc", "-l", "0.0.0.0", port], env=context.env, cwd=str(context.root_project_dir), )
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))
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))
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) )
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) )