Skip to content

Commit 295185e

Browse files
author
wwanarif
committed
enabled local-path-provisioner, update readmes, e2e tests, setup scripts and workflow
Signed-off-by: wwanarif <[email protected]>
1 parent 750cb1c commit 295185e

File tree

14 files changed

+110
-51
lines changed

14 files changed

+110
-51
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ jobs:
3838

3939
- name: Build Image and Push Image
4040
run: |
41+
sudo apt install ansible -y
4142
ansible-playbook build-image-to-registry.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}"
4243
working-directory: ${{ github.workspace }}/setup-scripts/build-image-to-registry/

.github/workflows/_e2e-test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,22 @@ jobs:
5252
kubectl wait --for=delete pod --all --namespace=monitoring --timeout=300s
5353
fi
5454
sleep 5
55+
sudo apt install ansible -y
5556
ansible-playbook genai-studio.yml -e "container_registry=${OPEA_IMAGE_REPO}opea" -e "container_tag=${{ inputs.tag }}"
5657
sleep 5
5758
kubectl wait --for=condition=ready pod --all --namespace=studio --timeout=300s --field-selector=status.phase!=Succeeded
5859
kubectl wait --for=condition=ready pod --all --namespace=monitoring --timeout=300s --field-selector=status.phase!=Succeeded
5960
working-directory: ${{ github.workspace }}/setup-scripts/setup-genai-studio/
6061

62+
- name: Set up Node.js
63+
uses: actions/setup-node@v2
64+
with:
65+
node-version: '20.18.0'
66+
6167
- name: Install Dependencies
6268
run: |
6369
npm install
70+
npx playwright install
6471
npx playwright install-deps
6572
working-directory: ${{ github.workspace }}/tests/playwright
6673

@@ -80,4 +87,11 @@ jobs:
8087
with:
8188
name: playwright-test-results
8289
path: ${{ github.workspace }}/tests/playwright/playwright-report
90+
91+
- name: Cleanup sandbox namespaces
92+
if: always()
93+
run: |
94+
for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep '^sandbox-'); do
95+
kubectl delete namespace $ns || true
96+
done
8397

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
name: Manual - Docker Build
4+
name: Manual - Docker Build and Test
55
on:
66
workflow_dispatch:
77
inputs:

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

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,34 @@ on:
1010
description: "Hardware to run test"
1111
required: true
1212
type: string
13+
studio_frontend:
14+
description: "Publish studio-frontend image?"
15+
required: true
16+
type: boolean
17+
default: true
18+
studio_backend:
19+
description: "Publish studio-backend image?"
20+
required: true
21+
type: boolean
22+
default: true
23+
app_frontend:
24+
description: "Publish app-frontend image?"
25+
required: true
26+
type: boolean
27+
default: true
28+
app_backend:
29+
description: "Publish app-backend image?"
30+
required: true
31+
type: boolean
32+
default: true
1333
tag:
1434
default: "rc"
1535
description: "Tag to publish, like [1.0rc]"
1636
required: true
1737
type: string
1838
publish_tags:
1939
default: "latest,1.x"
20-
description: "Tag list apply to publish images, like [latest,1.0]"
40+
description: "Comma-separated tag list to apply to published images, like [latest,1.0]"
2141
required: false
2242
type: string
2343

@@ -26,16 +46,21 @@ jobs:
2646
publish:
2747
strategy:
2848
matrix:
29-
image: ["studio-frontend", "studio-backend", "app-frontend", "app-backend"]
30-
max-parallel: 2
49+
image: ${{ fromJson('[ "studio-frontend", "studio-backend", "app-frontend", "app-backend" ]') }}
50+
fail-fast: false
3151
runs-on: "docker-build-${{ inputs.node }}"
3252
steps:
3353
- uses: docker/[email protected]
3454
with:
3555
username: ${{ secrets.DOCKERHUB_USER }}
3656
password: ${{ secrets.DOCKERHUB_TOKEN }}
3757

58+
- name: Check if image should be published
59+
if: ${{ github.event.inputs[ matrix.image ] == 'true' }}
60+
run: echo "Publishing ${{ matrix.image }} image"
61+
3862
- name: Image Publish
63+
if: ${{ github.event.inputs[ matrix.image ] == 'true' }}
3964
uses: opea-project/validation/actions/image-publish@main
4065
with:
4166
local_image_ref: ${OPEA_IMAGE_REPO}opea/${{ matrix.image }}:${{ inputs.tag }}

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
## Reduce Barrier of Adoption with Low-Code: End-to-End GenAI App Development for Productivity
77

