Skip to content

Commit

Permalink
move opc_writer_sink block to enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz-roboflow committed Nov 28, 2024
1 parent b359236 commit 8e0144a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 5 deletions.
2 changes: 0 additions & 2 deletions inference/core/workflows/core_steps/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@
EmailNotificationBlockV1,
)
from inference.core.workflows.core_steps.sinks.local_file.v1 import LocalFileSinkBlockV1
from inference.core.workflows.core_steps.sinks.opc_writer.v1 import OPCWriterSinkBlockV1
from inference.core.workflows.core_steps.sinks.roboflow.custom_metadata.v1 import (
RoboflowCustomMetadataBlockV1,
)
Expand Down Expand Up @@ -541,7 +540,6 @@ def load_blocks() -> List[Type[WorkflowBlock]]:
DataAggregatorBlockV1,
CSVFormatterBlockV1,
EmailNotificationBlockV1,
OPCWriterSinkBlockV1,
LocalFileSinkBlockV1,
TraceVisualizationBlockV1,
ReferencePathVisualizationBlockV1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
from packaging.specifiers import SpecifierSet
from packaging.version import Version

from inference.core.env import LAMBDA
from inference.core.workflows.core_steps.loader import (
KINDS_DESERIALIZERS,
KINDS_SERIALIZERS,
REGISTERED_INITIALIZERS,
load_blocks,
load_kinds,
)
from inference.enterprise.workflows.enterprise_steps.loader import (
load_enterprise_blocks,
)
from inference.core.workflows.errors import (
PluginInterfaceError,
PluginLoadingError,
Expand Down Expand Up @@ -150,6 +154,8 @@ def load_workflow_blocks(
@lru_cache()
def load_core_workflow_blocks() -> List[BlockSpecification]:
core_blocks = load_blocks()
if not LAMBDA:
core_blocks.extend(load_enterprise_blocks())
already_spotted_blocks = set()
result = []
for block in core_blocks:
Expand Down
File renamed without changes.
Empty file.
10 changes: 10 additions & 0 deletions inference/enterprise/workflows/enterprise_steps/loader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import List, Type

from inference.enterprise.workflows.enterprise_steps.sinks.opc_writer.v1 import OPCWriterSinkBlockV1
from inference.core.workflows.prototypes.block import WorkflowBlock


def load_enterprise_blocks() -> List[Type[WorkflowBlock]]:
return [
OPCWriterSinkBlockV1,
]
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
WorkflowBlockManifest,
)

BLOCK_TYPE = "roboflow_core/opc_writer_sink@v1"
BLOCK_TYPE = "roboflow_enterprise/opc_writer_sink@v1"
LONG_DESCRIPTION = """
The **OPC Writer** block enables sending a data from Workflow into OPC server
by setting value of OPC object under OPC namespace.
Expand Down Expand Up @@ -66,6 +66,11 @@
Sometimes it would be convenient to manually disable the **OPC Writer** block. This can be achieved by
setting `disable_sink` flag to hold reference to Workflow input. With such setup, caller cat disable the sink
by sending agreed input parameter.
!!! warning "Cooldown limitations"
Current implementation of cooldown is limited to video processing - using this block in context of a
Workflow that is run behind HTTP service (Roboflow Hosted API, Dedicated Deployment or self-hosted
`inference` server) will have no effect with regards to cooldown timer.
"""

QUERY_PARAMS_KIND = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"steps": [
{
"type": "roboflow_core/opc_writer_sink@v1",
"type": "roboflow_enterprise/opc_writer_sink@v1",
"name": "opc_writer",
"url": "$inputs.opc_url",
"namespace": "$inputs.opc_namespace",
Expand Down Expand Up @@ -169,7 +169,7 @@ def _opc_connect_and_read_value(
workflow_definition=WORKFLOW_OPC_WRITER,
workflow_name_in_app="opc_writer",
)
def test_workflow_with_classical_pattern_matching() -> None:
def test_workflow_with_opc_writer_sink() -> None:
# given
loop = asyncio.new_event_loop()
t = threading.Thread(target=start_loop, args=(loop,), daemon=True)
Expand Down

0 comments on commit 8e0144a

Please sign in to comment.