Skip to content

Commit dc76c34

Browse files
authored
ci(docs): add llama-stack version to distro docs (#53)
# What does this PR do? Adds the current Llama Stack version being used in the container to the docs ## Test Plan Take a look! ## Summary by CodeRabbit * **Documentation** * Updated distribution README to announce upstream Llama Stack v0.2.22 with a link. * Generated distribution docs now automatically display the detected Llama Stack version for clarity and traceability. * **Chores** * Improved doc-generation to auto-inject detected version and to present clearer, user-facing error messages when version information is missing. Approved-by: derekhiggins Approved-by: skamenan7
2 parents 37b47d7 + 1498da9 commit dc76c34

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

distribution/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
This image contains the official Open Data Hub Llama Stack distribution, with all the packages and configuration needed to run a Llama Stack server in a containerized environment.
66

7+
The image is currently shipping with upstream Llama Stack version [0.2.22](https://github.com/llamastack/llama-stack/releases/tag/v0.2.22)
8+
79
You can see an overview of the APIs and Providers the image ships with in the table below.
810

911
| API | Provider |

scripts/gen_distro_docs.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
11
#!/usr/bin/env python3
22

33
import yaml
4+
import re
45
from pathlib import Path
56

67

78
REPO_ROOT = Path(__file__).parent.parent
89

910

11+
def extract_llama_stack_version():
12+
"""Extract Llama Stack version from the Containerfile."""
13+
containerfile_path = REPO_ROOT / "distribution" / "Containerfile"
14+
15+
if not containerfile_path.exists():
16+
print(f"Error: {containerfile_path} not found")
17+
exit(1)
18+
19+
try:
20+
with open(containerfile_path, "r") as file:
21+
content = file.read()
22+
23+
# Look for llama-stack version in pip install commands
24+
# Pattern matches: llama-stack==X.Y.Z
25+
pattern = r"llama-stack==([0-9]+\.[0-9]+\.[0-9]+)"
26+
match = re.search(pattern, content)
27+
28+
if match:
29+
return match.group(1)
30+
else:
31+
print("Error: Could not find llama-stack version in Containerfile")
32+
exit(1)
33+
34+
except Exception as e:
35+
print(f"Error reading Containerfile: {e}")
36+
exit(1)
37+
38+
1039
def gen_distro_table(providers_data):
1140
# Start with table header
1241
table_lines = ["| API | Provider |", "|-----|----------|"]
@@ -37,18 +66,23 @@ def gen_distro_docs():
3766
run_yaml_path = REPO_ROOT / "distribution" / "run.yaml"
3867
readme_path = REPO_ROOT / "distribution" / "README.md"
3968

40-
# Check if run.yaml exists
69+
# check if run.yaml exists
4170
if not run_yaml_path.exists():
4271
print(f"Error: {run_yaml_path} not found")
4372
return 1
4473

74+
# extract Llama Stack version from Containerfile
75+
version = extract_llama_stack_version()
76+
4577
# header section
46-
header = """<!-- This file is automatically generated by scripts/gen_distro_doc.py - do not update manually -->
78+
header = f"""<!-- This file is automatically generated by scripts/gen_distro_doc.py - do not update manually -->
4779
4880
# Open Data Hub Llama Stack Distribution Image
4981
5082
This image contains the official Open Data Hub Llama Stack distribution, with all the packages and configuration needed to run a Llama Stack server in a containerized environment.
5183
84+
The image is currently shipping with upstream Llama Stack version [{version}](https://github.com/llamastack/llama-stack/releases/tag/v{version})
85+
5286
You can see an overview of the APIs and Providers the image ships with in the table below.
5387
5488
"""

0 commit comments

Comments
 (0)