8-
**🌟Key Highlights**
9-
- 🛠️ Build & configure GenAI applications rapidly with low-code with no setup hassle
8+
**🌟Key Capabilities**
9+
- 🛠️ Build & configure GenAI applications rapidly with low-code and no setup hassle
1010
- 🔍 Instant evaluation with sandbox on Kubernetes Namespace
1111
- 📊 Dynamic performance measurement & benchmarking with Grafana dashboarding via Prometheus
1212
- ⚙️ One-click deployment package generation for instant application setup
@@ -76,7 +76,7 @@ _Note: This setup has been validated on a system running Ubuntu 22.04 on an Inte
7676
GenAIStudio requires an on-premise Kubernetes cluster. If your server does not have Kubernetes set up, please install by following the [Kubernetes official setup guide](https://kubernetes.io/docs/setup/). Alternatively, you can try out our [setup onpremise kubernetes script](./setup-scripts/setup-onpremise-kubernetes/readme.md).
7777

7878
### Installation
79-
The installation is done using genai-studio-playbook script. The script will
79+
The installation is done using genai-studio playbook script. The script will
8080
- Deploy a persistent volume for prometheus and a customized monitoring stack based on prometheus-community/kube-prometheus-stack (which contains both Prometheus and Grafana) in the monitoring namespace.
8181
- Deploy the studio-backend, studio-frontend and also a studio-nginx in the studio namespace.
8282

@@ -89,12 +89,11 @@ The installation can be done with the following steps:
8989
```
9090
2. **Run the commands below**
9191
```sh
92-
sudo apt install ansible
93-
ansible-galaxy collection install kubernetes.core #install dependencies for k8s
92+
sudo apt install ansible -y
9493
cd setup-scripts/setup-genai-studio
95-
ansible-playbook genai-studio-playbook.yml
94+
ansible-playbook genai-studio.yml
9695
```
97-
_Note: you can review the deployment configurations in [genai-studio-playbook.yml](https://github.com/opea-project/GenAIStudio/blob/main/setup-scripts/setup-genai-studio/genai-studio-playbook.yml)_
96+
_Note: you can review the deployment configurations in [genai-studio.yml](./setup-scripts/setup-genai-studio/genai-studio.yml)_
9897

9998

10099
## Getting Started with GenAIStudio
46.2 KB
Loading

setup-scripts/build-image-to-registry/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ The ansible scripts used here are building, tag and push to the specified contai
1111

1212
Run below commands:
1313
```sh
14-
sudo apt install ansible
14+
sudo apt install ansible -y
1515
ansible-playbook build-image-to-registry.yml
1616
```

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ spec:
285285
resources:
286286
requests:
287287
storage: "5Gi"
288+
storageClassName: local-path
288289
---
289290
# Source: kube-prometheus-stack/charts/grafana/templates/clusterrole.yaml
290291
kind: ClusterRole
@@ -1664,6 +1665,7 @@ spec:
16641665
storage:
16651666
volumeClaimTemplate:
16661667
spec:
1668+
storageClassName: local-path
16671669
accessModes: ["ReadWriteOnce"]
16681670
resources:
16691671
requests:

setup-scripts/setup-genai-studio/playbooks/deploy-monitoring.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
- name: Deploy prometheus and grafana
1+
- name: Deploy prometheus and grafana with local-path-storage
22
hosts: localhost
33
tasks:
4-
- name: Create directory for Prometheus data
5-
file:
6-
path: /mnt/data/prometheus
7-
state: directory
8-
mode: '0777'
9-
become: yes
10-
4+
- name: Check if local-path-storage namespace exists
5+
shell: kubectl get namespace local-path-storage --ignore-not-found
6+
register: namespace_check
7+
ignore_errors: yes
8+
changed_when: false
9+
10+
- name: Install local-path-provisioner if namespace does not exist
11+
shell: kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.30/deploy/local-path-storage.yaml
12+
when: namespace_check.stdout == ""
13+
register: apply_output
14+
15+
- name: Wait for local-path-provisioner to be ready
16+
shell: kubectl wait --for=condition=Ready pod -l app=local-path-provisioner -n local-path-storage --timeout=120s
17+
when: namespace_check.stdout == ""
18+
1119
- name: Create monitoring namespace
1220
command: kubectl create namespace monitoring
1321
ignore_errors: yes

setup-scripts/setup-genai-studio/playbooks/deploy-studio.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
command: kubectl create namespace studio
1515
ignore_errors: yes
1616

17+
- name: Check for coredns service
18+
shell: kubectl get svc coredns -n kube-system --ignore-not-found
19+
register: coredns_check
20+
ignore_errors: yes
21+
changed_when: false
22+
23+
- name: Update manifest if coredns is available
24+
shell: sed -i 's/kube-dns/coredns/g' ../manifests/studio-manifest.yaml
25+
when: coredns_check.stdout != ''
26+
1727
- name: Apply customized studio manifest
1828
shell: "envsubst '${REGISTRY} ${TAG}' < ../manifests/studio-manifest.yaml | kubectl apply -f -"
1929
environment:

0 commit comments

Comments
 (0)