Skip to content

Commit c481a9b

Browse files
Merge pull request #22 from xsqian/main
adding instruction for setup the demo on platform mck, running with u…
2 parents e2a477b + e9f5fff commit c481a9b

File tree

3 files changed

+102
-44
lines changed

3 files changed

+102
-44
lines changed

env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
S3_BUCKET_NAME=
2+
OPENAI_API_BASE=
3+
OPENAI_API_KEY=

notebook.ipynb

Lines changed: 77 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"outputs": [],
6464
"source": [
65-
"# !pip install SQLAlchemy==2.0.31"
65+
"!pip install SQLAlchemy==2.0.31 pymysql"
6666
]
6767
},
6868
{
@@ -74,6 +74,14 @@
7474
"Please set the following configuration - choose compute device: CPU or GPU, choose the language of the calls, and whether to skip the calls generation workflow and use pre-generated data."
7575
]
7676
},
77+
{
78+
"cell_type": "markdown",
79+
"id": "c1a3e034-151f-46d0-b6f7-38876c113a8b",
80+
"metadata": {},
81+
"source": [
82+
"#### Setup in Iguazio Cluster"
83+
]
84+
},
7785
{
7886
"cell_type": "markdown",
7987
"id": "330ea34f-2d34-472c-995f-9f171afb03cf",
@@ -85,9 +93,27 @@
8593
"- Please set `run_with_gpu = False`, `use_sqlite = False`, `engine = \"remote\"`"
8694
]
8795
},
96+
{
97+
"cell_type": "markdown",
98+
"id": "6c44bb2b-5ded-49d6-ae4d-7fa9ca67d1e4",
99+
"metadata": {},
100+
"source": [
101+
"#### Setup in Platform McK"
102+
]
103+
},
104+
{
105+
"cell_type": "markdown",
106+
"id": "05e3b4b8-d370-4fcf-944b-e8f3b478fa24",
107+
"metadata": {},
108+
"source": [
109+
"- GPU is not supported at the moment.\n",
110+
"- sqlite is supported.\n",
111+
"- Please set `run_with_gpu = False`, `use_sqlite = True`, `engine = \"remote\"`"
112+
]
113+
},
88114
{
89115
"cell_type": "code",
90-
"execution_count": null,
116+
"execution_count": 37,
91117
"id": "76f05c23312057a3",
92118
"metadata": {},
93119
"outputs": [],
@@ -96,7 +122,7 @@
96122
"run_with_gpu = False\n",
97123
"language = \"en\" # The languages of the calls, es - Spanish, en - English\n",
98124
"skip_calls_generation = False\n",
99-
"use_sqlite = False"
125+
"use_sqlite = True"
100126
]
101127
},
102128
{
@@ -108,7 +134,7 @@
108134
"\n",
109135
"> **⚠️ Important** Please fill the following variables in your `.env` file.\n",
110136
"\n",
111-
"Three tokens are required to run the demo end-to-end:\n",
137+
"Tokens are required to run the demo end-to-end:\n",
112138
"* [OpenAI ChatGPT](https://chat.openai.com/) — To generate conversations, two tokens are required:\n",
113139
" * `OPENAI_API_KEY`\n",
114140
" * `OPENAI_API_BASE`\n",
@@ -120,17 +146,31 @@
120146
"> If you wish to install mysql using helm chart you can use the command below - \n",
121147
"> * `helm install -n <\"namesapce\"> myrelease bitnami/mysql --set auth.rootPassword=sql123 --set auth.database=mlrun_demos --set primary.service.ports.mysql=3111 --set primary.persistence.enabled=false`\n",
122148
"> * Example for MYSQL_URL if you use the above command - `mysql+pymysql://root:sql123@myrelease-mysql.<\"namesapce\">.svc.cluster.local:3111/mlrun_demos`\n",
123-
"\n"
149+
"\n",
150+
"For Platform Mck, a s3 bucket name needs to be in the `.env`\n",
151+
"* [S3 Bucket]() &mdash; \n",
152+
" * `S3_BUCKET_NAME`"
124153
]
125154
},
126155
{
127156
"cell_type": "code",
128-
"execution_count": null,
157+
"execution_count": 38,
129158
"id": "7e7503f4-8830-4972-a986-10f4c29624b9",
130159
"metadata": {
131160
"tags": []
132161
},
133-
"outputs": [],
162+
"outputs": [
163+
{
164+
"data": {
165+
"text/plain": [
166+
"True"
167+
]
168+
},
169+
"execution_count": 38,
170+
"metadata": {},
171+
"output_type": "execute_result"
172+
}
173+
],
134174
"source": [
135175
"import dotenv\n",
136176
"import os\n",
@@ -145,14 +185,12 @@
145185
},
146186
{
147187
"cell_type": "code",
148-
"execution_count": null,
188+
"execution_count": 39,
149189
"id": "d33fc614-2898-4b12-b34f-62181651a9b5",
150190
"metadata": {},
151191
"outputs": [],
152192
"source": [
153193
"assert not run_with_gpu\n",
154-
"assert not use_sqlite\n",
155-
"assert os.environ[\"MYSQL_URL\"]\n",
156194
"assert os.environ[\"OPENAI_API_BASE\"]\n",
157195
"assert os.environ[\"OPENAI_API_KEY\"]"
158196
]
@@ -189,20 +227,28 @@
189227
},
190228
{
191229
"cell_type": "code",
192-
"execution_count": null,
230+
"execution_count": 40,
193231
"id": "80b388f8-5aa3-4b6a-9b6d-b6dca242165e",
194232
"metadata": {
195-
"scrolled": true,
196233
"tags": []
197234
},
198-
"outputs": [],
235+
"outputs": [
236+
{
237+
"name": "stdout",
238+
"output_type": "stream",
239+
"text": [
240+
"Project Source: git://github.com/xsqian/demo-call-center.git#main\n",
241+
"> 2025-08-02 02:13:41,912 [info] Project loaded successfully: {\"project_name\":\"call-center-demo-jovyan\"}\n"
242+
]
243+
}
244+
],
199245
"source": [
200246
"project_name=\"call-center-demo\"\n",
201247
"project = mlrun.get_or_create_project(\n",
202248
" name=project_name,\n",
203249
" user_project=True,\n",
204250
" parameters={\n",
205-
" \"build_image\": True,\n",
251+
" \"build_image\": False,\n",
206252
" \"source\": \"git://github.com/xsqian/demo-call-center.git#main\",\n",
207253
" \"gpus\": 1 if run_with_gpu else 0,\n",
208254
" \"use_sqlite\": use_sqlite,\n",
@@ -258,7 +304,7 @@
258304
},
259305
{
260306
"cell_type": "code",
261-
"execution_count": null,
307+
"execution_count": 41,
262308
"id": "adc25213-d4d6-411d-a9b0-edf91007ba33",
263309
"metadata": {},
264310
"outputs": [],
@@ -305,10 +351,21 @@
305351
},
306352
{
307353
"cell_type": "code",
308-
"execution_count": null,
354+
"execution_count": 42,
309355
"id": "8d3d7cca-ff52-4ffd-98df-7d70e8b083cf",
310356
"metadata": {},
311-
"outputs": [],
357+
"outputs": [
358+
{
359+
"data": {
360+
"text/plain": [
361+
"<mlrun.projects.project.MlrunProject at 0x7fbc266674f0>"
362+
]
363+
},
364+
"execution_count": 42,
365+
"metadata": {},
366+
"output_type": "execute_result"
367+
}
368+
],
312369
"source": [
313370
"project.spec.params['build_image']=False\n",
314371
"project.save()"
@@ -611,9 +668,9 @@
611668
],
612669
"metadata": {
613670
"kernelspec": {
614-
"display_name": "py311",
671+
"display_name": "Python 3 (ipykernel)",
615672
"language": "python",
616-
"name": "conda-env-.conda-py311-py"
673+
"name": "python3"
617674
},
618675
"language_info": {
619676
"codemirror_mode": {
@@ -625,7 +682,7 @@
625682
"name": "python",
626683
"nbconvert_exporter": "python",
627684
"pygments_lexer": "ipython3",
628-
"version": "3.11.13"
685+
"version": "3.9.13"
629686
}
630687
},
631688
"nbformat": 4,

project.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1+
kind: project
12
status:
23
state: online
34
metadata:
4-
created: '2025-07-21T22:58:34.737000'
5-
name: call-center-demo-xingsheng
6-
kind: project
5+
created: '2025-07-31T22:36:27.957000'
6+
name: call-center-demo-jovyan
77
spec:
8-
params:
9-
build_image: false
10-
source: git://github.com/xsqian/demo-call-center.git#main
11-
gpus: 0
12-
use_sqlite: false
13-
default_image_name: .mlrun-project-image-zzz-xingsheng
14-
default_image: .mlrun-project-image-call-center-demo
15-
origin_url: git://github.com/xsqian/demo-call-center.git#refs/heads/main
16-
desired_state: online
17-
load_source_on_run: false
8+
workflows:
9+
- path: ./src/workflows/calls_generation.py
10+
name: calls-generation
11+
image: .mlrun-project-image-call-center-demo
12+
- path: ./src/workflows/calls_analysis.py
13+
name: calls-analysis
14+
image: .mlrun-project-image-call-center-demo
1815
functions:
1916
- url: hub://structured_data_generator
2017
name: structured-data-generator
@@ -51,9 +48,18 @@ spec:
5148
requirements:
5249
- vizro==0.1.38
5350
- gunicorn
51+
source: git://github.com/mlrun/demo-call-center.git#main
52+
default_image: .mlrun-project-image-call-center-demo
53+
params:
54+
build_image: false
55+
source: git://github.com/mlrun/demo-call-center.git#main
56+
gpus: 0
57+
use_sqlite: true
58+
default_image: .mlrun-project-image-call-center-demo
59+
origin_url: git://github.com/mlrun/demo-call-center.git#refs/heads/main
5460
build:
55-
source_code_target_dir: /home/mlrun_code/
5661
image: .mlrun-project-image-call-center-demo
62+
source_code_target_dir: /home/mlrun_code/
5763
commands:
5864
- apt-get update -y && apt-get install ffmpeg -y
5965
- pip install transformers==4.44.1
@@ -69,14 +75,6 @@ spec:
6975
- pip uninstall -y onnxruntime-gpu onnxruntime
7076
- pip install onnxruntime
7177
base_image: mlrun/mlrun-kfp
78+
desired_state: online
79+
load_source_on_run: false
7280
conda: ''
73-
source: git://github.com/xsqian/demo-call-center.git#main
74-
owner: xingsheng
75-
default_image: .mlrun-project-image-call-center-demo
76-
workflows:
77-
- path: ./src/workflows/calls_generation.py
78-
name: calls-generation
79-
image: .mlrun-project-image-call-center-demo
80-
- path: ./src/workflows/calls_analysis.py
81-
name: calls-analysis
82-
image: .mlrun-project-image-call-center-demo

0 commit comments

Comments
 (0)