Skip to content

Commit 40bc811

Browse files
authored
Merge branch 'main' into restrict-ingestion-section-clear-fix
2 parents e0320ac + 31fdf1d commit 40bc811

63 files changed

Lines changed: 3576 additions & 1561 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ MICROSOFT_GRAPH_OAUTH_CLIENT_SECRET=
173173
AWS_ACCESS_KEY_ID=
174174
AWS_SECRET_ACCESS_KEY=
175175

176+
# --- IBM Cloud Object Storage connector (Enterprise/SaaS) ------------------
177+
# Enterprise/SaaS-only bucket connector, gated by IBM_AUTH_ENABLED (like the
178+
# AWS S3 / Azure Blob connectors). Credentials are normally entered per-connection
179+
# in the UI; these env vars are OPTIONAL fallbacks / defaults. Two auth modes are
180+
# supported: IAM (api_key + service_instance_id, default) or HMAC (access key +
181+
# secret, S3-compatible -- works against MinIO for local testing).
182+
IBM_COS_ENDPOINT=
183+
IBM_COS_API_KEY=
184+
IBM_COS_SERVICE_INSTANCE_ID=
185+
IBM_COS_HMAC_ACCESS_KEY_ID=
186+
IBM_COS_HMAC_SECRET_ACCESS_KEY=
187+
#
188+
# Local dev / MinIO testing: set OPENRAG_DEV_IBM_COS=true to enable the
189+
# connector without IBM_AUTH_ENABLED. NEVER use in production.
190+
# OPENRAG_DEV_IBM_COS=false
191+
# Frontend counterpart: also set NEXT_PUBLIC_DEV_IBM_COS=true so the Connectors
192+
# tab and admin Connectors Permission page show IBM COS locally (requires a
193+
# frontend restart to take effect -- Next.js reads NEXT_PUBLIC_* at startup).
194+
# NEXT_PUBLIC_DEV_IBM_COS=false
195+
176196
# --- Azure Blob Storage connector (Enterprise/SaaS) ------------------------
177197
# Enterprise/SaaS-only bucket connector, gated by IBM_AUTH_ENABLED (like the
178198
# AWS S3 / IBM COS connectors). Credentials are normally entered per-connection

.github/workflows/test-ci.yml

Lines changed: 92 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,25 @@ jobs:
6767
needs: changes
6868
if: ${{ needs.changes.outputs.e2e == 'true' || needs.changes.outputs.integration == 'true' || github.event_name == 'workflow_dispatch' }}
6969
runs-on:
70-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
70+
labels: "ubuntu-latest"
7171
steps:
72+
- name: Maximize build space
73+
uses: easimon/maximize-build-space@v10
74+
continue-on-error: true
75+
with:
76+
root-reserve-mb: 40960
77+
temp-reserve-mb: 30720
78+
remove-dotnet: 'true'
79+
remove-android: 'true'
80+
remove-haskell: 'true'
81+
remove-codeql: 'true'
82+
remove-docker-images: 'true'
83+
build-mount-path: '/var/lib/docker'
84+
85+
- name: Restart Docker
86+
continue-on-error: true
87+
run: sudo service docker restart || sudo systemctl restart docker || true
88+
7289
- run: df -h
7390

7491
- name: Cleanup Docker cache
@@ -115,25 +132,25 @@ jobs:
115132
uses: actions/cache@v4
116133
with:
117134
path: /tmp/image-cache/opensearch.tar
118-
key: ${{ runner.os }}-image-opensearch-${{ steps.cache-keys.outputs.opensearch }}
135+
key: ${{ runner.os }}-${{ runner.arch }}-opensearch-${{ steps.cache-keys.outputs.opensearch }}
119136

120137
- name: Cache Backend Image
121138
uses: actions/cache@v4
122139
with:
123140
path: /tmp/image-cache/backend.tar
124-
key: ${{ runner.os }}-image-backend-${{ steps.cache-keys.outputs.backend }}
141+
key: ${{ runner.os }}-${{ runner.arch }}-backend-${{ steps.cache-keys.outputs.backend }}
125142

