Skip to content

feat(pde2e-image): add docker and podman-compose install scripts for RHEL#581

Open
amisskii wants to merge 1 commit into
podman-desktop:mainfrom
amisskii:add-cli-preinstallation-scripts
Open

feat(pde2e-image): add docker and podman-compose install scripts for RHEL#581
amisskii wants to merge 1 commit into
podman-desktop:mainfrom
amisskii:add-cli-preinstallation-scripts

Conversation

@amisskii

@amisskii amisskii commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add install_docker.sh script (RHEL-specific) to install Docker Engine from official Docker CE repo
  • Add install_podman_compose.sh script (shared unix) to install podman-compose via dnf with pip fallback
  • Update Containerfile to copy shared unix scripts into RHEL scripts directory

Issue

https://github.com/containers/podman-desktop-internal/issues/963

Usage

Invoke via --scriptPaths "install_docker.sh,install_podman_compose.sh" in the Tekton pipeline.

🤖 Generated with Claude Code

…RHEL

Add CLI preinstallation scripts for RHEL E2E testing:
- install_docker.sh (RHEL-specific): Docker Engine via official repo
- install_podman_compose.sh (shared unix): podman-compose via dnf/pip

Update Containerfile to copy shared unix scripts into the RHEL
scripts directory so execute_scripts can find them.

Signed-off-by: Anton Misskii <amisskii@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Two new Bash installer scripts are added: install_docker.sh for RHEL Docker Engine setup and install_podman_compose.sh for podman-compose with a dnf/pip3 fallback. The Containerfile is updated to copy /lib/unix/scripts/ into ${ASSETS_FOLDER}/scripts/ within the rhel build stage. The Tekton task is updated to use a hard-coded image reference instead of parameterized values.

Changes

RHEL installer scripts and image wiring

Layer / File(s) Summary
New RHEL installer scripts
pde2e-image/lib/rhel/scripts/install_docker.sh, pde2e-image/lib/unix/scripts/install_podman_compose.sh
install_docker.sh sets up Docker's dnf repo, installs Docker packages, enables the docker systemd service, and adds the current user to the docker group. install_podman_compose.sh attempts a dnf install of podman-compose, falls back to pip3 --user with a PATH update, and validates with podman-compose --version. Both scripts use set -e.
Containerfile: unix scripts copy into rhel stage
pde2e-image/Containerfile
Adds a COPY of /lib/unix/scripts/ into ${ASSETS_FOLDER}/scripts/ within the linux AS rhel build stage, making the new unix scripts available in the image.
Tekton task: hard-coded image reference
pde2e-image/tkn/task.yaml
Updates the e2e-with-podman-setup step to use quay.io/rh_ee_amisskii/pde2e-image:v0.1.1-rhel instead of constructing the image reference from parameterized image-version and os values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main changes: adding Docker and podman-compose install scripts for RHEL, which matches the primary purpose of the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing a clear summary of the scripts added, the Containerfile changes, and usage instructions tied to the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (2)
pde2e-image/lib/unix/scripts/install_podman_compose.sh (1)

4-16: 💤 Low value

Consider verifying podman prerequisite.

The script installs podman-compose but doesn't verify that podman itself is installed. While this may be a reasonable assumption for the E2E pipeline, adding a prerequisite check would make the script more robust and provide clearer error messages.

🛡️ Optional prerequisite check
 #!/bin/bash
 set -e
 
