Skip to content

Commit ef2047b

Browse files
authored
Adjustments for helm release change (#1173)
Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
1 parent 9423158 commit ef2047b

File tree

2 files changed

+10
-54
lines changed

2 files changed

+10
-54
lines changed

ChatQnA/benchmark/performance/kubernetes/intel/gaudi/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ Results will be displayed in the terminal and saved as CSV file named `1_stats.c
6969
- Persistent Volume Claim (PVC): This is the recommended approach for production setups. For more details on using PVC, refer to [PVC](https://github.com/opea-project/GenAIInfra/blob/main/helm-charts/README.md#using-persistent-volume).
7070
- Local Host Path: For simpler testing, ensure that each node involved in the deployment follows the steps above to locally prepare the models. After preparing the models, use `--set global.modelUseHostPath=${MODELDIR}` in the deployment command.
7171

72-
- Add OPEA Helm Repository:
73-
```bash
74-
python deploy.py --add-repo
75-
```
7672
- Label Nodes
7773
```base
7874
python deploy.py --add-label --num-nodes 2
@@ -192,13 +188,9 @@ All the test results will come to the folder `GenAIEval/evals/benchmark/benchmar
192188

193189
## Teardown
194190

195-
After completing the benchmark, use the following commands to clean up the environment:
191+
After completing the benchmark, use the following command to clean up the environment:
196192

197193
Remove Node Labels:
198-
```base
199-
python deploy.py --delete-label
200-
```
201-
Delete the OPEA Helm Repository:
202194
```bash
203-
python deploy.py --delete-repo
195+
python deploy.py --delete-label
204196
```

ChatQnA/benchmark/performance/kubernetes/intel/gaudi/deploy.py

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,6 @@ def clear_labels_from_nodes(label, node_names=None):
8383
print(f"Label {label_key} not found on node {node_name}, skipping.")
8484

8585

86-
def add_helm_repo(repo_name, repo_url):
87-
# Add the repo if it does not exist
88-
add_command = ["helm", "repo", "add", repo_name, repo_url]
89-
try:
90-
subprocess.run(add_command, check=True)
91-
print(f"Added Helm repo {repo_name} from {repo_url}.")
92-
except subprocess.CalledProcessError as e:
93-
print(f"Failed to add Helm repo {repo_name}: {e}")
94-
95-
96-
def delete_helm_repo(repo_name):
97-
"""Delete Helm repo if it exists."""
98-
command = ["helm", "repo", "remove", repo_name]
99-
try:
100-
subprocess.run(command, check=True)
101-
print(f"Deleted Helm repo {repo_name}.")
102-
except subprocess.CalledProcessError:
103-
print(f"Failed to delete Helm repo {repo_name}. It may not exist.")
104-
105-
10686
def install_helm_release(release_name, chart_name, namespace, values_file, device_type):
10787
"""Deploy a Helm release with a specified name and chart.
10888
@@ -132,14 +112,14 @@ def install_helm_release(release_name, chart_name, namespace, values_file, devic
132112
if device_type == "gaudi":
133113
print("Device type is gaudi. Pulling Helm chart to get gaudi-values.yaml...")
134114

135-
# Pull and untar the chart
136-
subprocess.run(["helm", "pull", chart_name, "--untar"], check=True)
115+
# Combine chart_name with fixed prefix
116+
chart_pull_url = f"oci://ghcr.io/opea-project/charts/{chart_name}"
137117

138-
# Determine the directory name (get the actual chart_name if chart_name is in the format 'repo_name/chart_name', else use chart_name directly)
139-
chart_dir_name = chart_name.split("/")[-1] if "/" in chart_name else chart_name
118+
# Pull and untar the chart
119+
subprocess.run(["helm", "pull", chart_pull_url, "--untar"], check=True)
140120

141-
# Find the untarred directory (assumes only one directory matches chart_dir_name)
142-
untar_dirs = glob.glob(f"{chart_dir_name}*")
121+
# Find the untarred directory
122+
untar_dirs = glob.glob(f"{chart_name}*")
143123
if untar_dirs:
144124
untar_dir = untar_dirs[0]
145125
hw_values_file = os.path.join(untar_dir, "gaudi-values.yaml")
@@ -210,20 +190,14 @@ def main():
210190
parser.add_argument(
211191
"--chart-name",
212192
type=str,
213-
default="opea/chatqna",
214-
help="The chart name to deploy, composed of repo name and chart name (default: opea/chatqna).",
193+
default="chatqna",
194+
help="The chart name to deploy, composed of repo name and chart name (default: chatqna).",
215195
)
216196
parser.add_argument("--namespace", default="default", help="Kubernetes namespace (default: default).")
217197
parser.add_argument("--hf-token", help="Hugging Face API token.")
218198
parser.add_argument(
219199
"--model-dir", help="Model directory, mounted as volumes for service access to pre-downloaded models"
220200
)
221-
parser.add_argument("--repo-name", default="opea", help="Helm repo name to add/delete (default: opea).")
222-
parser.add_argument(
223-
"--repo-url",
224-
default="https://opea-project.github.io/GenAIInfra",
225-
help="Helm repository URL (default: https://opea-project.github.io/GenAIInfra).",
226-
)
227201
parser.add_argument("--user-values", help="Path to a user-specified values.yaml file.")
228202
parser.add_argument(
229203
"--create-values-only", action="store_true", help="Only create the values.yaml file without deploying."
@@ -244,8 +218,6 @@ def main():
244218
action="store_true",
245219
help="Modify resources for services and change extraCmdArgs when creating values.yaml.",
246220
)
247-
parser.add_argument("--add-repo", action="store_true", help="Add the Helm repo specified by --repo-url.")
248-
parser.add_argument("--delete-repo", action="store_true", help="Delete the Helm repo specified by --repo-name.")
249221
parser.add_argument(
250222
"--device-type",
251223
type=str,
@@ -264,14 +236,6 @@ def main():
264236
else:
265237
args.num_nodes = num_node_names
266238

267-
# Helm repository management
268-
if args.add_repo:
269-
add_helm_repo(args.repo_name, args.repo_url)
270-
return
271-
elif args.delete_repo:
272-
delete_helm_repo(args.repo_name)
273-
return
274-
275239
# Node labeling management
276240
if args.add_label:
277241
add_labels_to_nodes(args.num_nodes, args.label, args.node_names)

0 commit comments

Comments
 (0)