Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Aug 26, 2025

Description

LCORE-599: bump-up Llama Stack version to 0.2.18

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #LCORE-599

Summary by CodeRabbit

  • Chores

    • Upgraded Llama Stack dependencies to 0.2.18 to ensure compatibility and receive latest fixes.
    • Expanded supported Llama Stack range to include 0.2.18.
    • Added a new post-training configuration option dpo_output_dir with default "." for the HuggingFace provider.
  • Notes

    • No other user-facing behavior or public API changes were made.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 26, 2025

Walkthrough

Dependency pins for llama-stack and llama-stack-client were bumped from 0.2.17 → 0.2.18 in pyproject.toml; MAXIMAL_SUPPORTED_LLAMA_STACK_VERSION in src/constants.py was updated to "0.2.18"; dpo_output_dir: "." was added under the post_training HuggingFace provider in run.yaml and .github/workflows/e2e_tests.yaml. A trailing newline was added to the e2e workflow. No API changes.

Changes

Cohort / File(s) Summary of Changes
Dependency version bumps
pyproject.toml
Updated dependency versions: llama-stack 0.2.17 → 0.2.18, llama-stack-client 0.2.17 → 0.2.18.
Version bounds constants
src/constants.py
Updated MAXIMAL_SUPPORTED_LLAMA_STACK_VERSION from "0.2.17" to "0.2.18".
Config additions
run.yaml, .github/workflows/e2e_tests.yaml
Added dpo_output_dir: "." under the post_training HuggingFace provider config. Added a trailing newline to .github/workflows/e2e_tests.yaml.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • umago

Poem

A rabbit hops through version trees,
I nudge a bump with gentle ease.
Eighteen now sits upon the shelf,
Config set tidy—done myself.
Hooray for builds that run with grace! 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3e44dde and bbc3f1c.

📒 Files selected for processing (1)
  • .github/workflows/e2e_tests.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e_tests.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-pr
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pyproject.toml (1)

28-29: Version pinning matches constants; lockfile and compatibility checks still needed

  • ✅ The llama-stack and llama-stack-client pins in pyproject.toml (0.2.18) match the MAXIMAL_SUPPORTED_LLAMA_STACK_VERSION in src/constants.py (0.2.18), and the MINIMAL_SUPPORTED_LLAMA_STACK_VERSION remains 0.2.17 ≤ 0.2.18 as expected.
  • 🔄 Please regenerate/update any lockfiles (e.g., pdm.lock) and rebuild container images so CI and production environments pick up version 0.2.18 deterministically.
  • 🔍 Sanity-check cross-version compatibility: ensure a 0.2.18 client still works with a 0.2.17 server. If you intend to drop support for 0.2.17, bump the minimal version in src/constants.py and update the release notes accordingly:
--- a/src/constants.py
+++ b/src/constants.py
@@
-MINIMAL_SUPPORTED_LLAMA_STACK_VERSION = "0.2.17"
+MINIMAL_SUPPORTED_LLAMA_STACK_VERSION = "0.2.18"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 969904b and d0840d6.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • pyproject.toml (1 hunks)
  • src/constants.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-pr
🔇 Additional comments (1)
src/constants.py (1)

5-5: LGTM: MAXIMAL_SUPPORTED_LLAMA_STACK_VERSION aligned to 0.2.18.

This matches the pins in pyproject.toml and keeps the declared support ceiling consistent.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
run.yaml (1)

68-74: Avoid writing DPO artifacts to "."; choose a persistent, ignored path or env override

Using dpo_output_dir: "." will dump potentially large/ephemeral training outputs into the repo root, which can:

  • pollute the working tree and risk accidental commits,
  • fail in containerized/readonly workspaces,
  • be wiped between runs if not volume-mounted.

Recommend a persistent path under .llama to match the rest of the config, or allow an env override with a sane default.

Apply one of these:

