diff --git a/beeflow/client/bee_client.py b/beeflow/client/bee_client.py index 7bc1b53e3..aa1789a93 100644 --- a/beeflow/client/bee_client.py +++ b/beeflow/client/bee_client.py @@ -22,9 +22,9 @@ import yaml from beeflow.common import config_driver -from beeflow.common.cli import NaturalOrderGroup +from beeflow.common.util.cli import NaturalOrderGroup from beeflow.common.connection import Connection -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.common.parser import CwlParser from beeflow.common.wf_data import generate_workflow_id from beeflow.client import core diff --git a/beeflow/client/core.py b/beeflow/client/core.py index 2ea24d912..d21d0cb2a 100644 --- a/beeflow/client/core.py +++ b/beeflow/client/core.py @@ -24,7 +24,7 @@ from beeflow.client import bee_client from beeflow.common.config_driver import BeeConfig as bc from beeflow.common import cli_connection -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.wf_manager.resources import wf_utils from beeflow.common.deps import container_manager diff --git a/beeflow/common/build/container_drivers.py b/beeflow/common/build/container_drivers.py index 555356dac..6323fc7b3 100644 --- a/beeflow/common/build/container_drivers.py +++ b/beeflow/common/build/container_drivers.py @@ -8,7 +8,7 @@ import subprocess import tempfile from beeflow.common.config_driver import BeeConfig as bc -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.build.utils import ContainerBuildError from beeflow.common.build.build_driver import BuildDriver from beeflow.common.crt.charliecloud_driver import CharliecloudDriver as crt_driver diff --git a/beeflow/common/build_interfaces.py b/beeflow/common/build_interfaces.py index 1aa1944a7..9c5fec397 100644 --- a/beeflow/common/build_interfaces.py +++ b/beeflow/common/build_interfaces.py @@ -13,7 +13,7 @@ from subprocess import CalledProcessError from beeflow.common.build.container_drivers import CharliecloudBuildDriver from beeflow.common.config_driver import BeeConfig as bc -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.build.utils import arg2task, ContainerBuildError diff --git a/beeflow/common/config_driver.py b/beeflow/common/config_driver.py index 3b26432a3..fdbce9bd8 100644 --- a/beeflow/common/config_driver.py +++ b/beeflow/common/config_driver.py @@ -11,9 +11,9 @@ import typer from beeflow.common.config_validator import ConfigValidator -from beeflow.common.cli import NaturalOrderGroup -from beeflow.common import validation -from beeflow.common.tab_completion import filepath_completion +from beeflow.common.util.cli import NaturalOrderGroup +from beeflow.common.util import validation +from beeflow.common.util.tab_completion import filepath_completion # System specific path set up diff --git a/beeflow/common/config_validator.py b/beeflow/common/config_validator.py index 9f4036fbc..247a7df79 100644 --- a/beeflow/common/config_validator.py +++ b/beeflow/common/config_validator.py @@ -1,6 +1,6 @@ """Config validation code.""" -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/crt/charliecloud_driver.py b/beeflow/common/crt/charliecloud_driver.py index c9218d230..c73487d48 100644 --- a/beeflow/common/crt/charliecloud_driver.py +++ b/beeflow/common/crt/charliecloud_driver.py @@ -10,7 +10,7 @@ from beeflow.common.config_driver import BeeConfig as bc from beeflow.common.build.utils import task2arg from beeflow.common.container_path import convert_path -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/db/tm_db.py b/beeflow/common/db/tm_db.py index 8e9666dc1..b66ecf5ab 100644 --- a/beeflow/common/db/tm_db.py +++ b/beeflow/common/db/tm_db.py @@ -4,7 +4,7 @@ import jsonpickle from beeflow.common.db import bdb -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.wf_data import TaskStateUpdate log = bee_logging.setup(__name__) diff --git a/beeflow/common/deps/container_manager.py b/beeflow/common/deps/container_manager.py index 8d3857844..3d2198790 100755 --- a/beeflow/common/deps/container_manager.py +++ b/beeflow/common/deps/container_manager.py @@ -7,7 +7,7 @@ import subprocess from beeflow.common.config_driver import BeeConfig as bc -from beeflow.common import paths +from beeflow.common.util import paths from celery import shared_task #noqa pylama can't find celery diff --git a/beeflow/common/deps/neo4j_manager.py b/beeflow/common/deps/neo4j_manager.py index df0c58cde..d87c61a7b 100644 --- a/beeflow/common/deps/neo4j_manager.py +++ b/beeflow/common/deps/neo4j_manager.py @@ -9,11 +9,11 @@ from beeflow.wf_manager.resources import wf_utils from beeflow.common.db import wfm_db -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.common.deps import container_manager from beeflow.common.config_driver import BeeConfig as bc -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging # Define directories within module scope bee_workdir = paths.workdir() diff --git a/beeflow/common/deps/redis_manager.py b/beeflow/common/deps/redis_manager.py index 68d8fd7d1..9f289621f 100644 --- a/beeflow/common/deps/redis_manager.py +++ b/beeflow/common/deps/redis_manager.py @@ -2,7 +2,7 @@ import os import subprocess -from beeflow.common import paths +from beeflow.common.util import paths def start(log): diff --git a/beeflow/common/gdb/gdb_driver.py b/beeflow/common/gdb/gdb_driver.py index 9218dc06e..226d6cc23 100644 --- a/beeflow/common/gdb/gdb_driver.py +++ b/beeflow/common/gdb/gdb_driver.py @@ -1,7 +1,7 @@ """Abstract base class for the handling of workflow DAGs.""" from abc import ABC, abstractmethod -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/gdb/neo4j_cypher.py b/beeflow/common/gdb/neo4j_cypher.py index 6a6cb1f1c..b90cd2cde 100644 --- a/beeflow/common/gdb/neo4j_cypher.py +++ b/beeflow/common/gdb/neo4j_cypher.py @@ -1,7 +1,7 @@ """Neo4j/Cypher transaction functions used by the Neo4jDriver class.""" from re import fullmatch -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/gdb/neo4j_driver.py b/beeflow/common/gdb/neo4j_driver.py index 48131a722..7ceb38a61 100644 --- a/beeflow/common/gdb/neo4j_driver.py +++ b/beeflow/common/gdb/neo4j_driver.py @@ -12,7 +12,7 @@ from beeflow.common.gdb import neo4j_cypher as tx from beeflow.common.wf_data import (Workflow, Task, Requirement, Hint, InputParameter, OutputParameter, StepInput, StepOutput) -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/cli.py b/beeflow/common/util/cli.py similarity index 100% rename from beeflow/common/cli.py rename to beeflow/common/util/cli.py diff --git a/beeflow/common/log.py b/beeflow/common/util/log.py similarity index 100% rename from beeflow/common/log.py rename to beeflow/common/util/log.py diff --git a/beeflow/common/paths.py b/beeflow/common/util/paths.py similarity index 100% rename from beeflow/common/paths.py rename to beeflow/common/util/paths.py diff --git a/beeflow/common/states.py b/beeflow/common/util/states.py similarity index 100% rename from beeflow/common/states.py rename to beeflow/common/util/states.py diff --git a/beeflow/common/tab_completion.py b/beeflow/common/util/tab_completion.py similarity index 100% rename from beeflow/common/tab_completion.py rename to beeflow/common/util/tab_completion.py diff --git a/beeflow/common/validation.py b/beeflow/common/util/validation.py similarity index 100% rename from beeflow/common/validation.py rename to beeflow/common/util/validation.py diff --git a/beeflow/common/wf_profiler.py b/beeflow/common/util/wf_profiler.py similarity index 100% rename from beeflow/common/wf_profiler.py rename to beeflow/common/util/wf_profiler.py diff --git a/beeflow/common/wf_interface.py b/beeflow/common/wf_interface.py index 8fe1054cd..495d30bdd 100644 --- a/beeflow/common/wf_interface.py +++ b/beeflow/common/wf_interface.py @@ -4,7 +4,7 @@ """ import re -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.gdb.neo4j_driver import Neo4jDriver log = bee_logging.setup(__name__) diff --git a/beeflow/common/worker/flux_worker.py b/beeflow/common/worker/flux_worker.py index 98624f052..17d332034 100644 --- a/beeflow/common/worker/flux_worker.py +++ b/beeflow/common/worker/flux_worker.py @@ -2,7 +2,7 @@ import io import os -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.worker.worker import Worker log = bee_logging.setup(__name__) diff --git a/beeflow/common/worker/slurm_worker.py b/beeflow/common/worker/slurm_worker.py index b8bc6207d..74765fa85 100644 --- a/beeflow/common/worker/slurm_worker.py +++ b/beeflow/common/worker/slurm_worker.py @@ -11,9 +11,9 @@ import requests_unixsocket import requests -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.worker.worker import (Worker, WorkerError) -from beeflow.common import validation +from beeflow.common.util import validation from beeflow.common.worker.utils import get_state_sacct from beeflow.common.worker.utils import parse_key_val diff --git a/beeflow/common/worker/utils.py b/beeflow/common/worker/utils.py index ab019fa4e..d38ce993b 100644 --- a/beeflow/common/worker/utils.py +++ b/beeflow/common/worker/utils.py @@ -2,7 +2,7 @@ import subprocess from beeflow.common.worker.worker import WorkerError -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging log = bee_logging.setup(__name__) diff --git a/beeflow/common/worker/worker.py b/beeflow/common/worker/worker.py index aa89de7ca..a11813b87 100644 --- a/beeflow/common/worker/worker.py +++ b/beeflow/common/worker/worker.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod import os -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.crt_interface import ContainerRuntimeInterface diff --git a/beeflow/remote/remote.py b/beeflow/remote/remote.py index 70cc6cf09..e74934dae 100644 --- a/beeflow/remote/remote.py +++ b/beeflow/remote/remote.py @@ -6,7 +6,7 @@ import uvicorn from beeflow.common import cli_connection -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.client import bee_client from beeflow.common.config_driver import BeeConfig as bc diff --git a/beeflow/scheduler/scheduler.py b/beeflow/scheduler/scheduler.py index 0e64c390e..8ca073ac0 100644 --- a/beeflow/scheduler/scheduler.py +++ b/beeflow/scheduler/scheduler.py @@ -12,7 +12,7 @@ from beeflow.scheduler import resource_allocation from beeflow.common.config_driver import BeeConfig as bc from beeflow.common.db import sched_db -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.db.bdb import connect_db diff --git a/beeflow/task_manager/background.py b/beeflow/task_manager/background.py index 58da80036..72d2ecb2f 100644 --- a/beeflow/task_manager/background.py +++ b/beeflow/task_manager/background.py @@ -6,7 +6,7 @@ import traceback import jsonpickle from beeflow.task_manager import utils -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.build.utils import ContainerBuildError from beeflow.common.build_interfaces import build_main from beeflow.common.worker import WorkerError diff --git a/beeflow/task_manager/task_actions.py b/beeflow/task_manager/task_actions.py index 505f158c0..eccaa04e4 100644 --- a/beeflow/task_manager/task_actions.py +++ b/beeflow/task_manager/task_actions.py @@ -2,7 +2,7 @@ import traceback from flask import jsonify, make_response from flask_restful import Resource -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.task_manager import utils log = bee_logging.setup(__name__) diff --git a/beeflow/task_manager/task_submit.py b/beeflow/task_manager/task_submit.py index b7148fafc..4913ff445 100644 --- a/beeflow/task_manager/task_submit.py +++ b/beeflow/task_manager/task_submit.py @@ -2,7 +2,7 @@ from flask import jsonify, make_response from flask_restful import Resource, reqparse import jsonpickle -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.task_manager import utils log = bee_logging.setup(__name__) diff --git a/beeflow/task_manager/utils.py b/beeflow/task_manager/utils.py index 3378c442e..07034bcdd 100644 --- a/beeflow/task_manager/utils.py +++ b/beeflow/task_manager/utils.py @@ -6,7 +6,7 @@ from beeflow.common.db import tm_db from beeflow.common.db import bdb from beeflow.common import worker -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.common.connection import Connection from beeflow.common.worker_interface import WorkerInterface diff --git a/beeflow/wf_manager/common/wf_db.py b/beeflow/wf_manager/common/wf_db.py deleted file mode 100644 index f54fa9d9f..000000000 --- a/beeflow/wf_manager/common/wf_db.py +++ /dev/null @@ -1,342 +0,0 @@ -"""Contains functions for managing a database for workflow and task information.""" - -import sqlite3 -from sqlite3 import Error -from collections import namedtuple -import os -from beeflow.common.config_driver import BeeConfig as bc - - -def create_connection(): - """Create a new connection with the workflow database.""" - db_file = os.path.join(bc.get('DEFAULT', 'bee_workdir'), 'workflow.db') - conn = None - try: - conn = sqlite3.connect(db_file) - return conn - except Error as error: - print(error) - return conn - - -def create_table(stmt): - """Create a new table in the database.""" - with create_connection() as conn: - try: - cursor = conn.cursor() - cursor.execute(stmt) - except Error as error: - print(error) - - -def run(stmt, params=None): - """Run the sql statement on the database. Doesn't return anything.""" - with create_connection() as conn: - try: - cursor = conn.cursor() - if params: - cursor.execute(stmt, params) - else: - cursor.execute(stmt) - conn.commit() - except Error as error: - print(error) - - -def get(stmt, params=None): - """Run the sql statement on the database and return the result.""" - with create_connection() as conn: - try: - cursor = conn.cursor() - if params: - cursor.execute(stmt, params) - else: - cursor.execute(stmt) - result = cursor.fetchall() - except Error: - result = None - return result - - -def table_exists(table_name): - """Return true if a table exists and false if not.""" - stmt = f"SELECT name FROM sqlite_master WHERE type='table' AND name='{table_name}';" - result = get(stmt) - return len(result) != 0 - - -def get_table_length(table): - """Return the number of rows in a table.""" - stmt = f"SELECT COUNT(*) from {table}" - result = get(stmt) - rows = result[0][0] - return rows - - -def init_info(): - """Insert a new workflow into the database.""" - stmt = """INSERT INTO info (wfm_port, tm_port, sched_port, num_workflows) - VALUES(?, ?, ?, ?);""" - run(stmt, [-1, -1, -1, 0]) - - -def init_tables(): - """Create the database.""" - # Create tables if they don't exist - # Create new database - workflows_stmt = """CREATE TABLE IF NOT EXISTS workflows ( - id INTEGER PRIMARY KEY, - -- Set workflow ID to unique. - workflow_id INTEGER UNIQUE, - name TEXT, - status TEST NOT NULL, - run_dir STR, - bolt_port INTEGER, - gdb_pid INTEGER, - init_task_id INTEGER);""" - - tasks_stmt = """CREATE TABLE IF NOT EXISTS tasks ( - id INTEGER PRIMARY KEY, - task_id INTEGER UNIQUE, - workflow_id INTEGER NOT NULL, - name TEXT, - resource TEXT, - status TEXT, - slurm_id INTEGER, - FOREIGN KEY (workflow_id) - REFERENCES workflows (workflow_id) - ON DELETE CASCADE - ON UPDATE NO ACTION);""" - - info_stmt = """CREATE TABLE IF NOT EXISTS info ( - id INTEGER PRIMARY KEY, - wfm_port INTEGER, - tm_port INTEGER, - sched_port INTEGER, - num_workflows INTEGER - );""" - - if not table_exists('workflows'): - create_table(workflows_stmt) - if not table_exists('tasks'): - create_table(tasks_stmt) - if not table_exists('info'): - create_table(info_stmt) - init_info() - - -Info = namedtuple("Info", "id wfm_port tm_port sched_port num_workflows") - - -def get_info(): - """Return an info object containing port information.""" - stmt = "SELECT * FROM info" - result = get(stmt) - info = Info(*result[0]) - return info - - -def get_wfm_port(): - """Return workflow manager port.""" - stmt = "SELECT wfm_port FROM info" - result = get(stmt) - wfm_port = result[0][0] - return wfm_port - - -def get_tm_port(): - """Return task manager port.""" - stmt = "SELECT tm_port FROM info" - result = get(stmt) - tm_port = result[0][0] - return tm_port - - -def get_sched_port(): - """Return scheduler port.""" - stmt = "SELECT sched_port FROM info" - result = get(stmt) - sched_port = result[0][0] - return sched_port - - -def get_num_workflows(): - """Return scheduler port.""" - stmt = "SELECT num_workflows FROM info" - result = get(stmt) - sched_port = result[0][0] - return sched_port - - -def increment_num_workflows(): - """Set workflow manager port.""" - stmt = "UPDATE info SET num_workflows = num_workflows + 1" - run(stmt) - - -def set_wfm_port(new_port): - """Set workflow manager port.""" - if not table_exists('info'): - # Initialize the database - init_tables() - - stmt = "UPDATE info SET wfm_port=?" - run(stmt, [new_port]) - - -def set_tm_port(new_port): - """Set workflow manager port.""" - if not table_exists('info'): - # Initialize the database - init_tables() - stmt = "UPDATE info SET tm_port=?" - run(stmt, [new_port]) - - -def set_sched_port(new_port): - """Set workflow manager port.""" - if not table_exists('info'): - # Initialize the database - init_tables() - stmt = "UPDATE info SET sched_port=?" - run(stmt, [new_port]) - - -def add_workflow(workflow_id, name, status, run_dir, bolt_port, gdb_pid): - """Insert a new workflow into the database.""" - if not table_exists('workflows'): - # Initialize the database - init_tables() - - stmt = ("INSERT INTO workflows (workflow_id, name, status, run_dir, bolt_port, gdb_pid) " - "VALUES(?, ?, ?, ?, ?, ?);" - ) - run(stmt, [workflow_id, name, status, run_dir, bolt_port, gdb_pid]) - - -def complete_gdb_init(workflow_id, gdb_pid): - """Complete the GDB init process for a workflow.""" - stmt = "UPDATE workflows SET gdb_pid=?, status=? WHERE workflow_id = ?" - run(stmt, [gdb_pid, 'Pending', workflow_id]) - - -def init_workflow(workflow_id, name, run_dir, bolt_port, http_port, https_port, init_task_id): - """Insert a new workflow into the database.""" - if not table_exists('workflows'): - # Initialize the database - init_tables() - - stmt = """INSERT INTO workflows (workflow_id, name, status, run_dir, bolt_port, - http_port, https_port, gdb_pid, init_task_id) - VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?);""" - run(stmt, [workflow_id, name, 'Initializing', run_dir, bolt_port, http_port, - https_port, -1, init_task_id]) - - -def update_workflow_state(workflow_id, status): - """Update the status in a workflow in the database.""" - stmt = "UPDATE workflows SET status=? WHERE workflow_id=?" - run(stmt, [status, workflow_id]) - - -Workflow = namedtuple("Workflow", "id workflow_id name status run_dir bolt_port gdb_pid") - - -def get_workflow_state(workflow_id): - """Return the bolt port associated with a workflow.""" - stmt = "SELECT state FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id])[0] - state = result[0] - return state - - -def get_bolt_port(workflow_id): - """Return the bolt port associated with a workflow.""" - stmt = "SELECT bolt_port FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id]) - result = get(stmt, [workflow_id])[0] - bolt_port = result[0] - return bolt_port - - -def get_gdb_pid(workflow_id): - """Return the bolt port associated with a workflow.""" - stmt = "SELECT gdb_pid FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id])[0] - gdb_pid = result[0] - return gdb_pid - - -def get_init_task_id(workflow_id): - """Return the task ID for the GDB initialization.""" - stmt = "SELECT init_task_id FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id])[0] - return result[0] - - -def get_run_dir(workflow_id): - """Return the bolt port associated with a workflow.""" - stmt = "SELECT run_dir FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id])[0] - run_dir = result[0] - return run_dir - - -def get_workflow(workflow_id): - """Return a workflow object.""" - stmt = "SELECT * FROM workflows WHERE workflow_id=?" - result = get(stmt, [workflow_id])[0] - workflow = Workflow(*result) - return workflow - - -def get_workflows(): - """Return a list of all the workflows.""" - stmt = "SELECT * FROM workflows" - result = get(stmt) - workflows = [Workflow(*workflow) for workflow in result] - return workflows - - -def add_task(task_id, workflow_id, name, status): - """Add a task to the database associated with the workflow id specified.""" - stmt = "INSERT INTO tasks (task_id, workflow_id, name, resource, status,"\ - "slurm_id) VALUES(?, ?, ?, ?, ?, ?)" - run(stmt, [task_id, workflow_id, name, "", status, -1]) - - -Task = namedtuple("Task", "id task_id workflow_id name resource status" - " slurm_id") - - -def get_tasks(workflow_id): - """Get all tasks associated with a particular workflow.""" - stmt = "SELECT * FROM tasks WHERE workflow_id=?" - result = get(stmt, [workflow_id]) - tasks = [Task(*task) for task in result] - return tasks - - -def delete_workflow(workflow_id): - """Delete a workflow from the database.""" - stmt = "DELETE FROM workflows WHERE workflow_id=?" - run(stmt, [workflow_id]) - - -def update_task_state(task_id, workflow_id, status): - """Update the state of a task.""" - stmt = "UPDATE tasks SET status=? WHERE task_id=? AND workflow_id=? " - run(stmt, [status, task_id, workflow_id]) - - -def get_task(task_id, workflow_id): - """Get a task associed with a workflow.""" - stmt = "SELECT * FROM task WHERE task_id=? AND workflow_id=?" - result = get(stmt, [task_id, workflow_id]) - return result - - -def delete_task(task_id, workflow_id): - """Delete a task associed with a workflow.""" - stmt = "DELETE FROM tasks WHERE task_id=? AND workflow_id=?" - run(stmt, [task_id, workflow_id]) diff --git a/beeflow/wf_manager/resources/wf_actions.py b/beeflow/wf_manager/resources/wf_actions.py index 30b0d6285..ea9f12123 100644 --- a/beeflow/wf_manager/resources/wf_actions.py +++ b/beeflow/wf_manager/resources/wf_actions.py @@ -4,7 +4,7 @@ from flask import make_response, jsonify from flask_restful import Resource, reqparse -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.wf_manager.resources import wf_utils from beeflow.common.db import wfm_db diff --git a/beeflow/wf_manager/resources/wf_list.py b/beeflow/wf_manager/resources/wf_list.py index e188bb7ff..b65f12a90 100644 --- a/beeflow/wf_manager/resources/wf_list.py +++ b/beeflow/wf_manager/resources/wf_list.py @@ -12,8 +12,8 @@ from flask_restful import Resource, reqparse from celery import shared_task # noqa (pylama can't find celery imports) -from beeflow.common import log as bee_logging -# from beeflow.common.wf_profiler import WorkflowProfiler +from beeflow.common.util import log as bee_logging +# from beeflow.common.util.wf_profiler import WorkflowProfiler from beeflow.wf_manager.resources import wf_utils from beeflow.common import wf_data diff --git a/beeflow/wf_manager/resources/wf_metadata.py b/beeflow/wf_manager/resources/wf_metadata.py deleted file mode 100644 index 4e7872a58..000000000 --- a/beeflow/wf_manager/resources/wf_metadata.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Workflow endpoints for getting metadata.""" - -from flask import make_response, jsonify -from flask_restful import Resource -from beeflow.wf_manager.common import wf_db - - -class WFMetadata(Resource): - """Class for getting metadata.""" - - def get(self, wf_id): - """Get and return metadata.""" - # For now, just get the bolt port. Later we may want to add more information here. - bolt_port = wf_db.get_bolt_port(wf_id) - metadata = { - 'bolt_port': bolt_port, - } - return make_response(jsonify(metadata), 200) diff --git a/beeflow/wf_manager/resources/wf_update.py b/beeflow/wf_manager/resources/wf_update.py index 6202e32f7..932a3a3b4 100644 --- a/beeflow/wf_manager/resources/wf_update.py +++ b/beeflow/wf_manager/resources/wf_update.py @@ -10,7 +10,7 @@ from flask import make_response, jsonify from flask_restful import Resource, reqparse from beeflow.wf_manager.resources import wf_utils -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.db import wfm_db from beeflow.common.db.bdb import connect_db diff --git a/beeflow/wf_manager/resources/wf_utils.py b/beeflow/wf_manager/resources/wf_utils.py index d7b46fb37..c03751adc 100644 --- a/beeflow/wf_manager/resources/wf_utils.py +++ b/beeflow/wf_manager/resources/wf_utils.py @@ -5,12 +5,12 @@ import requests import jsonpickle -from beeflow.common import log as bee_logging +from beeflow.common.util import log as bee_logging from beeflow.common.config_driver import BeeConfig as bc from beeflow.common.gdb import neo4j_driver from beeflow.common.wf_interface import WorkflowInterface from beeflow.common.connection import Connection -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.common.db import wfm_db from beeflow.common.db.bdb import connect_db diff --git a/beeflow/wf_manager/wf_manager.py b/beeflow/wf_manager/wf_manager.py index 8134955a0..961935ff4 100644 --- a/beeflow/wf_manager/wf_manager.py +++ b/beeflow/wf_manager/wf_manager.py @@ -5,10 +5,9 @@ from celery import Celery # noqa (pylama can't find celery imports) from celery import shared_task #noqa from beeflow.common.api import BeeApi -from beeflow.common import paths +from beeflow.common.util import paths from beeflow.wf_manager.resources.wf_list import WFList from beeflow.wf_manager.resources.wf_actions import WFActions -from beeflow.wf_manager.resources.wf_metadata import WFMetadata from beeflow.wf_manager.resources.wf_update import WFUpdate from beeflow.wf_manager.resources import wf_utils @@ -21,7 +20,6 @@ def create_app(): # Add endpoints api.add_resource(WFList, '/bee_wfm/v1/jobs/') api.add_resource(WFActions, '/bee_wfm/v1/jobs/') - api.add_resource(WFMetadata, '/bee_wfm/v1/jobs//metadata') api.add_resource(WFUpdate, '/bee_wfm/v1/jobs/update/') # Initialize celery app diff --git a/coverage.svg b/coverage.svg index 012a8497e..ffd257bde 100644 --- a/coverage.svg +++ b/coverage.svg @@ -15,7 +15,7 @@ coverage coverage - 70% - 70% + 71% + 71%