- Notifications
You must be signed in to change notification settings - Fork 2
chore: use pre-built Docker images from GHCR for CI #85
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
Conversation
WalkthroughCI workflow now installs system dependencies, stops building local Docker images, and pulls two pre-built images; test fixtures were updated to read container image names from environment variables with defaults. Changes
Sequence Diagram(s)sequenceDiagram autonumber actor GitHubActions as "GitHub Actions Runner" participant Shell as "Shell" participant Docker as "Docker" participant Tests as "pytest (tests/fixtures)" GitHubActions ->> Shell: checkout code GitHubActions ->> Shell: install system deps\n(apt-get update && install patchelf) Shell ->> Docker: pull ghcr.io/trufnetwork/node:latest Shell ->> Docker: pull kwildb/postgres:latest GitHubActions ->> Tests: run test suite Note right of Tests #DFF7DF: fixtures read images from\nenvironment variables with defaults Tests -->> Docker: start containers using images Tests ->> GitHubActions: report results Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Time Submission Status
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yaml(2 hunks)tests/fixtures/test_trufnetwork.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). (4)
- GitHub Check: Test Native Build on macos-latest
- GitHub Check: Test Docker Distribution (Linux)
- GitHub Check: Test Native Build on ubuntu-latest
- GitHub Check: test
🔇 Additional comments (2)
tests/fixtures/test_trufnetwork.py (1)
67-67: Good: Environment variable configuration enables runtime flexibility.The environment-variable-based image configuration correctly aligns with the CI workflow and provides runtime flexibility without code changes.
Note: Consider pinning to a specific version tag instead of
:latestfor improved reproducibility in CI environments, though this is a minor concern..github/workflows/ci.yaml (1)
22-25: LGTM!The system dependencies installation is properly implemented.
patchelfis commonly required for Python binary extensions and Go-Python bindings like gopy.
There was a problem hiding this 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 (1)
.github/workflows/ci.yaml (1)
88-93: Consider explicitly setting image environment variables for clarity.While the test fixtures default to the same image versions that the CI pulls (both use
:latest), it would be clearer and more maintainable to explicitly setPOSTGRES_IMAGEandTN_DB_IMAGEin the test step's environment. This ensures tests use the exact versions pulled by CI and makes the dependency explicit.Apply this diff:
- name: Run tests run: | source .venv/bin/activate pytest tests/test_*.py env: NODE_REPO_DIR: ${{ github.workspace }}/tmp-node + POSTGRES_IMAGE: kwildb/postgres:latest + TN_DB_IMAGE: ghcr.io/trufnetwork/node:latestBased on past review comments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yaml(2 hunks)tests/fixtures/test_trufnetwork.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: test
🔇 Additional comments (3)
tests/fixtures/test_trufnetwork.py (2)
59-59: Good improvement: Image is now configurable via environment variable.Making the Postgres image configurable via the
POSTGRES_IMAGEenvironment variable improves flexibility and testability. The default value (kwildb/postgres:latest) now matches what the CI workflow pulls, resolving the version mismatch noted in past reviews.
67-67: LGTM: Consistent configurability pattern.The same environment variable pattern applied to the TN-DB container image provides consistent configurability across test fixtures. The default value correctly points to the GHCR image as intended by the PR.
.github/workflows/ci.yaml (1)
22-25: patchelf is actively used and required — no changes needed.The concern in the review comment is incorrect. patchelf is used in the Makefile to set RPATH on the generated shared library
_trufnetwork_sdk_c_bindings.so, which is created by the gopy build process. This fixes the shared library loading on Linux by allowing the library to locate its dependencies using$ORIGIN. The installation is essential for the build pipeline on Linux systems.Likely an incorrect or invalid review comment.
compliment for our ghcr releases, so we don't broke it every single time
resolves: #86
Summary by CodeRabbit