126143
- name: Cache Frontend Image
127144
uses: actions/cache@v4
128145
with:
129146
path: /tmp/image-cache/frontend.tar
130-
key: ${{ runner.os }}-image-frontend-${{ steps.cache-keys.outputs.frontend }}
147+
key: ${{ runner.os }}-${{ runner.arch }}-frontend-${{ steps.cache-keys.outputs.frontend }}
131148

132149
- name: Cache Langflow Image
133150
uses: actions/cache@v4
134151
with:
135152
path: /tmp/image-cache/langflow.tar
136-
key: ${{ runner.os }}-image-langflow-${{ steps.cache-keys.outputs.langflow }}
153+
key: ${{ runner.os }}-${{ runner.arch }}-langflow-${{ steps.cache-keys.outputs.langflow }}
137154

138155
- name: Build OpenRAG images
139156
run: |
@@ -145,14 +162,40 @@ jobs:
145162
local name=$1
146163
local dockerfile=$2
147164
local tar_path="/tmp/image-cache/${name}.tar"
165+
local use_cache=false
148166
149167
if [ -f "$tar_path" ]; then
150-
echo "Cache hit for ${name}. Loading image from ${tar_path}..."
168+
echo "Found cache file for ${name}. Inspecting architecture..."
151169
docker load -i "$tar_path"
152-
echo "Tagging loaded image as langflowai/openrag-${name}:${CI_IMAGE_TAG}..."
153-
docker tag "langflowai/openrag-${name}:cached" "langflowai/openrag-${name}:${CI_IMAGE_TAG}"
154-
else
155-
echo "Cache miss for ${name}. Building..."
170+
171+
# Get host normalized architecture
172+
local host_arch="$(uname -m)"
173+
local host_arch_norm=""
174+
if [[ "$host_arch" == "x86_64" ]]; then
175+
host_arch_norm="amd64"
176+
elif [[ "$host_arch" == "aarch64" || "$host_arch" == "arm64" ]]; then
177+
host_arch_norm="arm64"
178+
else
179+
host_arch_norm="$host_arch"
180+
fi
181+
182+
local loaded_arch=""
183+
loaded_arch=$(docker inspect --format '{{.Architecture}}' "langflowai/openrag-${name}:cached" 2>/dev/null || echo "unknown")
184+
185+
if [ "$loaded_arch" = "$host_arch_norm" ]; then
186+
echo "Cache hit for ${name}. Loaded image matches host architecture ($host_arch_norm)."
187+
use_cache=true
188+
echo "Tagging loaded image as langflowai/openrag-${name}:${CI_IMAGE_TAG}..."
189+
docker tag "langflowai/openrag-${name}:cached" "langflowai/openrag-${name}:${CI_IMAGE_TAG}"
190+
else
191+
echo "Cache image architecture ($loaded_arch) does not match host architecture ($host_arch_norm). Discarding cache."
192+
docker rmi "langflowai/openrag-${name}:cached" 2>/dev/null || true
193+
rm -f "$tar_path"
194+
fi
195+
fi
196+
197+
if [ "$use_cache" = "false" ]; then
198+
echo "Cache miss/incompatible for ${name}. Building..."
156199
if docker buildx build \
157200
--load \
158201
-t "langflowai/openrag-${name}:cached" \
@@ -226,13 +269,30 @@ jobs:
226269
needs: [changes, build-images]
227270
if: ${{ needs.changes.outputs.integration == 'true' || github.event_name == 'workflow_dispatch' }}
228271
runs-on:
229-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
272+
labels: "ubuntu-latest"
230273
strategy:
231274
fail-fast: false
232275
matrix:
233276
suite: [core, sdk-python, sdk-typescript]
234277
name: tests (${{ matrix.suite }})
235278
steps:
279+
- name: Maximize build space
280+
uses: easimon/maximize-build-space@v10
281+
continue-on-error: true
282+
with:
283+
root-reserve-mb: 40960
284+
temp-reserve-mb: 30720
285+
remove-dotnet: 'true'
286+
remove-android: 'true'
287+
remove-haskell: 'true'
288+
remove-codeql: 'true'
289+
remove-docker-images: 'true'
290+
build-mount-path: '/var/lib/docker'
291+
292+
- name: Restart Docker
293+
continue-on-error: true
294+
run: sudo service docker restart || sudo systemctl restart docker || true
295+
236296
- run: df -h
237297

