Skip to content

Commit 7370588

Browse files
wanhakimHee, Tyan Huey
andauthored
added finetuning playwright and fixes (#75)
* added test case 005 for V1.5 Signed-off-by: wwanarif <[email protected]> * add more finetuning tests Signed-off-by: Hee, Tyan Huey <[email protected]> * fix finetuning issues + add error UI for import sample workflow fails Signed-off-by: wwanarif <[email protected]> * fix validation issues Signed-off-by: wwanarif <[email protected]> * optimizing finetuning downloads Signed-off-by: wwanarif <[email protected]> * implement test name changes Signed-off-by: wwanarif <[email protected]> * fix race condition and update some UI Signed-off-by: wwanarif <[email protected]> * cve fixes Signed-off-by: wwanarif <[email protected]> * add compat shim for urllib3 2.x Signed-off-by: wwanarif <[email protected]> --------- Signed-off-by: wwanarif <[email protected]> Signed-off-by: Hee, Tyan Huey <[email protected]> Co-authored-by: Hee, Tyan Huey <[email protected]>
1 parent 2597b71 commit 7370588

File tree

84 files changed

+1294
-576
lines changed

Some content is hidden

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

84 files changed

+1294
-576
lines changed

.github/workflows/manual-docker-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
ignore-unfixed: true
7070
vuln-type: 'os,library'
7171
severity: 'CRITICAL,HIGH'
72+
# timeout: '10m0s'
7273

7374
- name: Cleanup
7475
if: always()

app-backend/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git
2626
WORKDIR /home/user/GenAIComps
2727
RUN pip install --no-cache-dir --upgrade pip==24.3.1 setuptools==78.1.1 && \
2828
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt && \
29-
pip install --no-cache-dir --upgrade mcp==1.10.0 pillow==11.3.0
29+
pip install --no-cache-dir --upgrade mcp==1.23.0 pillow==11.3.0 \
30+
langchain-core==0.3.80 urllib3==2.6.0 starlette==0.49.1
3031

3132
COPY ./templates/microservices/* /home/user/templates/microservices/
3233
COPY ./megaservice.py /home/user/megaservice.py

setup-scripts/setup-genai-studio/manifests/studio-manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ spec:
426426
storageClassName: local-path
427427
resources:
428428
requests:
429-
storage: 1Gi
429+
storage: 30Gi
430430
---
431431
apiVersion: v1
432432
kind: Service

studio-backend/app/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from app.compat import ensure_urllib3_getheaders
2+
3+
# Ensure urllib3 2.x exposes HTTPResponse.getheaders for kubernetes client compatibility.
4+
ensure_urllib3_getheaders()

studio-backend/app/compat.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Compatibility shims for third-party libraries.
3+
4+
Currently used to keep kubernetes-python working with urllib3 2.x, which
5+
removed HTTPResponse.getheaders(). Older kubernetes versions still call
6+
getheaders when building ApiException objects. This shim reintroduces a
7+
minimal getheaders that mirrors the previous behavior.
8+
"""
9+
from urllib3.response import HTTPResponse
10+
11+
12+
def ensure_urllib3_getheaders() -> None:
13+
"""Add HTTPResponse.getheaders if urllib3 2.x removed it.
14+
15+
Returns the header items as a list of (key, value) tuples, matching the
16+
old http.client.HTTPResponse API used by kubernetes-python.
17+
"""
18+
if not hasattr(HTTPResponse, "getheaders"):
19+
def _getheaders(self): # type: ignore[override]
20+
return list(self.headers.items())
21+
22+
HTTPResponse.getheaders = _getheaders # type: ignore[attr-defined]

studio-backend/app/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from fastapi import FastAPI
22
from fastapi.middleware.cors import CORSMiddleware
3+
4+
from app.compat import ensure_urllib3_getheaders
5+
6+
# Restore HTTPResponse.getheaders expected by kubernetes-python when running with urllib3 2.x.
7+
ensure_urllib3_getheaders()
8+
39
from kubernetes import config
410

511
# Load the kubeconfig file
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
fastapi==0.115.4
1+
fastapi==0.121.0
22
uvicorn==0.30.6
33
kubernetes==30.1.0
44
requests==2.32.3
5+
urllib3==2.6.0
56
pydantic==1.10.18
6-
starlette==0.41.2
7+
starlette==0.49.1
78
websockets==10.3
89
clickhouse-driver==0.2.9
910
paramiko==3.5.1

studio-backend/app/routers/sandbox_router.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ async def deploy_sandbox(request: PipelineFlow):
1919
try:
2020
response = deploy_manifest_in_namespace(core_v1_api, apps_v1_api, json.loads(workflow_info.export_to_json()))
2121
except Exception as e:
22+
import traceback
23+
traceback.print_exc()
2224
raise HTTPException(status_code=500, detail=str(e))
2325

2426
return response
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pytest==8.3.3
2-
fastapi==0.115.0
2+
fastapi==0.121.0
33
httpx==0.27.2
44
kubernetes==30.1.0
5-
pydantic==1.10.18
5+
pydantic==1.10.18
6+
urllib3==2.6.0

studio-frontend/Dockerfile

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:20-alpine
1+
# Build stage
2+
FROM node:20-alpine AS builder
23

34
# Accept proxy build arguments
45
ARG http_proxy
@@ -10,37 +11,62 @@ ENV http_proxy=${http_proxy}
1011
ENV https_proxy=${https_proxy}
1112
ENV no_proxy=${no_proxy}
1213

13-
# Install necessary packages
14+
# Install build dependencies
1415
RUN apk update && apk upgrade && \
1516
apk add --no-cache gcompat python3 make g++ git \
16-
# Needed for pdfjs-dist
17-
build-base cairo-dev pango-dev \
18-
# Install Chromium
19-
chromium && \
20-
# Install PNPM globally
17+
build-base cairo-dev pango-dev && \
2118
npm install -g pnpm@9
2219

23-
# Debug step to verify git installation
24-
RUN git --version
20+
ENV NODE_OPTIONS=--max-old-space-size=8192
21+
22+
WORKDIR /usr/src
23+
24+
# Copy package files first for better layer caching
25+
COPY package.json pnpm-workspace.yaml turbo.json ./
26+
COPY packages/server/package.json ./packages/server/
27+
COPY packages/ui/package.json ./packages/ui/
28+
29+
# Install dependencies
30+
RUN pnpm install
31+
32+
# Copy source code
33+
COPY . .
34+
35+
# Build the app and clean up
36+
RUN pnpm build && \
37+
# Prune to production dependencies only
38+
pnpm prune --prod && \
39+
rm -rf node_modules/.cache && \
40+
rm -rf packages/*/node_modules/.cache
41+
42+
# Production stage
43+
FROM node:20-alpine
44+
45+
# Accept proxy build arguments
46+
ARG http_proxy
47+
ARG https_proxy
48+
ARG no_proxy
49+
50+
ENV http_proxy=${http_proxy}
51+
ENV https_proxy=${https_proxy}
52+
ENV no_proxy=${no_proxy}
53+
54+
# Install only runtime dependencies with patched npm
55+
RUN apk update && apk upgrade && \
56+
apk add --no-cache gcompat chromium && \
57+
npm install -g npm@latest pnpm@latest && \
58+
rm -rf /var/cache/apk/*
2559

2660
ENV PUPPETEER_SKIP_DOWNLOAD=true
2761
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
2862
ENV NODE_OPTIONS=--max-old-space-size=8192
2963

3064
WORKDIR /usr/src
3165

32-
# Copy app source
33-
COPY . .
34-
35-
# Install dependencies and build the app
36-
RUN pnpm config set store-dir .pnpm-store && \
37-
pnpm install && \
38-
pnpm update [email protected] && \
39-
pnpm build && \
40-
pnpm remove esbuild && \
41-
rm -rf .pnpm-store && \
42-
rm -rf /root/.local/share/pnpm && \
43-
pnpm prune --prod
66+
# Copy only necessary files from builder
67+
COPY --from=builder /usr/src/package.json /usr/src/pnpm-workspace.yaml ./
68+
COPY --from=builder /usr/src/packages ./packages
69+
COPY --from=builder /usr/src/node_modules ./node_modules
4470

4571
EXPOSE 3000
4672

0 commit comments

Comments
 (0)