-
Notifications
You must be signed in to change notification settings - Fork 37
Add a custom rag blueprint chart + dependencies #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
shivamerla
wants to merge
7
commits into
NVIDIA:main
Choose a base branch
from
shivamerla:rag_dependencies
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c083305
Add a custom rag blueprint chart + dependencies
shivamerla 71855f2
Disable all deps through nv-ingest
shivamerla da517fc
DRA integration
varunrsekar e9074a8
Merge pull request #1 from varunrsekar/rag-mig
shivamerla 2f2184c
Merge branch 'main' into rag_dependencies
shivamerla 1fce9c0
Update rag-server values and bug fixes
shivamerla dea62aa
Merge branch 'main' into rag_dependencies
shivamerla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| # defaults file for rag | ||
| namespace: "rag" | ||
|
|
||
| # Milvus Helm chart details | ||
| milvus: | ||
| enabled: true | ||
| helm_repo_name: "rag-milvus" | ||
| helm_repo_url: "https://zilliztech.github.io/milvus-helm/" | ||
| chart_name: "milvus/milvus" | ||
| chart_version: "4.1.11" | ||
|
|
||
| # Minio Helm chart details | ||
| minio: | ||
| enabled: true | ||
| helm_release_name: rag-minio | ||
| helm_oci_registry: oci://registry-1.docker.io/bitnamicharts/minio | ||
| username: minioadmin | ||
| password: minioadmin | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| # handlers file for rag blueprint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| galaxy_info: | ||
| author: your name | ||
| description: your role description | ||
| company: your company (optional) | ||
|
|
||
| # If the issue tracker for your role is not on github, uncomment the | ||
| # next line and provide a value | ||
| # issue_tracker_url: http://example.com/issue/tracker | ||
|
|
||
| # Choose a valid license ID from https://spdx.org - some suggested licenses: | ||
| # - BSD-3-Clause (default) | ||
| # - MIT | ||
| # - GPL-2.0-or-later | ||
| # - GPL-3.0-only | ||
| # - Apache-2.0 | ||
| # - CC-BY-4.0 | ||
| license: license (GPL-2.0-or-later, MIT, etc) | ||
|
|
||
| min_ansible_version: 2.1 | ||
|
|
||
| # If this a Container Enabled role, provide the minimum Ansible Container version. | ||
| # min_ansible_container_version: | ||
|
|
||
| # | ||
| # Provide a list of supported platforms, and for each platform a list of versions. | ||
| # If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
| # To view available platforms and versions (or releases), visit: | ||
| # https://galaxy.ansible.com/api/v1/platforms/ | ||
| # | ||
| # platforms: | ||
| # - name: Fedora | ||
| # versions: | ||
| # - all | ||
| # - 25 | ||
| # - name: SomePlatform | ||
| # versions: | ||
| # - all | ||
| # - 1.0 | ||
| # - 7 | ||
| # - 99.99 | ||
|
|
||
| galaxy_tags: [] | ||
| # List tags for your role here, one per line. A tag is a keyword that describes | ||
| # and categorizes the role. Users find roles by searching for tags. Be sure to | ||
| # remove the '[]' above, if you add tags to this list. | ||
| # | ||
| # NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
| # Maximum 20 tags per role. | ||
|
|
||
| dependencies: [] | ||
| # List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
| # if you add dependencies to this list. |
26 changes: 26 additions & 0 deletions
26
test/e2e/nemo-dependencies/rag/tasks/local-path-provisioner.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| - name: Check if 'local-path-storage' namespace exists | ||
| shell: kubectl get namespace local-path-storage --no-headers | ||
| register: ns_check | ||
| ignore_errors: true | ||
|
|
||
|
|
||
| - name: Deploy local-path-storage if not already deployed | ||
| shell: > | ||
| kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/{{ localPathProvisioner.version }}/deploy/local-path-storage.yaml | ||
| when: ns_check.rc != 0 | ||
|
|
||
| - name: Wait for local-path-provisioner deployment to be available | ||
| command: kubectl rollout status deployment/local-path-provisioner -n local-path-storage --timeout=120s | ||
| register: rollout_status | ||
| retries: 5 | ||
| delay: 10 | ||
| until: rollout_status.rc == 0 | ||
| when: ns_check.rc != 0 | ||
|
|
||
| - name: Set 'local-path' as the default StorageClass | ||
| shell: | | ||
| kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' | ||
| register: sc_patch_result | ||
| changed_when: "'patched' in sc_patch_result.stdout" | ||
| failed_when: sc_patch_result.rc != 0 | ||
| when: localPathProvisioner.default | bool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| # tasks file for evaluator | ||
| - include_tasks: local-path-provisioner.yaml | ||
| when: localPathProvisioner.enabled | ||
| - include_tasks: namespace.yaml | ||
| - include_tasks: milvus.yaml | ||
| when: milvus.enabled | ||
| - include_tasks: minio.yaml | ||
| when: minio.enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| - name: Get Kube API resources | ||
| command: kubectl api-resources --verbs=list --namespaced -o name | ||
| register: api_resources | ||
|
|
||
| - name: Check if the current cluster is OpenShift | ||
| set_fact: | ||
| is_openshift: "{{ 'routes.route.openshift.io' in api_resources.stdout_lines }}" | ||
|
|
||
|
|
||
| - name: OpenShift - Prepare RBAC to use anyuid SCC | ||
| ansible.builtin.template: | ||
| src: milvus-oc-rbac.yaml.j2 | ||
| dest: milvus-oc-rbac.yaml | ||
| when: is_openshift | ||
|
|
||
| - name: OpenShift - apply RBAC to use anyuid SCC | ||
| command: kubectl apply -f milvus-oc-rbac.yaml | ||
| when: is_openshift | ||
|
|
||
| - name: Add Helm repository for Milvus | ||
| command: helm repo add {{ milvus.helm_repo_name }} {{ milvus.helm_repo_url }} | ||
|
|
||
| - name: Update Helm repositories | ||
| command: helm repo update | ||
|
|
||
| - name: Template values file | ||
| ansible.builtin.template: | ||
| src: milvus-values.yaml.j2 | ||
| dest: milvus-values.yaml | ||
|
|
||
| - name: OpenShift - configure Milvus to use its dedicated service account | ||
| blockinfile: | ||
| path: milvus-values.yaml | ||
| marker: "# {mark} ANSIBLE MANAGED BLOCK" | ||
| insertafter: "^(.*)$" | ||
| block: | | ||
| serviceAccount: | ||
| create: false | ||
| name: milvus | ||
| when: is_openshift | ||
|
|
||
| - name: Install Milvus Helm chart | ||
| shell: > | ||
| helm upgrade --install {{ milvus.helm_repo_name }} | ||
| {{ milvus.chart_name }} | ||
| --namespace {{ namespace }} | ||
| --version {{ milvus.chart_version }} | ||
| --values milvus-values.yaml | ||
| register: helm_install_result | ||
| changed_when: "'STATUS: deployed' in helm_install_result.stdout" | ||
|
|
||
| - name: Verify Milvus installation | ||
| command: kubectl get pods -n {{ namespace }} | ||
| register: pods | ||
|
|
||
| - name: Wait for Milvus pod to be ready | ||
| command: kubectl wait --for=condition=Ready pod -n {{ namespace }} -l app.kubernetes.io/instance={{ milvus.helm_repo_name }} --timeout=300s | ||
|
|
||
| - name: Get Milvus pod details | ||
| shell: | | ||
| kubectl get pods -n {{ namespace }} -l app.kubernetes.io/instance={{ milvus.helm_repo_name }} -o json | ||
| register: milvus_pods | ||
| changed_when: false | ||
|
|
||
| - name: Get Milvus pod name | ||
| shell: | | ||
| kubectl get pods -n {{ namespace }} -l app.kubernetes.io/instance={{ milvus.helm_repo_name }} -o jsonpath='{.items[0].metadata.name}' | ||
| register: milvus_pod_name | ||
| failed_when: milvus_pod_name.stdout == "" | ||
| changed_when: false | ||
|
|
||
| - name: Debug Milvus pod name | ||
| debug: | ||
| msg: "Milvus pod name is {{ milvus_pod_name.stdout }}" | ||
|
|
||
| - name: Get the IP of the running Milvus pod | ||
| shell: | | ||
| kubectl get pod -n {{ namespace }} {{ milvus_pod_name.stdout }} -o jsonpath='{.status.podIP}' | ||
| register: milvus_pod_ip | ||
| failed_when: milvus_pod_ip.stdout == "" | ||
| changed_when: false | ||
|
|
||
| - name: Debug Milvus Pod IP | ||
| debug: | ||
| msg: "Milvus Pod IP is {{ milvus_pod_ip.stdout }}" | ||
| when: milvus_pod_ip | length > 0 | ||
|
|
||
| - name: Check Milvus service is responding | ||
| command: kubectl run milvus-check --image=busybox --restart=Never --attach --rm=true -- nc -w 10 -zv {{ milvus_pod_ip.stdout }} 19530 | ||
| register: milvus_status | ||
|
|
||
| - name: Display Milvus connectivity status | ||
| debug: | ||
| msg: "{{ '✅ Milvus is accessible!' if milvus_status.rc == 0 else '❌ Milvus is not reachable!' }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| - name: Template values file | ||
| ansible.builtin.template: | ||
| src: minio-values.yaml.j2 | ||
| dest: minio-values.yaml | ||
|
|
||
| - name: Install minio Helm chart | ||
| shell: > | ||
| helm upgrade --install {{ minio.helm_release_name }} | ||
| {{ minio.helm_oci_registry }} | ||
| --namespace {{ namespace }} | ||
| --values minio-values.yaml | ||
| register: helm_install_result | ||
| changed_when: "'STATUS: deployed' in helm_install_result.stdout" | ||
|
|
||
| - name: Verify MinIO installation | ||
| command: kubectl get pods -n {{ namespace }} | ||
| register: pods | ||
|
|
||
| - name: Check if mc (MinIO Client) is installed | ||
| command: which mc | ||
| register: mc_installed | ||
| ignore_errors: true | ||
|
|
||
| - name: Ensure ~/bin directory exists | ||
| file: | ||
| path: "{{ ansible_env.HOME }}/bin" | ||
| state: directory | ||
| mode: '0755' | ||
|
|
||
| - name: Install mc (MinIO Client) for Linux x86_64 | ||
| shell: | | ||
| curl -O https://dl.min.io/client/mc/release/linux-amd64/mc && | ||
| chmod +x mc && | ||
| mv mc {{ ansible_env.HOME }}/bin/mc | ||
| when: mc_installed.rc != 0 and ansible_system == 'Linux' and ansible_architecture == 'x86_64' | ||
|
|
||
| - name: Install mc (MinIO Client) for Linux aarch64 | ||
| shell: | | ||
| curl -O https://dl.min.io/client/mc/release/linux-arm64/mc && | ||
| chmod +x mc && | ||
| mv mc {{ ansible_env.HOME }}/bin/mc | ||
| when: mc_installed.rc != 0 and ansible_system == 'Linux' and ansible_architecture == 'aarch64' | ||
|
|
||
| - name: Install mc (MinIO Client) for macOS | ||
| shell: | | ||
| curl -O https://dl.min.io/client/mc/release/darwin-amd64/mc && | ||
| chmod +x mc && | ||
| mv mc {{ ansible_env.HOME }}/bin/mc | ||
| when: mc_installed.rc != 0 and ansible_system == 'Darwin' | ||
|
|
||
| - name: Ensure ~/bin is in PATH | ||
| lineinfile: | ||
| path: "{{ ansible_env.HOME }}/.bashrc" | ||
| line: 'export PATH="$HOME/bin:$PATH"' | ||
| state: present | ||
| when: ansible_system != 'Darwin' | ||
shivamerla marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Ensure ~/bin is in PATH (macOS) | ||
| lineinfile: | ||
| path: "{{ ansible_env.HOME }}/.zshrc" | ||
| line: 'export PATH="$HOME/bin:$PATH"' | ||
| state: present | ||
| when: ansible_system == 'Darwin' | ||
|
|
||
| - name: Wait for MinIO pods to be ready | ||
| shell: | | ||
| kubectl get pods -n {{ namespace }} \ | ||
| | grep {{ minio.helm_release_name }} \ | ||
| | grep -v console \ | ||
| | awk '{print $1}' \ | ||
| | xargs kubectl get pod -n {{ namespace }} -o json | ||
| register: minio_pods | ||
| retries: 30 | ||
| delay: 10 | ||
| until: minio_pods.stdout | from_json | json_query("items[*].status.phase") | unique == ['Running'] | ||
| failed_when: minio_pods.rc != 0 | ||
|
|
||
| - name: Get the IP of the running MinIO pod | ||
| set_fact: | ||
| minio_pod_ip: "{{ (minio_pods.stdout | from_json).status.podIP }}" | ||
|
|
||
| - name: Run validation to connect to MinIO | ||
| ignore_errors: true | ||
| shell: | | ||
| echo "Running MinIO validation script" | ||
| mc alias set myminio http://{{ minio_pod_ip }}:9000 {{ minio.username }} {{ minio.password }} --insecure | ||
| mc mb myminio/testbucket --insecure | ||
| register: minio_validation_output | ||
|
|
||
| - name: MinIO Connection status (Success) | ||
| debug: | ||
| msg: "Successfully connected and created test bucket on MinIO." | ||
| when: minio_validation_output.rc == 0 | ||
|
|
||
| - name: MinIO Connection status (Failed) | ||
| debug: | ||
| msg: "Failed to connect and create test bucket on MinIO." | ||
| when: minio_validation_output.rc != 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| - name: Check if the provided namespace exists | ||
| shell: kubectl get namespace {{ namespace }} --no-headers | ||
| register: ns_check | ||
| ignore_errors: true | ||
|
|
||
|
|
||
| - name: Create the provided namespace if not already exists | ||
| shell: > | ||
| kubectl create namespace {{ namespace }} | ||
| when: ns_check.rc != 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| - name: Check if RAG dependencies are installed | ||
| shell: helm list -n {{ namespace }} | egrep 'rag-minio|rag-milvus' | awk '{print $1}' | wc -l | tr -d '\n' | ||
| register: rag_installed | ||
| ignore_errors: true | ||
|
|
||
| - name: Uninstall Minio and Milvus helm charts | ||
| shell: helm list -n {{ namespace }} | awk '{print $1}' | grep -v NAME | egrep 'rag-minio|rag-milvus' | xargs helm del -n {{ namespace }} | ||
| ignore_errors: true | ||
|
|
||
| - name: Delete RAG PVCs | ||
| shell: kubectl get pvc -n {{ namespace }} | egrep 'rag-milvus|rag-minio' | awk '{print $1}' | xargs kubectl delete pvc -n {{ namespace }} | ||
| ignore_errors: true | ||
|
|
||
| - name: Delete Milvus SA | ||
| command: kubectl delete serviceaccount milvus -n {{ namespace }} | ||
| ignore_errors: true | ||
|
|
||
| - name: Delete Milvus role | ||
| command: kubectl delete role scc-anyuid -n {{ namespace }} | ||
| ignore_errors: true | ||
|
|
||
| - name: Delete Milvus rolebinding | ||
| command: kubectl delete rolebinding milvus-scc-anyuid-binding -n {{ namespace }} | ||
| ignore_errors: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.