+# Verify podman is installed
+if ! command -v podman &> /dev/null; then
+    echo "Error: podman is not installed. Please install podman first."
+    exit 1
+fi
+
 echo "Installing podman-compose..."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pde2e-image/lib/unix/scripts/install_podman_compose.sh` around lines 4 - 16,
The install_podman_compose.sh script installs podman-compose without first
verifying that the podman prerequisite is installed, which could lead to
failures with unclear error messages. Add a prerequisite check near the
beginning of the script that verifies podman is installed (using a command like
`command -v podman` or `which podman`), and exit with an informative error
message if podman is not found. This check should occur before attempting to
install podman-compose to ensure dependencies are satisfied and provide users
with clear guidance if the prerequisite is missing.
pde2e-image/lib/rhel/scripts/install_docker.sh (1)

1-22: ⚡ Quick win

Consider making the script idempotent.

The script will fail if Docker is already installed due to set -e and dnf errors on reinstallation attempts. For E2E environments where scripts may run multiple times, consider adding checks:

if ! command -v docker &> /dev/null; then
    echo "Installing Docker Engine on RHEL..."
    # ... installation steps
else
    echo "Docker is already installed."
    docker --version
    exit 0
fi

Alternatively, use dnf install -y --skip-broken or dnf install -y || true if partial failures are acceptable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pde2e-image/lib/rhel/scripts/install_docker.sh` around lines 1 - 22, The
install_docker.sh script will fail if Docker is already installed due to the set
-e flag causing the script to exit on dnf errors during reinstallation attempts.
Add an idempotency check at the beginning of the script using command -v docker
to detect if Docker is already installed. If Docker exists, display the version
and exit cleanly. If Docker does not exist, proceed with the dnf and systemctl
installation steps as currently written. Alternatively, modify the dnf install
commands to use --skip-broken flag or append || true to handle partial failures
gracefully instead of causing the script to exit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pde2e-image/lib/unix/scripts/install_podman_compose.sh`:
- Around line 11-12: The PATH export on line 12 only affects the current script
session and does not persist after the script exits, making podman-compose
unavailable in the parent shell. To fix this, add logic after the pip3 install
command to permanently update the user's shell configuration files (such as
.bashrc, .bash_profile, or .zshrc) to include $HOME/.local/bin in their PATH.
Alternatively, if persistence is not feasible, document in comments or provide
clear user guidance that manual PATH configuration is required after
installation.

---

Nitpick comments:
In `@pde2e-image/lib/rhel/scripts/install_docker.sh`:
- Around line 1-22: The install_docker.sh script will fail if Docker is already
installed due to the set -e flag causing the script to exit on dnf errors during
reinstallation attempts. Add an idempotency check at the beginning of the script
using command -v docker to detect if Docker is already installed. If Docker
exists, display the version and exit cleanly. If Docker does not exist, proceed
with the dnf and systemctl installation steps as currently written.
Alternatively, modify the dnf install commands to use --skip-broken flag or
append || true to handle partial failures gracefully instead of causing the
script to exit.

In `@pde2e-image/lib/unix/scripts/install_podman_compose.sh`:
- Around line 4-16: The install_podman_compose.sh script installs podman-compose
without first verifying that the podman prerequisite is installed, which could
lead to failures with unclear error messages. Add a prerequisite check near the
beginning of the script that verifies podman is installed (using a command like
`command -v podman` or `which podman`), and exit with an informative error
message if podman is not found. This check should occur before attempting to
install podman-compose to ensure dependencies are satisfied and provide users
with clear guidance if the prerequisite is missing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f84239f-3943-4300-95c3-07336fd20031

📥 Commits

Reviewing files that changed from the base of the PR and between d52ee9f and e52cb0a.

📒 Files selected for processing (3)
  • pde2e-image/Containerfile
  • pde2e-image/lib/rhel/scripts/install_docker.sh
  • pde2e-image/lib/unix/scripts/install_podman_compose.sh

Comment on lines +11 to +12
pip3 install --user podman-compose
export PATH="$HOME/.local/bin:$PATH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

PATH export doesn't persist after script exits.

Line 12 exports PATH to include $HOME/.local/bin, but this only affects the current script session. When the script exits, the parent shell's PATH remains unchanged, making podman-compose unavailable despite successful installation via pip.

The version check at line 15 succeeds within the script's environment, masking this issue.

🔧 Proposed fix to persist PATH changes

Add persistence logic after the pip installation:

     echo "dnf installation failed, falling back to pip..."
     sudo dnf install -y python3-pip
     pip3 install --user podman-compose
-    export PATH="$HOME/.local/bin:$PATH"
+    
+    # Persist PATH for future sessions
+    if ! grep -q '$HOME/.local/bin' "$HOME/.bashrc" 2>/dev/null; then
+        echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
+        echo "Added $HOME/.local/bin to PATH in ~/.bashrc"
+    fi
+    
+    # Update PATH for current and subsequent commands in this script
+    export PATH="$HOME/.local/bin:$PATH"
 fi

Alternatively, document that users must manually add $HOME/.local/bin to their PATH after installation.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pip3 install --user podman-compose
export PATH="$HOME/.local/bin:$PATH"
echo "dnf installation failed, falling back to pip..."
sudo dnf install -y python3-pip
pip3 install --user podman-compose
# Persist PATH for future sessions
if ! grep -q '$HOME/.local/bin' "$HOME/.bashrc" 2>/dev/null; then
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
echo "Added $HOME/.local/bin to PATH in ~/.bashrc"
fi
# Update PATH for current and subsequent commands in this script
export PATH="$HOME/.local/bin:$PATH"
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pde2e-image/lib/unix/scripts/install_podman_compose.sh` around lines 11 - 12,
The PATH export on line 12 only affects the current script session and does not
persist after the script exits, making podman-compose unavailable in the parent
shell. To fix this, add logic after the pip3 install command to permanently
update the user's shell configuration files (such as .bashrc, .bash_profile, or
.zshrc) to include $HOME/.local/bin in their PATH. Alternatively, if persistence
is not feasible, document in comments or provide clear user guidance that manual
PATH configuration is required after installation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pde2e-image/tkn/task.yaml`:
- Line 162: The image field at line 162 is hard-coded to the RHEL version, but
the task defines and accepts params.os and params.image-version parameters that
are intended to support multiple operating systems (windows, darwin, rhel).
Replace the hard-coded image reference with a dynamic value that properly uses
the params.os and params.image-version values to construct the correct image URL
for the requested OS, ensuring the actual image used respects the OS/version
contract established by the task parameters and prevents non-RHEL callers from
silently receiving the wrong image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 464f99bf-c45a-48f3-a676-c3ce639b2873

📥 Commits

Reviewing files that changed from the base of the PR and between e52cb0a and 1767f88.

📒 Files selected for processing (1)
  • pde2e-image/tkn/task.yaml

Comment thread pde2e-image/tkn/task.yaml Outdated
steps:
- name: e2e-with-podman-setup
image: quay.io/odockal/pde2e-image:v$(params.image-version)-$(params.os)
image: quay.io/rh_ee_amisskii/pde2e-image:v0.1.1-rhel

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Hard-coded image breaks the task’s OS/version contract.

Line 162 pins the step to ...:v0.1.1-rhel, but this task still accepts params.os/params.image-version and contains windows/darwin/rhel execution branches. That makes non-RHEL callers silently run against the wrong image and breaks existing TaskRun expectations.

Suggested fix
-    image: quay.io/rh_ee_amisskii/pde2e-image:v0.1.1-rhel
+    image: quay.io/rh_ee_amisskii/pde2e-image:v$(params.image-version)-$(params.os)

As per coding guidelines, cross-file and configuration contract breaks should be validated against actual configuration values and caller contracts.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
image: quay.io/rh_ee_amisskii/pde2e-image:v0.1.1-rhel
image: quay.io/rh_ee_amisskii/pde2e-image:v$(params.image-version)-$(params.os)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pde2e-image/tkn/task.yaml` at line 162, The image field at line 162 is
hard-coded to the RHEL version, but the task defines and accepts params.os and
params.image-version parameters that are intended to support multiple operating
systems (windows, darwin, rhel). Replace the hard-coded image reference with a
dynamic value that properly uses the params.os and params.image-version values
to construct the correct image URL for the requested OS, ensuring the actual
image used respects the OS/version contract established by the task parameters
and prevents non-RHEL callers from silently receiving the wrong image.

@amisskii amisskii force-pushed the add-cli-preinstallation-scripts branch from 1767f88 to e52cb0a Compare June 17, 2026 10:41
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