Skip to content
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

add rhel image #7

Merged
merged 6 commits into from
Dec 26, 2024
Merged

add rhel image #7

merged 6 commits into from
Dec 26, 2024

Conversation

dudizimber
Copy link
Contributor

@dudizimber dudizimber commented Dec 26, 2024

fix #6

Summary by CodeRabbit

  • New Features

    • Introduced support for building Docker images on Red Hat Enterprise Linux (RHEL).
    • Added essential development tools, libraries, and programming languages (Python, Rust) in the new Dockerfile for RHEL.
    • Included installation of the PEG library and Redis in the RHEL Docker image.
  • Chores

    • Updated GitHub Actions workflow to conditionally push Docker images only from the main branch and expanded OS support.

@dudizimber dudizimber linked an issue Dec 26, 2024 that may be closed by this pull request
Copy link

coderabbitai bot commented Dec 26, 2024

Warning

Rate limit exceeded

@dudizimber has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 30bbc64 and 6d8757a.

📒 Files selected for processing (1)
  • .github/workflows/build-docker-image.yml (2 hunks)

Walkthrough

The pull request introduces support for Red Hat Enterprise Linux (RHEL) in the Docker image build process. A new GitHub Actions workflow configuration and a RHEL-specific Dockerfile have been added to enable building Docker images for the RHEL platform. The workflow extends the existing build strategy to include RHEL, while the Dockerfile sets up a comprehensive development environment using Red Hat's Universal Base Image 9.

Changes

File Change Summary
.github/workflows/build-docker-image.yml Modified workflow to include a branch filter for main, expanded OS matrix to include RHEL, and updated image push conditions.
Dockerfile.rhel Created new Dockerfile for RHEL with multi-stage build, installing development tools, Python 3.9, Rust, PEG library, and Redis.

Sequence Diagram

sequenceDiagram
    participant GA as GitHub Actions
    participant Docker as Docker Hub
    participant RHEL as RHEL Build Environment
    
    GA->>RHEL: Checkout code
    GA->>RHEL: Setup Docker Buildx
    GA->>Docker: Login to Docker Hub
    RHEL->>RHEL: Install dependencies
    RHEL->>RHEL: Build image
    RHEL->>Docker: Push Docker image
Loading

Poem

🐰 In the realm of Red Hat's domain,
A new Dockerfile takes its reign,
Rust and Python, tools galore,
Building images never felt more sure!
RHEL joins our Docker dance,
With CodeRabbit's coding stance! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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

@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

🧹 Nitpick comments (2)
Dockerfile.rhel (2)

15-21: Optimize PEG library installation

The PEG library installation can be improved:

  1. No cleanup of downloaded files
  2. No verification of downloaded tarball
  3. Consider using make -j$(nproc) for faster builds
-# install leg/geg
+# Install PEG library with verification and cleanup
+ENV PEG_VERSION=0.1.19
 RUN wget https://www.piumarta.com/software/peg/peg-0.1.19.tar.gz && \
+    echo "c82c795e0b8e4d111f778f1f7d7efb76d24e8b7cd1026070e0060452e12f0c79 peg-0.1.19.tar.gz" | sha256sum -c && \
   tar -xzvf peg-0.1.19.tar.gz && \
   cd peg-0.1.19 && \
-  make && \
+  make -j$(nproc) && \
   make install && \
-  cd ..
+  cd .. && \
+  rm -rf peg-0.1.19*

1-29: Add health check and validation steps

Consider adding basic validation steps to ensure the build environment is properly set up:

Add these commands at the end of the Dockerfile:

+# Verify installations
+RUN python3 --version && \
+    rustc --version && \
+    cargo --version && \
+    leg --version && \
+    redis-server --version
+
+# Add health check
+HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
+    CMD redis-cli ping || exit 1
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0d9b2a and 204ee84.

📒 Files selected for processing (2)
  • .github/workflows/build-docker-image.yml (1 hunks)
  • Dockerfile.rhel (1 hunks)
🔇 Additional comments (1)
.github/workflows/build-docker-image.yml (1)

16-16: Verify RHEL platform compatibility and resource implications

The addition of RHEL to the build matrix looks good, but please ensure:

  1. The specified platforms (linux/amd64,linux/arm64) are fully supported for RHEL-based images
  2. The build cache strategy remains effective with the additional OS

Let's verify the platform support:

✅ Verification successful

RHEL base image and multi-platform build configuration looks compatible

The verification shows that:

  1. The workflow uses redhat/ubi9 as the base image for RHEL builds, which is Red Hat's Universal Base Image, a standard and supported base for RHEL containers
  2. The build configuration is consistent across all OS variants:
    • Uses the same buildx setup for multi-platform builds
    • Implements identical caching strategy using GitHub Actions cache
    • Installs similar build dependencies with RHEL-specific package manager commands

The addition of RHEL to the build matrix is safe and follows the same pattern as the existing Ubuntu and Debian configurations. The build dependencies and environment setup are properly adapted for RHEL's package ecosystem.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the base image supports the specified platforms
docker manifest inspect redhat/ubi9 | jq -r '.manifests[].platform'

# Check build time impact
gh run list --workflow="build-docker-image.yml" --json="durationMs,conclusion" --jq=".[0:5] | map({duration: (.durationMs/60000|round|tostring + \" minutes\"), conclusion})"

Length of output: 572


Script:

#!/bin/bash
# Let's check the workflow file to understand the base images and platforms
cat .github/workflows/build-docker-image.yml

# Let's also check if there are any related documentation or configuration files
fd -t f "Dockerfile|docker-compose" -X cat {}

Length of output: 2787

Dockerfile.rhel Show resolved Hide resolved
Dockerfile.rhel Show resolved Hide resolved
Dockerfile.rhel Show resolved Hide resolved
Copy link

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 204ee84 and 30bbc64.

📒 Files selected for processing (1)
  • .github/workflows/build-docker-image.yml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-docker-image.yml

22-22: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


25-25: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


28-28: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (3)
.github/workflows/build-docker-image.yml (3)

5-6: LGTM! Good security practice

Restricting automated pushes to only the main branch is a good security practice that prevents unauthorized image publications from feature branches.


33-33: LGTM! Well-implemented conditional publishing

The dynamic step name and conditional push configuration correctly implement the branch-based publishing strategy:

  • Step name changes to reflect whether pushing will occur
  • Push only happens on the main branch

Also applies to: 41-41


18-18: Verify RHEL Dockerfile existence

The addition of 'rhel' to the matrix requires a corresponding Dockerfile.rhel in the repository.

✅ Verification successful

RHEL Dockerfile exists with correct base image

Verification confirms that Dockerfile.rhel exists in the repository and uses the expected Red Hat Universal Base Image (UBI9) as its base image, which is the appropriate choice for RHEL builds.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify existence of Dockerfile.rhel and its base image
# Expected: Should find Dockerfile.rhel with UBI9 base image

# Check if Dockerfile.rhel exists
if [[ -f "Dockerfile.rhel" ]]; then
  echo "Found Dockerfile.rhel"
  # Verify it uses UBI9 base image
  grep -A 1 "^FROM" Dockerfile.rhel
else
  echo "Error: Dockerfile.rhel not found"
  exit 1
fi

Length of output: 144

.github/workflows/build-docker-image.yml Outdated Show resolved Hide resolved
@dudizimber dudizimber merged commit 73e1b9c into main Dec 26, 2024
4 checks passed
This was referenced Dec 29, 2024
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.

add rhel dockerfile
2 participants