Skip to content

Commit

Permalink
Refactor some notification service implements and directories (flink-…
Browse files Browse the repository at this point in the history
…extended#371)

* Refactor Notification Service
  • Loading branch information
jiangxin369 committed Sep 7, 2022
1 parent 69cad8d commit 1e365e6
Show file tree
Hide file tree
Showing 126 changed files with 5,098 additions and 5,760 deletions.
2 changes: 1 addition & 1 deletion ai_flow/cli/commands/task_manager_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
import signal

from notification_service.embedded_notification_client import EmbeddedNotificationClient
from notification_service.client.embedded_notification_client import EmbeddedNotificationClient

from ai_flow.common.configuration import config_constants
from ai_flow.blob_manager.blob_manager_interface import BlobManagerFactory, BlobManagerConfig
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import abc
from typing import List

from notification_service.event import EventKey, Event
from notification_service.model.event import EventKey, Event

from ai_flow.model.context import Context

Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/internal/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
import json

from notification_service.event import EventKey, Event
from notification_service.model.event import EventKey, Event
from typing import List

from ai_flow.model.condition import Condition
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/internal/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from enum import Enum
import json
from notification_service.event import Event, EventKey, DEFAULT_NAMESPACE
from notification_service.model.event import Event, EventKey, DEFAULT_NAMESPACE

from ai_flow.model.status import TaskStatus

Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from typing import Dict, Optional

from notification_service.event import EventKey
from notification_service.model.event import EventKey

from ai_flow.model.action import TaskAction
from ai_flow.model.condition import Condition
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from notification_service.event import Event
from notification_service.model.event import Event
from typing import Optional

from ai_flow.model.action import TaskAction
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/model/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Dict, List, Optional

from notification_service.event import EventKey, Event
from notification_service.model.event import EventKey

from ai_flow.model.action import TaskAction
from ai_flow.model.condition import Condition
Expand Down
4 changes: 2 additions & 2 deletions ai_flow/rpc/client/aiflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# specific language governing permissions and limitations
# under the License.
#
from notification_service.embedded_notification_client import EmbeddedNotificationClient
from notification_service.event import DEFAULT_NAMESPACE
from notification_service.client.embedded_notification_client import EmbeddedNotificationClient
from notification_service.model.event import DEFAULT_NAMESPACE

from ai_flow.rpc.client.scheduler_client import SchedulerClient

Expand Down
4 changes: 2 additions & 2 deletions ai_flow/rpc/service/scheduler_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import time
from typing import List

from notification_service.event import Event
from notification_service.notification_client import ListenerProcessor
from notification_service.model.event import Event
from notification_service.client.notification_client import ListenerProcessor

from ai_flow.common.env import get_aiflow_home
from ai_flow.model.status import WORKFLOW_ALIVE_SET, WorkflowStatus, WORKFLOW_FINISHED_SET, TaskStatus
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json
import logging

from notification_service.event import Event
from notification_service.model.event import Event
from typing import List

from ai_flow.common.exception.exceptions import AIFlowException
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/rule_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
import cloudpickle
import logging
from notification_service.event import Event
from notification_service.model.event import Event
from typing import Optional

from ai_flow.metadata.metadata_manager import MetadataManager
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/rule_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from copy import deepcopy
from typing import List, Dict, Set, Tuple

from notification_service.event import Event, EventKey
from notification_service.model.event import Event, EventKey

from ai_flow.common.util.db_util.session import create_session
from ai_flow.common.util.json_utils import is_valid_json
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
import sys

from notification_service.event import Event
from notification_service.model.event import Event

from ai_flow.common.configuration import config_constants
from ai_flow.scheduler.dispatcher import Dispatcher
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/scheduling_event_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from typing import Union

import cloudpickle
from notification_service.event import Event
from notification_service.model.event import Event

from ai_flow.metadata.metadata_manager import MetadataManager
from ai_flow.model.action import TaskAction
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/scheduling_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Union, Tuple, Optional

from notification_service.event import Event
from notification_service.model.event import Event

from ai_flow.scheduler.rule_wrapper import WorkflowExecutionRuleWrapper, WorkflowRuleWrapper

Expand Down
2 changes: 1 addition & 1 deletion ai_flow/scheduler/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import queue
import threading

from notification_service.event import Event
from notification_service.model.event import Event
from ai_flow.common.util.db_util.session import create_session
from ai_flow.metadata.metadata_manager import MetadataManager
from ai_flow.model.action import TaskAction
Expand Down
2 changes: 1 addition & 1 deletion ai_flow/task_executor/common/heartbeat_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from concurrent import futures

import grpc
from notification_service.embedded_notification_client import EmbeddedNotificationClient
from notification_service.client.embedded_notification_client import EmbeddedNotificationClient

from ai_flow.common.configuration.config_constants import NOTIFICATION_SERVER_URI
from ai_flow.common.util.db_util.session import create_session
Expand Down
6 changes: 2 additions & 4 deletions ai_flow/task_executor/common/task_executor_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from queue import Empty
from typing import Optional

from notification_service.embedded_notification_client import EmbeddedNotificationClient
from ai_flow.rpc.client.aiflow_client import get_notification_client

from ai_flow.common.util.db_util.session import create_session
from ai_flow.metadata.metadata_manager import MetadataManager
Expand Down Expand Up @@ -61,9 +61,7 @@ def schedule_task(self, command: TaskScheduleCommand):

def start(self):
logging.info("starting task executor.")
self.notification_client = EmbeddedNotificationClient(
server_uri=NOTIFICATION_SERVER_URI, namespace='task_status_change', sender='task_executor'
)
self.notification_client = get_notification_client(namespace='task_status_change', sender='task_executor')
self.command_queue = PersistentQueue(maxsize=MAX_QUEUE_SIZE)
self.command_processor.start()
self.heartbeat_manager = HeartbeatManager()
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/notification_service/bin/start_notification_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from notification_service.server import NotificationServerRunner
from notification_service.server_config import NotificationServerConfig
from notification_service.util import db
from notification_service.util.config import create_server_config
from notification_service.util.server_config import create_server_config


def _prepare_args():
Expand Down
2 changes: 1 addition & 1 deletion lib/notification_service/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<version>0.4-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.27.2</grpc.version>
<grpc.version>1.35.0</grpc.version>
<protobuf.version>3.11.0</protobuf.version>
<protoc.version>3.11.0</protoc.version>
<commons.lang3.version>3.9</commons.lang3.version>
Expand Down
Loading

0 comments on commit 1e365e6

Please sign in to comment.