Skip to content

Commit f13999d

Browse files
committed
Fix super-linter complaints
1 parent 2cdaac1 commit f13999d

File tree

7 files changed

+52
-55
lines changed

7 files changed

+52
-55
lines changed

.github/linters/.markdown-lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"default": true,
33
"MD003": false,
44
"MD013": false,
5-
"MD033": false
6-
}
5+
"MD033": false,
6+
"MD036": false
7+
}

GPU_provisioning.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ spec:
4343
4444
Use `kubectl` or `oc` command line to create new machineset `oc apply -f gpu_machineset.yaml`
4545

46-
Depending on type of EC2 instance creation of the new machines make take some time. Please note that all nodes with GPU will have labels(`node-role.kubernetes.io/odh-notebook`in our case) and taints (`odh-notebook `) that we have specified in machineset applied automatically
46+
Depending on type of EC2 instance creation of the new machines make take some
47+
time. Please note that all nodes with GPU will have
48+
labels(`node-role.kubernetes.io/odh-notebook` in our case) and taints
49+
(`odh-notebook`) that we have specified in machineset applied automatically
4750

4851
## Install Node Feature Operator
4952

50-
From OperatorHub install `Node Feature Discovery Operator` , accepting defaults . Once Operator has been installed , create `NodeFeatureDiscovery`instance . Use default entries unless you something specific is needed . Node Feature Discovery Operator will add labels to nodes based on available hardware resources
53+
From OperatorHub install `Node Feature Discovery Operator` , accepting
54+
defaults. Once Operator has been installed, create
55+
`NodeFeatureDiscovery`instance. Use default entries unless you something
56+
specific is needed. Node Feature Discovery Operator will add labels to nodes
57+
based on available hardware resources.
5158