238298
- name: Cleanup Docker cache
@@ -327,14 +387,31 @@ jobs:
327387
needs: [changes, build-images]
328388
if: ${{ needs.changes.outputs.e2e == 'true' || github.event_name == 'workflow_dispatch' }}
329389
runs-on:
330-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
390+
labels: "ubuntu-latest"
331391
strategy:
332392
fail-fast: false
333393
matrix:
334394
shard: [1, 2, 3, 4, 5, 6, 7, 8]
335395
total_shards: [8]
336396
name: e2e (shard ${{ matrix.shard }}/${{ matrix.total_shards }})
337397
steps:
398+
- name: Maximize build space
399+
uses: easimon/maximize-build-space@v10
400+
continue-on-error: true
401+
with:
402+
root-reserve-mb: 40960
403+
temp-reserve-mb: 30720
404+
remove-dotnet: 'true'
405+
remove-android: 'true'
406+
remove-haskell: 'true'
407+
remove-codeql: 'true'
408+
remove-docker-images: 'true'
409+
build-mount-path: '/var/lib/docker'
410+
411+
- name: Restart Docker
412+
continue-on-error: true
413+
run: sudo service docker restart || sudo systemctl restart docker || true
414+
338415
- name: Cleanup Docker cache
339416
run: |
340417
docker compose -f docker-compose.yml down -v --remove-orphans || true
@@ -473,7 +550,7 @@ jobs:
473550
if: ${{ !cancelled() && (needs.changes.outputs.e2e == 'true' || github.event_name == 'workflow_dispatch') && needs.e2e-run.result != 'skipped' }}
474551
needs: [changes, e2e-run]
475552
runs-on:
476-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
553+
labels: "ubuntu-latest"
477554
permissions:
478555
contents: read
479556
steps:
@@ -513,7 +590,7 @@ jobs:
513590
needs: [changes, build-images, test-suite]
514591
if: always()
515592
runs-on:
516-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
593+
labels: "ubuntu-latest"
517594
steps:
518595
- name: Check split integration result
519596
run: |
@@ -533,7 +610,7 @@ jobs:
533610
needs: [changes, build-images, e2e-run]
534611
if: always()
535612
runs-on:
536-
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
613+
labels: "ubuntu-latest"
537614
steps:
538615
- name: Check E2E result
539616
run: |

enhancements/connectors/ibm_cos/connector.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
"""IBM Cloud Object Storage connector for OpenRAG."""
1+
"""IBM Cloud Object Storage connector for OpenRAG.
2+
3+
Enterprise/SaaS-only ``bucket``-kind connector, gated by ``IBM_AUTH_ENABLED``
4+
(or ``OPENRAG_DEV_IBM_COS=true`` for local dev/MinIO testing).
5+
"""
26

37
import mimetypes
48
import os
59
from datetime import UTC, datetime
610
from posixpath import basename
711
from typing import Any
812

9-
from config.settings import IBM_AUTH_ENABLED
13+
from config.settings import IBM_AUTH_ENABLED, is_dev_ibm_cos_enabled
1014
from connectors.base import BaseConnector, ConnectorDocument, DocumentACL
1115
from utils.logging_config import get_logger
1216

@@ -64,7 +68,10 @@ class IBMCOSConnector(BaseConnector):
6468

6569
@classmethod
6670
def is_available(cls, manager, user_id=None) -> bool:
67-
return IBM_AUTH_ENABLED
71+
# Enterprise/SaaS gate is IBM_AUTH_ENABLED, like the other bucket
72+
# connectors (aws_s3, azure_blob). OPENRAG_DEV_IBM_COS=true bypasses it
73+
# for local dev (e.g. against MinIO in HMAC mode; never in production).
74+
return IBM_AUTH_ENABLED or is_dev_ibm_cos_enabled()
6875

6976
@classmethod
7077
def register_routes(cls, app) -> None:

frontend/app/api/queries/useGetSettingsQuery.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export interface Settings {
7979
localhost_url?: string;
8080
ingest_via_chat?: boolean;
8181
show_provider_ingest_settings?: boolean;
82+
show_shared_upload_toggle?: boolean;
8283
segment_write_key?: string;
8384
environment?: string;
8485
langflow_port?: string | number | null;

0 commit comments

Comments
 (0)