Skip to content

Commit f782f53

Browse files
muhammad-ali-eclaudevishnuszipstack
authored
UN-2870 [FEAT] Add SDK1 feature flag support to workers (#1621)
* UN-2870 [FEAT] Add SDK1 feature flag support to workers This commit adds SDK1 feature flag support to workers, matching the backend implementation pattern used across 19 backend files. Changes: - Added feature flag check to destination_connector.py - Added unstract-sdk1 dependency to pyproject.toml - Added Flipt environment variables to sample.env 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * allowed README.md from unstract librarry for docker build * added uv lck --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
1 parent 399a3a7 commit f782f53

File tree

5 files changed

+1882
-1716
lines changed

5 files changed

+1882
-1716
lines changed

docker/dockerfiles/worker-unified.Dockerfile.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Thumbs.db
5353
**/docs/
5454
**/*.md
5555
!README.md
56+
!unstract
57+
!unstract/**
5658

5759
# Configuration that shouldn't be in containers
5860
**/.env*

workers/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ dependencies = [
2222
"prometheus-client>=0.17.0,<1.0.0", # Metrics collection
2323
"psutil>=5.9.0,<6.0.0", # System resource monitoring
2424
# Essential Unstract packages - with Azure support for connectors
25-
"unstract-sdk[azure]~=0.78.0", # Core SDK with Azure connector support
25+
"unstract-sdk[aws,gcs,azure]~=0.78.0", # Core SDK with Azure connector support
26+
"unstract-sdk1[aws,gcs,azure]", # SDK v1 for feature flag support
2627
"unstract-connectors",
2728
"unstract-core",
2829
"unstract-flags",
@@ -192,3 +193,4 @@ unstract-tool-registry = { path = "../unstract/tool-registry", editable = true }
192193
unstract-flags = { path = "../unstract/flags", editable = true }
193194
unstract-connectors = { path = "../unstract/connectors", editable = true }
194195
unstract-core = { path = "../unstract/core", editable = true }
196+
unstract-sdk1 = { path = "../unstract/sdk1", editable = true }

workers/sample.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,8 @@ GOOGLE_OAUTH2_SECRET=
377377
# WORKFLOW_EXECUTION_FILE_STORAGE_CREDENTIALS={"provider": "minio", "credentials": {"endpoint_url": "http://localhost:9000", "key": "minio", "secret": "minio123"}}
378378
# API_FILE_STORAGE_CREDENTIALS={"provider": "minio", "credentials": {"endpoint_url": "http://localhost:9000", "key": "minio", "secret": "minio123"}}
379379

380+
# Flipt Service
381+
FLIPT_SERVICE_AVAILABLE=False
382+
EVALUATION_SERVER_IP=unstract-flipt
383+
EVALUATION_SERVER_PORT=9005
380384
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

workers/shared/workflow/destination_connector.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@
4242
FileExecutionStatusTracker,
4343
)
4444
from unstract.filesystem import FileStorageType, FileSystem
45-
from unstract.sdk.constants import ToolExecKey
46-
from unstract.sdk.tool.mime_types import EXT_MIME_MAP
45+
from unstract.flags.feature_flag import check_feature_flag_status
46+
47+
if check_feature_flag_status("sdk1"):
48+
from unstract.sdk1.constants import ToolExecKey
49+
from unstract.sdk1.tool.mime_types import EXT_MIME_MAP
50+
else:
51+
from unstract.sdk.constants import ToolExecKey
52+
from unstract.sdk.tool.mime_types import EXT_MIME_MAP
53+
4754
from unstract.workflow_execution.constants import (
4855
MetaDataKey,
4956
ToolMetadataKey,

0 commit comments

Comments
 (0)