-      dpo_output_dir: "."
+      # Prefer a persistent, repo-ignored location
+      dpo_output_dir: .llama/distributions/ollama/post_training/dpo_out

or env-driven with fallback:

-      dpo_output_dir: "."
+      dpo_output_dir: ${env.DPO_OUTPUT_DIR:-.llama/distributions/ollama/post_training/dpo_out}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d0840d6 and f512267.

📒 Files selected for processing (1)
  • run.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-pr
🔇 Additional comments (2)
run.yaml (2)

68-74: Ensure directory creation and permissions

If the provider does not auto-create dpo_output_dir, first runs will fail. Also, non-root containers may lack write permission to the chosen path.

Confirm the provider behavior in 0.2.18:

  • Creates the directory if missing,
  • Emits a clear error if unwritable.

If not auto-created, ensure the orchestration step creates the directory with correct ownership prior to starting the service.


68-74: I couldn’t find any schema definition for the new dpo_output_dir key in our Pydantic models or JSON schemas. Since the codebase uses src/models/config.py (with Configuration as the root Pydantic model) to validate run.yaml, adding an unexpected field will indeed raise a validation error on version 0.2.17.

• In src/constants.py, MINIMAL_SUPPORTED_LLAMA_STACK_VERSION is set to "0.2.17".
• There is no reference to dpo_output_dir in any Pydantic model under src/models/config.py.

Please manually verify:

  • Whether version 0.2.17’s schema will reject unknown fields (it does by default in Pydantic unless extra = "ignore" is set).
  • If so, either bump MINIMAL_SUPPORTED_LLAMA_STACK_VERSION to "0.2.18" in src/constants.py and update the version-bound unit tests, or guard the dpo_output_dir field in run.yaml behind a version check in your deployment tooling.

@tisnik tisnik force-pushed the lcore-599-bump-llama-stack-version-to-0.2.18 branch from f512267 to 3e44dde Compare August 26, 2025 13:26
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
.github/workflows/e2e_tests.yaml (3)

4-11: Avoid pull_request_target + job-wide secrets: high risk of secret exposure to untrusted PRs

This workflow runs on pull_request_target and exposes OPENAI_API_KEY at the job scope. Combined with checking out the PR head, this lets untrusted code influence steps that have access to secrets. Mitigations like persist-credentials:false don’t prevent runtime exfiltration via docker, curl, or logs.

Recommended hardening:

  • Use pull_request instead of pull_request_target for forked PRs, or gate secret-using steps to same-repo PRs only.
  • Move OPENAI_API_KEY out of job env; pass it only to trusted, gated steps.
  • Add least-privilege permissions.

Example patch:

- on: [push, pull_request_target]
+ on: [push, pull_request]

+permissions:
+  contents: read

 jobs:
   e2e_tests:
     runs-on: ubuntu-latest
-    env:
-      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+    # Do not set secrets at job scope. Gate usage at step level:
+    # Use: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)

228-233: Remove secret-dumping risk: don’t cat run.yaml to logs

Since run.yaml currently embeds the API key, cat run.yaml risks leaking it into logs. Even with masking, avoid printing files that may contain secrets.

-      - name: list files
-        run: |
-          ls
-          cat lightspeed-stack.yaml
-          cat run.yaml
+      - name: list files
+        run: |
+          ls
+          # Avoid printing config files that may contain secrets
+          sed -n '1,120p' lightspeed-stack.yaml | sed -e 's/api_key:.*/api_key: [redacted]/'

163-167: Prevent Secret Leakage in run.yaml Creation and Logging

The workflow currently interpolates ${{ env.OPENAI_API_KEY }} directly into run.yaml and then prints that file, risking secret exposure.

• Location 1: .github/workflows/e2e_tests.yaml
– Step “create run.yaml” (around lines 46–90) writes:
yaml providers: inference: - provider_id: openai provider_type: remote::openai config: api_key: ${{ env.OPENAI_API_KEY }}
• Location 2: Same file, “list files” step (around lines 200–210) runs cat run.yaml, logging its contents.

