Skip to content

test: Gather and upload CI logs#30

Merged
leseb merged 1 commit intoopendatahub-io:mainfrom
derekhiggins:gather-ci-logs
Sep 15, 2025
Merged

test: Gather and upload CI logs#30
leseb merged 1 commit intoopendatahub-io:mainfrom
derekhiggins:gather-ci-logs

Conversation

@derekhiggins
Copy link
Copy Markdown
Collaborator

@derekhiggins derekhiggins commented Sep 15, 2025

Summary by CodeRabbit

  • Chores
    • Continuous Integration now captures and uploads build/test logs and system information as downloadable artifacts after each run.
    • Artifacts include service logs and integration test outputs, aiding post-run analysis and issue triage.
    • Logs are retained for 7 days and are available even when jobs fail, ensuring consistent access to diagnostic information.

Signed-off-by: Derek Higgins <derekh@redhat.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

Adds two always-run steps to the build-test-push job in the GitHub Actions workflow: one to gather container logs, system info, and integration-test artifacts into a logs/ directory; another to upload that directory as an artifact named ci-logs-${{ github.sha }} with 7-day retention.

Changes

Cohort / File(s) Summary of Changes
CI workflow: log collection and artifact upload
\.github/workflows/redhat-distro-container.yml
Inserted two steps after tests: (1) Gather logs and debugging information (creates logs/, captures docker logs for llama-stack and vllm, system info, copies /tmp/llama-stack-integration-tests); (2) Upload logs as artifacts via actions/upload-artifact with name ci-logs-${{ github.sha }} and 7-day retention. Both use always().

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GH as GitHub Actions
    participant Job as build-test-push job
    participant C as Containers (llama-stack, vllm)
    participant FS as Filesystem (/tmp, logs/)
    participant Art as upload-artifact

    GH->>Job: Run integration tests (existing)
    Note over Job: Post-tests phase

    Job->>Job: Gather logs and debugging information (always)
    rect rgba(230,245,255,0.6)
      Job->>FS: mkdir -p logs/
      Job->>C: docker logs llama-stack > logs/llama-stack.log (fallback message on failure)
      Job->>C: docker logs vllm > logs/vllm.log (fallback message on failure)
      Job->>FS: Collect system info -> logs/system-info.log
      Job->>FS: Copy /tmp/llama-stack-integration-tests -> logs/ (if exists)
    end

    Job->>Art: Upload logs/ as ci-logs-${{ github.sha }} (always, retention: 7 days)
    Note over GH,Art: Artifact available for later inspection
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws on CI trails,
Gathering logs like carrot bales—
VLLM whispers, llama hums,
System stats in tidy sums.
Packed and shipped, a crisp archive—
Seven days to keep the hive.
Hop, inspect, our builds survive! 🐇📦

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "test: Gather and upload CI logs" succinctly and accurately summarizes the primary change by describing the addition of workflow steps to gather and upload CI logs. It is concise, a single sentence, and directly reflects the modifications to .github/workflows/redhat-distro-container.yml described in the PR. The "test:" prefix appropriately signals CI/test-related work and does not introduce ambiguity.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (3)
.github/workflows/redhat-distro-container.yml (3)

88-99: Header isn’t captured in system-info log.

Move the header inside the redirection block; optionally include docker info for context.

-          # Gather system information
-          echo "=== System information ==="
-          {
+          # Gather system information
+          {
+            echo "=== System information ==="
             echo "Disk usage:"
             df -h
             echo "Memory usage:"
             free -h
+            echo "Docker info:"
+            docker info
             echo "Docker images:"
             docker images
             echo "Docker containers:"
             docker ps -a
           } > logs/system-info.log 2>&1

101-106: Avoid filename collisions; preserve structure and compress artifacts.

Copying basenames can overwrite files. Archive the directory instead.

-          echo "=== Integration test artifacts ==="
-          if [ -d "/tmp/llama-stack-integration-tests" ]; then
-            find /tmp/llama-stack-integration-tests -name "*.log" -o -name "pytest.log" -o -name "*.out" 2>/dev/null | while read -r file; do
-              cp "$file" "logs/$(basename "$file")" || true
-            done
-          fi
+          echo "=== Integration test artifacts ==="
+          if [ -d "/tmp/llama-stack-integration-tests" ]; then
+            tar -C /tmp -czf logs/integration-tests.tgz llama-stack-integration-tests || true
+          fi

108-115: Optional: don’t fail if logs are empty.

Guard against edge cases where no files exist.

       - name: Upload logs as artifacts
         if: always()
         uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.7.0
         with:
           name: ci-logs-${{ github.sha }}
           path: logs/
+          if-no-files-found: warn
           retention-days: 7
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b0f8bc and 8146c19.

📒 Files selected for processing (1)
  • .github/workflows/redhat-distro-container.yml (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-test-push (linux/amd64)

Copy link
Copy Markdown
Collaborator

@nathan-weinberg nathan-weinberg left a comment

Choose a reason for hiding this comment

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

Great addition - manually checked the logs from this PR run and everything LGTM

@leseb leseb merged commit 08dd25c into opendatahub-io:main Sep 15, 2025
5 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.

3 participants