Skip to content

Commit 2597b71

Browse files
authored
Finetuning + fixes (opea-project#74)
* revamp setup scripts supporting proxies and added studio cleanup scripts Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update build genaicomp script and fix proxy bugs Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * enable development env for studio-frontend Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * initial push for finetuning UI Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update docker-compose.dev.yml Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update dev env Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * initial push for finetuning api server Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * updates on the db and ft job view Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * added logs in ft job table and streamlined its format. updated ft job create modal Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * integrate finetuning server in studio k8 namespace Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update improvements to ft job table and modal Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * initial push for ft job outputs downloading Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * enable ws connections for ft status and output downloading Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * updated the ft configs UI Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * updated the ft training configs UI Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * fixes for depreciated components and hardfix the genaicomp images versions Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * added ws connection for finetuning in studio nginx Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * add proxy for github workflows Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * udpate studio-frontend image Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * add kubectl logs when deploy studio fail in e2e wf Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update otel collector contrib version and remove redundant IconApps Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * update otel deployment Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> * fix e2e test to make sure it exits properly when ansible fails Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com> --------- Signed-off-by: wwanarif <wan.abdul.hakim.b.wan.arif@intel.com>
1 parent be11083 commit 2597b71

File tree

87 files changed

+6011
-429
lines changed

Some content is hidden

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

87 files changed

+6011
-429
lines changed

.github/workflows/_build-image-to-registry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939
- name: Build Image and Push Image
4040
run: |
4141
sudo apt install ansible -y
42-
ansible-playbook buildpush-genaistudio-images.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}"
42+
ansible-playbook buildpush-genaistudio-images.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}" -e "http_proxy=${http_proxy}"
4343
working-directory: ${{ github.workspace }}/setup-scripts/build-image-to-registry/

.github/workflows/_e2e-test.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ jobs:
3939
- name: Deploy GenAI Studio
4040
run: |
4141
sudo apt install ansible -y
42-
ansible-playbook genai-studio.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}" -e "mysql_host=mysql.mysql.svc.cluster.local"
42+
ansible-playbook genai-studio.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}" -e "mysql_host=mysql.mysql.svc.cluster.local" -e "http_proxy=${http_proxy}" || {
43+
echo "Ansible playbook failed. Checking pod status..."
44+
echo "=== Pods in studio namespace ==="
45+
kubectl get pods -n studio
46+
echo "=== Logs and events for non-Ready pods in studio namespace ==="
47+
for pod in $(kubectl get pods -n studio --field-selector=status.phase!=Running,status.phase!=Succeeded -o jsonpath='{.items[*].metadata.name}'); do
48+
echo "--- Pod: $pod ---"
49+
kubectl describe pod $pod -n studio
50+
kubectl logs $pod -n studio --all-containers=true --tail=100 || echo "Could not fetch logs for $pod"
51+
done
52+
exit 1
53+
}
4354
sleep 5
44-
kubectl wait --for=condition=ready pod --all --namespace=studio --timeout=300s --field-selector=status.phase!=Succeeded
45-
kubectl wait --for=condition=ready pod --all --namespace=monitoring --timeout=300s --field-selector=status.phase!=Succeeded
4655
working-directory: ${{ github.workspace }}/setup-scripts/setup-genai-studio/
4756

4857
- name: Set up Node.js
@@ -74,25 +83,10 @@ jobs:
7483
name: playwright-test-results
7584
path: ${{ github.workspace }}/tests/playwright/playwright-report
7685

77-
- name: Cleanup sandbox namespaces
86+
- name: Cleanup GenAI Studio
7887
if: always()
7988
run: |
80-
if kubectl get namespace mysql; then
81-
kubectl delete ns mysql || true
82-
fi
83-
if kubectl get namespace tracing; then
84-
kubectl delete ns tracing || true
85-
fi
86-
for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep '^sandbox-'); do
87-
kubectl delete namespace $ns || true
88-
done
89-
if kubectl get namespace studio; then
90-
kubectl delete -f manifests/studio-manifest.yaml || true
91-
kubectl wait --for=delete pod --all --namespace=studio --timeout=300s
92-
fi
93-
if kubectl get namespace monitoring; then
94-
kubectl delete -f manifests/monitoring-manifest.yaml || true
95-
kubectl wait --for=delete pod --all --namespace=monitoring --timeout=300s
96-
fi
89+
echo "Running GenAI Studio cleanup script..."
90+
./cleanup-genai-studio.sh || echo "Cleanup script completed with warnings"
9791
working-directory: ${{ github.workspace }}/setup-scripts/setup-genai-studio/
9892