Critical fixes required:

  • Remove inline secret from run.yaml content.
  • Inject the secret via environment only at runtime.
  • Eliminate any cat run.yaml calls.

Minimal diff suggestions:

      - uses: 1arp/create-a-file-action@0.4.5
        with:
          file: 'run.yaml'
          content: |
            version: '2'
            …
            providers:
              inference:
-               - provider_id: openai
-                 provider_type: remote::openai
-                 config:
-                   api_key: ${{ env.OPENAI_API_KEY }}
+               - provider_id: openai
+                 provider_type: remote::openai
+                 # api_key is injected at runtime; do not write secrets here.

      - name: list files
-       run: |
-         ls
-         cat lightspeed-stack.yaml
-         cat run.yaml
+       run: |
+         ls
+         cat lightspeed-stack.yaml
+         # Do not cat run.yaml to avoid logging secrets

      - name: Run service manually
-       env:
-         OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+       if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
+       env:
+         OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
🧹 Nitpick comments (4)
.github/workflows/e2e_tests.yaml (4)

172-175: dpo_output_dir: "." may point to a non-writable/ephemeral location inside the container

Using "." relies on the container’s working directory and may collide with bind mounts or lack write perms. Align with your other stores under /app-root/.llama to be explicit and consistent.

-                  dpo_output_dir: "."
+                  dpo_output_dir: "/app-root/.llama/post_training"

Action items:

  • Ensure this path exists and is writable in the container image.
  • If artifacts are needed post-job, mount it as a volume to the runner workspace or $RUNNER_TEMP.

245-249: Replace fixed sleep with a health/ready wait

Static sleep 20 is brittle. Prefer a bounded wait loop on container health or readiness to reduce flakes and speed up happy paths.

Example:

-      - name: Wait for services
-        run: |
-          echo "Waiting for services to be healthy..."
-          sleep 20  # adjust depending on boot time
+      - name: Wait for services
+        run: |
+          echo "Waiting for services to be healthy..."
+          for i in {1..30}; do
+            if curl -sf http://localhost:8080/v1/models >/dev/null; then
+              echo "Service is up"; exit 0
+            fi
+            sleep 2
+          done
+          echo "Service did not become ready in time"; exit 1

13-21: Pin third-party actions by commit SHA to prevent supply-chain attacks

actions/checkout@v4 and 1arp/create-a-file-action@0.4.5 are version tags. Pin to a specific commit SHA (with a comment referencing the tag) to avoid unexpected updates.

Example:

-      - uses: actions/checkout@v4
+      - uses: actions/checkout@3df4ab11feb006e8e1fc4b474e110515c8d3f0af # v4.1.7

-      - uses: 1arp/create-a-file-action@0.4.5
+      - uses: 1arp/create-a-file-action@<commit-sha> # 0.4.5

Also applies to: 60-67, 94-101


26-46: Debug-only steps should be gated or removed for this dependency bump

The verbose “Debug checkout …” and “Verify actual git checkout result” steps add noise/time. Gate them behind an input or env flag, or remove for mainline CI.

-      - name: Debug checkout for umago/lightspeed-stack setup-metrics branch
+      - name: Debug checkout (optional)
+        if: ${{ env.CI_DEBUG == '1' }}
...
-      - name: Verify actual git checkout result
+      - name: Verify actual git checkout result (optional)
+        if: ${{ env.CI_DEBUG == '1' }}

Also applies to: 47-59

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f512267 and 3e44dde.

📒 Files selected for processing (2)
  • .github/workflows/e2e_tests.yaml (2 hunks)
  • run.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • run.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-pr
🔇 Additional comments (1)
.github/workflows/e2e_tests.yaml (1)

260-266: LGTM on trailing newline fix

The step remains the same; adding a trailing newline is fine.

@tisnik tisnik merged commit 913b5a6 into lightspeed-core:main Aug 26, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant