-
Notifications
You must be signed in to change notification settings - Fork 26
LCORE-3051: In the rag-content images, only install what is needed #246
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
Merged
Merged
Changes from all commits
Commits
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
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
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,36 @@ | ||
| = Getting Started with Lightspeed | ||
|
|
||
| == Prerequisites | ||
|
|
||
| Before installing, ensure you have cluster administrator access | ||
| to your OpenShift environment. | ||
|
|
||
| The following tools must be available: | ||
|
|
||
| * `oc` command-line client | ||
| * `podman` for building container images | ||
| * Access to a container registry | ||
|
|
||
| == Installation | ||
|
|
||
| Enable the feature by running the following command: | ||
|
|
||
| [source,shell] | ||
| ---- | ||
| oc apply -f config.yaml | ||
| ---- | ||
|
|
||
| Verify the installation succeeded: | ||
|
|
||
| . Check that the pod is running. | ||
| . Confirm the service endpoint responds. | ||
| . Review the logs for errors. | ||
|
|
||
| NOTE: The command requires admin privileges. | ||
|
|
||
| == Configuration | ||
|
|
||
| The main configuration file is `config.yaml`. | ||
|
|
||
| proxy_url:: The URL of the upstream proxy. | ||
| timeout:: Connection timeout in seconds. |
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,41 @@ | ||
| # Getting Started with Lightspeed | ||
|
|
||
| # Prerequisites | ||
|
|
||
| Before installing, ensure you have cluster administrator access | ||
| to your OpenShift environment. | ||
|
|
||
| The following tools must be available: | ||
|
|
||
| * oc command-line client | ||
| * podman for building container images | ||
| * Access to a container registry | ||
|
|
||
| # Installation | ||
|
|
||
| Enable the feature by running the following command: | ||
|
|
||
|
|
||
| ```shell | ||
| oc apply -f config.yaml | ||
| ``` | ||
|
|
||
|
|
||
| Verify the installation succeeded: | ||
|
|
||
| 1. Check that the pod is running. | ||
| 2. Confirm the service endpoint responds. | ||
| 3. Review the logs for errors. | ||
|
|
||
|
|
||
| [NOTE] | ||
| ---- | ||
| The command requires admin privileges. | ||
| ---- | ||
|
syedriko marked this conversation as resolved.
|
||
|
|
||
| # Configuration | ||
|
|
||
| The main configuration file is config.yaml. | ||
|
|
||
| proxy_url:: The URL of the upstream proxy. | ||
| timeout:: Connection timeout in seconds. | ||
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,86 @@ | ||
| # Copyright 2025 Red Hat, Inc. | ||
| # All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| # not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
| """End-to-end integration test: AsciiDoc conversion preserves content. | ||
|
|
||
| Drives the real AsciidoctorConverter (requires ``asciidoctor`` to be installed) | ||
| and verifies that the converted output matches the hand-written Markdown | ||
| reference. This validates the .adoc -> .md -> generate_embeddings.py path | ||
| that users follow inside the tool container. | ||
| """ | ||
|
|
||
| import shutil | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
| from lightspeed_rag_content.asciidoc import AsciidoctorConverter | ||
|
|
||
| FIXTURE_DIR = Path(__file__).parent | ||
| FIXTURE_ADOC = FIXTURE_DIR / "fixture.adoc" | ||
| FIXTURE_MD = FIXTURE_DIR / "fixture.md" | ||
|
|
||
| requires_asciidoctor = pytest.mark.skipif( | ||
| not shutil.which("ruby") or not shutil.which("asciidoctor"), | ||
| reason="ruby and/or asciidoctor not installed (run 'bundle install' first)", | ||
| ) | ||
|
|
||
| CONTENT_MARKERS = [ | ||
| "Getting Started with Lightspeed", | ||
| "Prerequisites", | ||
| "cluster administrator access", | ||
| "OpenShift environment", | ||
| "oc", | ||
| "podman", | ||
| "container registry", | ||
| "Installation", | ||
| "oc apply -f config.yaml", | ||
| "pod is running", | ||
| "service endpoint responds", | ||
| "Review the logs for errors", | ||
| "admin privileges", | ||
| "Configuration", | ||
| "config.yaml", | ||
| "proxy_url", | ||
| "upstream proxy", | ||
| "timeout", | ||
| "Connection timeout in seconds", | ||
| ] | ||
|
|
||
|
|
||
| @requires_asciidoctor | ||
| class TestAsciidocIntegration: | ||
| def test_converted_output_matches_reference(self, tmp_path): | ||
| """The .adoc -> text conversion produces the same content as the .md reference.""" | ||
| output_file = tmp_path / "converted.md" | ||
|
|
||
| converter = AsciidoctorConverter() | ||
| converter.convert(FIXTURE_ADOC, output_file) | ||
|
|
||
| converted = output_file.read_text(encoding="utf-8") | ||
| reference = FIXTURE_MD.read_text(encoding="utf-8") | ||
|
|
||
| assert converted.strip() == reference.strip() | ||
|
|
||
| def test_converted_output_preserves_all_content(self, tmp_path): | ||
| """Every key phrase from the source .adoc survives the conversion.""" | ||
| output_file = tmp_path / "converted.md" | ||
|
|
||
| converter = AsciidoctorConverter() | ||
| converter.convert(FIXTURE_ADOC, output_file) | ||
|
|
||
| converted = output_file.read_text(encoding="utf-8") | ||
|
|
||
| for marker in CONTENT_MARKERS: | ||
| assert marker in converted, f"expected {marker!r} in converted text" |
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.