app-backend/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
FROM python:3.11-slim
22

3+
# Accept proxy build arguments
4+
ARG http_proxy
5+
ARG https_proxy
6+
ARG no_proxy
7+
8+
# Set proxy environment variables for package managers
9+
ENV http_proxy=${http_proxy}
10+
ENV https_proxy=${https_proxy}
11+
ENV no_proxy=${no_proxy}
12+
313
RUN apt-get update -y && apt-get install -y --no-install-recommends --fix-missing \
414
libsqlite3-0 \
515
libjemalloc-dev \

app-backend/megaservice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def add_remote_service(self):
170170
microservice_name = node['name'].split('@')[1]
171171
if "docsum" in microservice_name:
172172
self.is_docsum = True
173-
service_node_ip = node_id.split('@')[1].replace('_','-') if USE_NODE_ID_AS_IP else HOST_IP
173+
service_node_ip = f"opea-{node_id.split('@')[1].replace('_','-')}" if USE_NODE_ID_AS_IP else HOST_IP
174174
microservice = templates[microservice_name].get_service(host_ip=service_node_ip, node_id_as_ip=USE_NODE_ID_AS_IP, port=os.getenv(f"{node_id.split('@')[1]}_port", None))
175175
microservice.name = node_id
176176
self.services[node_id] = microservice

app-backend/orchestrator.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ async def execute(
272272
url=endpoint,
273273
data=json.dumps(inputs),
274274
headers={"Content-type": "application/json", "Authorization": f"Bearer {access_token}"},
275-
proxies={"http": None},
276275
stream=True,
277276
timeout=2000,
278277
)
@@ -283,7 +282,6 @@ async def execute(
283282
headers={
284283
"Content-type": "application/json",
285284
},
286-
proxies={"http": None},
287285
stream=True,
288286
timeout=2000,
289287
)
@@ -316,7 +314,6 @@ def generate():
316314
"Content-type": "application/json",
317315
"Authorization": f"Bearer {access_token}",
318316
},
319-
proxies={"http": None},
320317
timeout=2000,
321318
)
322319
else:
@@ -326,7 +323,6 @@ def generate():
326323
headers={
327324
"Content-type": "application/json",
328325
},
329-
proxies={"http": None},
330326
timeout=2000,
331327
)
332328
res_json = res.json()

app-frontend/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Use node 20.11.1 as the base image
5-
FROM node:20.11.1 as vite-app
5+
FROM node:20.11.1 AS vite-app
6+
7+
# Accept proxy build arguments
8+
ARG http_proxy
9+
ARG https_proxy
10+
ARG no_proxy
11+
12+
# Set proxy environment variables for package managers
13+
ENV http_proxy=${http_proxy}
14+
ENV https_proxy=${https_proxy}
15+
ENV no_proxy=${no_proxy}
616

717
COPY ./react /usr/app/react
818
WORKDIR /usr/app/react
919

1020

11-
RUN ["npm", "install"]
21+
RUN ["npm", "install", "--legacy-peer-deps"]
1222
RUN ["npm", "run", "build"]
1323

1424