5259
![Diagram](images/node-feature-discovery.png)
5360

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ OpenShift to generate project proposals for specific Red Hat products.
1818
- Podman
1919
- Red Hat Openshift cluster running in AWS. Supported regions are : us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 sa-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-southeast-1 ap-southeast-2 ap-south-1.
2020
- GPU Node to run Hugging Face Text Generation Inference server on Red Hat OpenShift cluster.
21-
- Create a fork of the [rag-llm-gitops](https://github.com/validatedpatterns/rag-llm-gitops.git) git repository.
21+
- Create a fork of the [rag-llm-gitops](https://github.com/validatedpatterns/rag-llm-gitops.git) Git repository.
2222

2323
## Demo Description & Architecture
2424

@@ -33,52 +33,45 @@ The application generates a project proposal for a Red Hat product.
3333
- Multiple LLM providers (OpenAI, Hugging Face, NVIDIA).
3434
- Vector Database, such as EDB Postgres for Kubernetes or Redis, to store embeddings of Red Hat product documentation.
3535
- Monitoring dashboard to provide key metrics such as ratings.
36-
- GitOps setup to deploy e2e demo (frontend / vector database / served models).
36+
- GitOps setup to deploy end-to-end demo (frontend / vector database / served models).
3737

3838
![Overview](https://gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/images/intro-marketectures/rag-demo-vp-marketing-slide.png)
3939

4040
_Figure 1. Overview of the validated pattern for RAG Demo with Red Hat OpenShift_
4141

42-
4342
![Logical](https://gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/images/logical-diagrams/rag-demo-vp-ld.png)
4443

4544
_Figure 2. Logical diagram of the RAG Demo with Red Hat OpenShift._
4645

47-
4846
#### RAG Demo Workflow
4947

5048
![Overview of workflow](https://gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/images/schematic-diagrams/rag-demo-vp-sd.png)
5149

5250
_Figure 3. Schematic diagram for workflow of RAG demo with Red Hat OpenShift._
5351

54-
5552
#### RAG Data Ingestion
5653

5754
![ingestion](https://gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/images/schematic-diagrams/rag-demo-vp-ingress-sd.png)
5855

5956
_Figure 4. Schematic diagram for Ingestion of data for RAG._
6057

61-
6258
#### RAG Augmented Query
6359

64-
6560
![query](https://gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/images/schematic-diagrams/rag-demo-vp-query-sd.png)
6661

6762
_Figure 5. Schematic diagram for RAG demo augmented query._
6863

69-
7064
In Figure 5, we can see RAG augmented query. [IBM Granite 3.1-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct) model is used for language processing, LangChain to
7165
integrate different tools of the LLM-based application together and to process the PDF
7266
files and web pages, vector database provider such as EDB Postgres for Kubernetes or Redis, is used to store vectors, and [Red Hat OpenShift AI](https://www.redhat.com/en/technologies/cloud-computing/openshift/openshift-ai) to serve the [IBM Granite 3.1-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct) model, Gradio is used for user interface and object storage to store language model and other datasets.
7367
Solution components are deployed as microservices in the Red Hat OpenShift cluster.
7468

75-
7669
#### Download diagrams
70+
7771
View and download all of the diagrams above in our open source tooling site.
7872

7973
[Open Diagrams](https://www.redhat.com/architect/portfolio/tool/index.html?#gitlab.com/osspa/portfolio-architecture-examples/-/raw/main/diagrams/rag-demo-vp.drawio)
8074

81-
8275
![Diagram](images/diagram.png)
8376
_Figure 6. Proposed demo architecture with OpenShift AI_
8477

@@ -93,11 +86,11 @@ _Figure 6. Proposed demo architecture with OpenShift AI_
9386

9487
## Deploying the demo
9588

96-
To run the demo, ensure the Podman is running on your machine.Fork the [rag-llm-gitops](https://github.com/validatedpatterns/rag-llm-gitops) repo into your organization
89+
To run the demo, ensure the Podman is running on your machine.Fork the [rag-llm-gitops](https://github.com/validatedpatterns/rag-llm-gitops) repository into your organization
9790

9891
### Login to OpenShift cluster
9992

100-
Replace the token and the api server url in the command below to login to the OpenShift cluster.
93+
Replace the token and the API server URL in the command below to login to the OpenShift cluster.
10194

10295
```sh
10396
oc login --token=<token> --server=<api_server_url> # login to Openshift cluster
@@ -112,7 +105,7 @@ cd rag-llm-gitops
112105
113106
### Configuring model
114107
115-
This pattern deploys [IBM Granite 3.1-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct) out of box. Run the following command to configure vault with the model Id.
108+
This pattern deploys [IBM Granite 3.1-8B-Instruct](https://huggingface.co/ibm-granite/granite-3.1-8b-instruct) out of box. Run the following command to configure vault with the model ID.
116109
117110
```sh
118111
# Copy values-secret.yaml.template to ~/values-secret-rag-llm-gitops.yaml.
@@ -254,10 +247,10 @@ By default, Grafana application is deployed in `llm-monitoring` namespace.To lau
254247
![Routes](images/monitoring.png)
255248
256249
## Test Plan
250+
257251
GOTO: [Test Plan](./TESTPLAN.md)
258252
259253
## Licenses
260254
261255
EDB Postgres for Kubernetes is distributed under the EDB Limited Usage License
262256
Agreement, available at [enterprisedb.com/limited-use-license](https://www.enterprisedb.com/limited-use-license).
263-

TESTPLAN.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Test Cases for E2E Demo.
1+
# Test Cases for End-to-End Demo
22

33
- [Provisioning of GPU Node](https://github.com/validatedpatterns-sandbox/rag-llm-gitops/blob/main/GPU_provisioning.md)
44

55
- MachineSet is created.
6-
- Name of the machine set <clustername>-gpu-<AWSregion>. This should not be a hard requirement though.
6+
- Name of the machine set <clustername>-gpu-<AWSregion>. This should not be a hard requirement though.
77
- Machine set has taint section
8+
89
```yaml
910
taints:
1011
- effect: NoSchedule
@@ -13,13 +14,15 @@
1314
```
1415
1516
- MachineSet has a label
17+
1618
```yaml
1719
metadata:
1820
labels:
1921
node-role.kubernetes.io/odh-notebook: '' <--- Put your label if needed
2022
```
2123
2224
- MachineSet instance type
25+
2326
```yaml
2427
providerSpec:
2528
value:
@@ -40,16 +43,16 @@
4043
- Click on the Node Feature Discovery Operator. Under NodeFeatureDiscovery an instance should be created. Status should be Available.
4144
![nfd instance](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-nfd-instance.png)
4245
43-
4446
- Verify NVIDIA GPU Operator is installed.
4547
- NVIDIA GPU Operator is installed
46-
48+
4749
![nvidia operator](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-nvidia-operator.png)
4850
4951
- Click on the NVIDIA GPU Operator and click on ClusterPolicy. A gpu-cluster-policy should exist
50-
![nvidia clusterpolicies](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-nvidia-clusterpolicies.png)
52+
![nvidia clusterpolicies](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-nvidia-clusterpolicies.png)
5153
5254
- Click on the gpu-cluster-policy and click on the YAML tab. The YAML should contain the tolerations
55+
5356
```yaml
5457
tolerations:
5558
- effect: NoSchedule
@@ -59,13 +62,13 @@
5962
6063
- Application provisioned correctly.
6164
- Click on the rag-llm namespace
62-
65+
6366
- By Default, EDB Operator will be deployed, which will deploy PGVECTOR vector database, 6 pods should be running
6467
![ragllm pgvector pods](https://validatedpatterns.io/images/rag-llm-gitops/rag-llm-pgvector.png)
6568
6669
- If the global.db.type is set to REDIS in the values-global.yaml, four pods should be running
6770
![ragllm pods](https://validatedpatterns.io/images/rag-llm-gitops/rag-llm.png)
68-
71+
6972
- Click on Networking → Routes from the left Navigation panel. An llm-ui route should exist
7073
![llm-ui route](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-application_route.png)
7174
@@ -88,10 +91,5 @@
8891
- Enter the Grafana admin credentials.
8992
- Ratings are displayed for each model
9093
- Grafana Dashboard is displayed
91-
92-
![llm-ui grafana](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-grafana.png)
93-
94-
95-
96-
9794

95+
![llm-ui grafana](https://validatedpatterns.io/images/rag-llm-gitops/ragllm-grafana.png)

tests/interop/test_subscription_status_hub.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def test_subscription_status_hub(openshift_dyn_client):
1313
# These are the operator subscriptions and their associated namespaces
1414
expected_subs = {
1515
"openshift-gitops-operator": ["openshift-operators"],
16-
"prometheus": ["llm-monitoring"],
17-
"grafana-operator": ["llm-monitoring"],
18-
"nfd": ["openshift-nfd"],
19-
"gpu-operator-certified": ["nvidia-gpu-operator"],
16+
"prometheus": ["llm-monitoring"],
17+
"grafana-operator": ["llm-monitoring"],
18+
"nfd": ["openshift-nfd"],
19+
"gpu-operator-certified": ["nvidia-gpu-operator"],
2020
}
2121

2222
err_msg = subscription.subscription_status(

tests/interop/test_validate_gpu_nodes.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
import logging
12
import os
23
import re
34
import subprocess
5+
46
import pytest
5-
import logging
6-
import yaml
77
from ocp_resources.machine_set import MachineSet
88
from ocp_resources.node import Node
9-
from ocp_resources.pod import Pod
9+
1010
from . import __loggername__
11-
from openshift.dynamic.exceptions import NotFoundError
1211

1312
logger = logging.getLogger(__loggername__)
1413

@@ -34,7 +33,7 @@ def test_validate_gpu_nodes(openshift_dyn_client):
3433
break
3534

3635
err_msg = "GPU machineset not found"
37-
if found == True:
36+
if found:
3837
logger.info(
3938
f"PASS: Found GPU machineset: {gpu_machineset.instance.metadata.name}"
4039
)
@@ -129,7 +128,7 @@ def test_validate_gpu_node_role_labels_pods(openshift_dyn_client):
129128
# logger.info(node_count)
130129

131130
if len(gpu_nodes) == 3:
132-
logger.info(f"PASS: Found 'worker' and 'odh-notebook' GPU node-role labels")
131+
logger.info("PASS: Found 'worker' and 'odh-notebook' GPU node-role labels")
133132
else:
134133
err_msg = "Could not find 'worker' and 'odh-notebook' GPU node-role label"
135134
logger.error(f"FAIL: {err_msg}")
@@ -171,4 +170,4 @@ def test_validate_gpu_node_role_labels_pods(openshift_dyn_client):
171170
logger.error(f"FAIL: {err_msg}")
172171
assert False, err_msg
173172
else:
174-
logger.info(f"PASS: Found the expected pod count for GPU nodes")
173+
logger.info("PASS: Found the expected pod count for GPU nodes")

tests/interop/test_validate_hub_site_components.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import pytest
66
from ocp_resources.pod import Pod
77
from ocp_resources.route import Route
8-
from openshift.dynamic.exceptions import NotFoundError
98
from ocp_resources.storage_class import StorageClass
9+
from openshift.dynamic.exceptions import NotFoundError
1010
from validatedpatterns_tests.interop import application, components
1111

1212
from . import __loggername__
@@ -44,10 +44,7 @@ def test_validate_hub_site_reachable(kube_config, openshift_dyn_client):
4444
@pytest.mark.check_pod_status_hub
4545
def test_check_pod_status(openshift_dyn_client):
4646
logger.info("Checking pod status")
47-
projects = [
48-
"nvidia-gpu-operator",
49-
"rag-llm"
50-
]
47+
projects = ["nvidia-gpu-operator", "rag-llm"]
5148
err_msg = components.check_pod_status(openshift_dyn_client, projects)
5249
if err_msg:
5350
logger.error(f"FAIL: {err_msg}")
@@ -59,9 +56,7 @@ def test_check_pod_status(openshift_dyn_client):
5956
@pytest.mark.check_pod_count_hub
6057
def test_check_pod_count_hub(openshift_dyn_client):
6158
logger.info("Checking pod count")
62-
projects = {
63-
"rag-llm": 4
64-
}
59+
projects = {"rag-llm": 4}
6560

6661
failed = []
6762
for key in projects.keys():
@@ -74,7 +69,8 @@ def test_check_pod_count_hub(openshift_dyn_client):
7469
count += 1
7570

7671
logger.info(f"Found {count} pods")
77-
if count < projects[key]: failed.append(key)
72+
if count < projects[key]:
73+
failed.append(key)
7874

7975
if len(failed) > 0:
8076
err_msg = f"Failed to find the expected pod count for: {failed}"
@@ -121,7 +117,8 @@ def test_validate_nodefeaturediscovery():
121117
logger.info("Check for nodefeaturediscovery instance")
122118

123119
cmd_out = subprocess.run(
124-
[oc, "get", "NodeFeatureDiscovery", "-n", namespace, name, "--no-headers"], capture_output=True
120+
[oc, "get", "NodeFeatureDiscovery", "-n", namespace, name, "--no-headers"],
121+
capture_output=True,
125122
)
126123
if cmd_out.stdout:
127124
logger.info(cmd_out.stdout.decode("utf-8"))
@@ -133,19 +130,21 @@ def test_validate_nodefeaturediscovery():
133130
@pytest.mark.validate_gpu_clusterpolicy
134131
def test_validate_gpu_clusterpolicy():
135132
name = "rag-llm-gpu-cluster-policy"
136-
tolerations = '"tolerations":[{"effect":"NoSchedule","key":"odh-notebook","value":"true"}]'
133+
tolerations = (
134+
'"tolerations":[{"effect":"NoSchedule","key":"odh-notebook","value":"true"}]'
135+
)
137136
logger.info("Check for GPU clusterpolicy")
138137

139138
cmd_out = subprocess.run(
140139
[oc, "get", "ClusterPolicy", "-o", "yaml", name], capture_output=True
141140
)
142141
if cmd_out.stdout:
143142
logger.info(cmd_out.stdout.decode("utf-8"))
144-
143+
145144
if tolerations in cmd_out.stdout.decode("utf-8"):
146145
logger.info("PASS: Found GPU clusterpolicy and tolerations")
147146
else:
148-
err_msg =f"FAIL: Expected tolerations not found"
147+
err_msg = "FAIL: Expected tolerations not found"
149148
logger.error(f"FAIL: {err_msg}")
150149
assert False, err_msg
151150
else:

0 commit comments

Comments
 (0)