Skip to content

Commit

Permalink
Merge pull request #842 from roboflow/feature/opc-writer-block
Browse files Browse the repository at this point in the history
OPC writer block
  • Loading branch information
grzegorz-roboflow authored Nov 29, 2024
2 parents 1320711 + d094442 commit 660d5cf
Show file tree
Hide file tree
Showing 10 changed files with 632 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests_workflows_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
pip install --upgrade setuptools
pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements/_requirements.txt -r requirements/requirements.cpu.txt -r requirements/requirements.sdk.http.txt -r requirements/requirements.test.unit.txt -r requirements/requirements.http.txt -r requirements/requirements.yolo_world.txt -r requirements/requirements.doctr.txt -r requirements/requirements.sam.txt -r requirements/requirements.transformers.txt
- name: 🧪 Integration Tests of Workflows
run: ROBOFLOW_API_KEY=${{ secrets.API_KEY }} SKIP_FLORENCE2_TEST=FALSE python -m pytest tests/workflows/integration_tests
run: ROBOFLOW_API_KEY=${{ secrets.API_KEY }} SKIP_FLORENCE2_TEST=FALSE LOAD_ENTERPRISE_BLOCKS=TRUE python -m pytest tests/workflows/integration_tests
2 changes: 2 additions & 0 deletions inference/core/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,5 @@
PRELOAD_MODELS = (
os.getenv("PRELOAD_MODELS").split(",") if os.getenv("PRELOAD_MODELS") else None
)

LOAD_ENTERPRISE_BLOCKS = str2bool(os.getenv("LOAD_ENTERPRISE_BLOCKS", "False"))
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from packaging.specifiers import SpecifierSet
from packaging.version import Version

from inference.core.env import LOAD_ENTERPRISE_BLOCKS
from inference.core.workflows.core_steps.loader import (
KINDS_DESERIALIZERS,
KINDS_SERIALIZERS,
Expand Down Expand Up @@ -41,6 +42,9 @@
BLOCK_SOURCE,
)
from inference.core.workflows.prototypes.block import WorkflowBlock
from inference.enterprise.workflows.enterprise_blocks.loader import (
load_enterprise_blocks,
)

WORKFLOWS_PLUGINS_ENV = "WORKFLOWS_PLUGINS"
WORKFLOWS_CORE_PLUGIN_NAME = "workflows_core"
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 LOAD_ENTERPRISE_BLOCKS:
core_blocks.extend(load_enterprise_blocks())
already_spotted_blocks = set()
result = []
for block in core_blocks:
Expand Down
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions inference/enterprise/workflows/enterprise_blocks/loader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import List, Type

from inference.core.workflows.prototypes.block import WorkflowBlock
from inference.enterprise.workflows.enterprise_blocks.sinks.opc_writer.v1 import (
OPCWriterSinkBlockV1,
)


def load_enterprise_blocks() -> List[Type[WorkflowBlock]]:
return [
OPCWriterSinkBlockV1,
]
Empty file.
Loading

0 comments on commit 660d5cf

Please sign in to comment.