Skip to content

Conversation

@radofuchs
Copy link
Contributor

@radofuchs radofuchs commented Jul 28, 2025

Description

Added github action file e2e_test yaml file
Added docker compose and dockerfile related to the e2e tests

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-306
  • Closes # LCORE-306

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • New Features

    • Introduced automated end-to-end testing with a new workflow for improved reliability.
    • Added a multi-service Docker Compose setup to simplify local development and testing.
    • Provided a new container image preconfigured with dependencies to run the llama stack service.
  • Chores

    • Enhanced continuous integration with better error handling and service health verification during tests.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

"""

Walkthrough

This change adds a new end-to-end (E2E) testing workflow using GitHub Actions that orchestrates multi-service Docker Compose containers. It introduces a Docker Compose configuration for llama-stack and lightspeed-stack services, and a containerfile for building the llama-stack service image with necessary dependencies and environment setup. No existing exported or public code entities are modified.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow
.github/workflows/e2e_tests.yaml
Adds a new GitHub Actions workflow triggered on push and pull_request_target events. It creates configuration files, runs services via Docker Compose, verifies service health with connectivity tests, and executes a Python-based E2E test suite with dependency installation and error handling.
Docker Compose Setup
docker-compose.yaml
Introduces a multi-service Docker Compose setup defining llama-stack (built from a local containerfile) and lightspeed-stack (pre-built image). Both services receive environment variables and mount configuration files. The setup includes a custom Docker network and service dependency to ensure startup order.
Containerfile for llama-stack
test.containerfile
Adds a new containerfile based on Red Hat UBI 9 that installs Python 3.12, development tools, and required Python packages inside a virtual environment. It copies the configuration file and sets the default command to run the llama-stack application using the UV tool and the provided configuration.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Docker Compose
    participant llama-stack
    participant lightspeed-stack
    participant Test Runner

    GitHub Actions->>GitHub Actions: Checkout repository code
    GitHub Actions->>GitHub Actions: Create config files (run.yaml, lightspeed-stack.yaml)
    GitHub Actions->>Docker Compose: Start llama-stack and lightspeed-stack services
    Docker Compose->>llama-stack: Build and run container
    Docker Compose->>lightspeed-stack: Pull image and run container after llama-stack
    GitHub Actions->>GitHub Actions: Wait 20 seconds for service health
    GitHub Actions->>lightspeed-stack: Perform connectivity test (curl local endpoint)
    GitHub Actions->>GitHub Actions: Install Python dependencies
    GitHub Actions->>Test Runner: Run end-to-end test suite
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐇
In containers we trust and compose,
E2E tests now swiftly arose.
With YAML and Docker, our stack comes alive,
GitHub Actions ensures that our services thrive.
The rabbit hops in, with a testing delight—
All systems are ready, the future is bright!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b24742a and c6777fd.

📒 Files selected for processing (1)
  • test.containerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test.containerfile
✨ 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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: 4

🧹 Nitpick comments (7)
test.containerfile (2)

13-15: Curl-pipe-to-sh without verification

Piping an external script directly to sh bypasses integrity checks.

At minimum fetch first and verify its checksum / GPG sig, e.g.:

curl -LsSf -o /tmp/uv-install.sh https://astral.sh/uv/install.sh \
  && echo "<expected-sha256>  /tmp/uv-install.sh" | sha256sum -c - \
  && sh /tmp/uv-install.sh

37-37: Port not exposed – minor DX issue

Add EXPOSE 8321 so local docker run -p users see which port the service expects.

+EXPOSE 8321
docker-compose.yaml (2)

1-7: Compose version header missing

While optional in Compose v2 CLI, many tools (including some IDEs & CI linters) still expect a version: "3.9" (or newer) field.
Recommend adding it for forward compatibility.


30-32: No newline at EOF

YAML-lint flags this. Add a final newline to keep linters quiet.

   driver: bridge
+
.github/workflows/e2e_tests.yaml (3)

15-21: Indentation & trailing-space lint errors

Lines 16–17 produce YAML-lint errors. Align env: two spaces under - uses: and strip trailing whitespace.

-        env: 
-            OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+        env:
+          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Apply the same fix to the second create-a-file-action block and lines 196-203.


211-218: Connectivity test may pass while services are still unhealthy

Relying on fixed sleep 20 can be flaky on slow runners. Prefer Docker health-checks in docker-compose.yaml and poll for docker compose ps --format "{{.State.Health}}".


220-227: Missing cleanup step

docker compose up -d leaves containers dangling after the job. Add docker compose down -v in finally: or a post step to free runner disk space and avoid side effects on parallel jobs.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6cc203 and 2d3a47e.

📒 Files selected for processing (3)
  • .github/workflows/e2e_tests.yaml (1 hunks)
  • docker-compose.yaml (1 hunks)
  • test.containerfile (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
docker-compose.yaml

[error] 32-32: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/e2e_tests.yaml

[error] 16-16: trailing spaces

(trailing-spaces)


[warning] 17-17: wrong indentation: expected 10 but found 12

(indentation)


[error] 57-57: trailing spaces

(trailing-spaces)


[warning] 58-58: wrong indentation: expected 10 but found 12

(indentation)


[error] 196-196: trailing spaces

(trailing-spaces)


[warning] 197-197: wrong indentation: expected 10 but found 12

(indentation)


[error] 202-202: trailing spaces

(trailing-spaces)


[error] 227-227: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
test.containerfile (1)

17-35: Huge image & long build – slim it down

Installing 30 + Python packages inside the image balloons its size (>3 GB) and slows CI.

Typical optimisations:

  • Add --no-cache-dir to uv pip install …
  • Combine with --system so the venv isn’t needed, or copy a pre-built wheelhouse.
  • Remove build deps (python*-devel, gcc, etc.) in a later layer via microdnf remove to keep runtimes lean.

[ suggest_optional_refactor ]

docker-compose.yaml (1)

10-14: Host path differs from container default

/app-root/run.yaml is mounted but the container currently looks for run.yaml in /.
After applying the WORKDIR change suggested for the Dockerfile this mismatch disappears; otherwise add the correct path in CMD.

.github/workflows/e2e_tests.yaml (1)

195-205: uv sync likely no-op / failure

uv sync expects a pyproject.toml to resolve dependencies; none exists in the repo.
If the intention is to install test deps, just pip install -r requirements-e2e.txt (or similar).

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM, nice one

@JoaoFula
Copy link
Contributor

Are the e2e tests meant to be running or will they run only once this PR is merged?

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: 3

♻️ Duplicate comments (1)
.github/workflows/e2e_tests.yaml (1)

4-11: Security trade-off for pull_request_target noted
Previous reviews already covered the risk of exposing repository secrets to untrusted PRs. Your explicit preference for unrestricted testing is acknowledged, so no further action is proposed here.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3a47e and b24742a.

📒 Files selected for processing (2)
  • .github/workflows/e2e_tests.yaml (1 hunks)
  • test.containerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test.containerfile
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: radofuchs
PR: lightspeed-core/lightspeed-stack#306
File: .github/workflows/e2e_tests.yaml:4-4
Timestamp: 2025-07-28T13:15:54.882Z
Learning: The user radofuchs prefers unrestricted pull_request_target workflows with secrets access for comprehensive PR testing, accepting the security trade-offs to ensure all problems are caught during the PR process.
.github/workflows/e2e_tests.yaml (1)

Learnt from: radofuchs
PR: #306
File: .github/workflows/e2e_tests.yaml:4-4
Timestamp: 2025-07-28T13:15:54.882Z
Learning: The user radofuchs prefers unrestricted pull_request_target workflows with secrets access for comprehensive PR testing, accepting the security trade-offs to ensure all problems are caught during the PR process.

🪛 YAMLlint (1.37.1)
.github/workflows/e2e_tests.yaml

[error] 18-18: trailing spaces

(trailing-spaces)


[warning] 19-19: wrong indentation: expected 10 but found 12

(indentation)


[error] 59-59: trailing spaces

(trailing-spaces)


[warning] 60-60: wrong indentation: expected 10 but found 12

(indentation)


[error] 198-198: trailing spaces

(trailing-spaces)


[warning] 199-199: wrong indentation: expected 10 but found 12

(indentation)


[error] 204-204: trailing spaces

(trailing-spaces)


[error] 229-229: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
.github/workflows/e2e_tests.yaml (2)

13-15: Good catch-out of PR SHA – ensures the PR code is actually tested
Specifying ref: ${{ github.event.pull_request.head.sha }} fixes the “base branch only” pitfall for pull_request_target.


225-229: Add missing newline at EOF & avoid implicit pip install uv surprise

  1. GitHub spits a warning for files without a newline.
  2. uv is a Rust binary; installing via pip sometimes pulls an outdated shim. Prefer the official install script:
-          pip install uv
+          curl -LsSf https://astral.sh/uv/install.sh | sh

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.

3 participants