app-frontend/react/src/components/SideBar/SideBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export const LinkedMenuItem: React.FC<LinkedMenuItemProps> = ({
7979
to={toWithQuery(to)}
8080
onClick={onClick}
8181
tabIndex={open ? 0 : -1}
82-
aria-hidden={!open}
8382
>
8483
{children}
8584
</Link>

setup-scripts/build-image-to-registry/buildpush-genaicomps-images.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@
1515
dest: /tmp/GenAIComps
1616
clone: yes
1717
update: no
18+
environment:
19+
http_proxy: "{{ http_proxy }}"
20+
https_proxy: "{{ http_proxy }}"
21+
no_proxy: "{{ no_proxy }}"
1822
when: not genaicomp_dir.stat.exists
1923

20-
- name: Pull latest changes in GenAIComps repo
24+
- name: Checkout specific GenAIComps tag
2125
git:
2226
repo: https://github.com/opea-project/GenAIComps.git
2327
dest: /tmp/GenAIComps
24-
update: yes
28+
version: "{{ genaicomps_tag }}"
29+
environment:
30+
http_proxy: "{{ http_proxy }}"
31+
https_proxy: "{{ http_proxy }}"
32+
no_proxy: "{{ no_proxy }}"
2533
when: genaicomp_dir.stat.exists
2634

2735
- name: Build and push GenAIComps images
@@ -38,11 +46,25 @@
3846
- { name: 'asr', dockerfile: 'comps/asr/src/Dockerfile' }
3947
block:
4048
- name: Build image
41-
command: docker build -t {{ container_registry }}/{{ item.name }}:{{ container_tag }} -f {{ item.dockerfile }} .
49+
command: >
50+
docker build
51+
--build-arg http_proxy="{{ http_proxy }}"
52+
--build-arg https_proxy="{{ http_proxy }}"
53+
--build-arg no_proxy="{{ no_proxy }}"
54+
-t {{ container_registry }}/{{ item.name }}:{{ container_tag }}
55+
-f {{ item.dockerfile }} .
4256
args:
4357
chdir: /tmp/GenAIComps
58+
environment:
59+
http_proxy: "{{ http_proxy }}"
60+
https_proxy: "{{ http_proxy }}"
61+
no_proxy: "{{ no_proxy }}"
4462
loop: "{{ genaicomp_images }}"
4563

4664
- name: Push image
4765
command: docker push {{ container_registry }}/{{ item.name }}:{{ container_tag }}
66+
environment:
67+
http_proxy: "{{ http_proxy }}"
68+
https_proxy: "{{ http_proxy }}"
69+
no_proxy: "{{ no_proxy }}"
4870
loop: "{{ genaicomp_images }}"

setup-scripts/build-image-to-registry/buildpush-genaistudio-images.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
- vars.yml
66
tasks:
77
- name: Build Docker image
8-
command: docker build -t "{{ container_registry }}/{{ item.image_name }}:{{ container_tag }}" .
8+
command: >
9+
docker build
10+
--build-arg http_proxy="{{ http_proxy }}"
11+
--build-arg https_proxy="{{ http_proxy }}"
12+
--build-arg no_proxy="{{ no_proxy }}"
13+
-t "{{ container_registry }}/{{ item.image_name }}:{{ container_tag }}" .
914
args:
1015
chdir: "{{ item.directory }}"
16+
environment:
17+
http_proxy: "{{ http_proxy }}"
18+
https_proxy: "{{ http_proxy }}"
19+
no_proxy: "{{ no_proxy }}"
1120
loop:
1221
- { directory: '../../studio-frontend/', image_name: 'studio-frontend' }
1322
- { directory: '../../studio-backend/', image_name: 'studio-backend' }
@@ -17,6 +26,10 @@
1726

1827
- name: Push Docker image
1928
command: docker push "{{ container_registry }}/{{ item.image_name }}:{{ container_tag }}"
29+
environment:
30+
http_proxy: "{{ http_proxy }}"
31+
https_proxy: "{{ http_proxy }}"
32+
no_proxy: "{{ no_proxy }}"
2033
loop:
2134
- { image_name: 'studio-frontend' }
2235
- { image_name: 'studio-backend' }
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
container_registry: 'opea'
2-
container_tag: 'latest'
1+
# Container registry configuration
2+
# Replace {{ ansible_default_ipv4.address }} with your Kubernetes master/API endpoint IP if needed
3+
container_registry: '{{ ansible_default_ipv4.address }}:5000/opea'
4+
container_tag: 'latest'
5+
genaicomps_tag: 'main'
6+
http_proxy: ''
7+
no_proxy: 'localhost,127.0.0.1,.local,.svc.cluster.local,{{ ansible_default_ipv4.address }}'

0 commit comments

Comments
 (0)