-
Notifications
You must be signed in to change notification settings - Fork 12
Update docs and scripts for installation from COPR #196
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds COPR/nightly RPM installation support: new RPM_SOURCE and COPR_REPO env vars, refactors quickrpm.sh to fetch helper scripts and branch install flows (github vs copr-nightly), and extends repo creation tooling with create_rhocp_repo and create_local_microshift_repo; updates docs to document COPR/nightly installs and networking requirements. (49 words) Changes
Sequence DiagramsequenceDiagram
participant User as User
participant Quick as quickrpm.sh
participant Downloader as download_script()
participant Repos as create_repos.sh
participant COPR as COPR
participant DNF as dnf
User->>Quick: RPM_SOURCE=copr-nightly ./quickrpm.sh
Quick->>Downloader: fetch create_repos.sh
Downloader-->>Quick: provide create_repos.sh
Quick->>Downloader: fetch postinstall.sh
Downloader-->>Quick: provide postinstall.sh
Quick->>Repos: request enable COPR / create RHOC P mirror (-rhocp-mirror)
Repos->>COPR: query nightly repo/version metadata
COPR-->>Repos: return metadata
Repos-->>Quick: repo files created
Quick->>DNF: install microshift packages from COPR
DNF-->>Quick: install results
Quick->>Quick: run postinstall.sh / start service
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
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
🤖 Fix all issues with AI agents
In `@src/quickrpm.sh`:
- Line 79: Fix the typo in the comment: replace the misspelled word "greeboot"
with "greenboot" in src/quickrpm.sh (the comment line containing "# Fedora
doesn't have old packages - downgrading greeboot is not possible."). Ensure the
corrected comment reads "# Fedora doesn't have old packages - downgrading
greenboot is not possible." so it's clear and accurate.
docs/run.md
Outdated
| ```bash | ||
| sudo dnf copr enable -y @microshift-io/microshift-nightly | ||
| XY=$(sudo dnf repoquery --repo='copr*microshift-nightly' --qf '%{VERSION}' microshift --latest-limit=1 2>/dev/null | cut -d. -f1,2) | ||
| sudo ./src/rpm/create_repos.sh -rhocp-mirror "${XY}" |
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.
Instead of exposing this logic, can we add -copr command line which does this inside the create_repos.sh script?
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
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 53-57: The README's installation snippet uses "sudo
RPM_SOURCE=copr-nightly bash" which can lose the RPM_SOURCE env var under sudo;
update the command in the README to use "sudo env RPM_SOURCE=copr-nightly bash"
so the RPM_SOURCE is preserved when invoking the quickrpm.sh script (update the
code block that currently contains "curl -s
https://microshift-io.github.io/microshift/quickrpm.sh | sudo
RPM_SOURCE=copr-nightly bash" to the env-preserving form).
In `@src/quickrpm.sh`:
- Around line 62-78: The download_script function uses an undefined variable
scriptdir when copying the local RPM script which breaks under set -u; update
the local-copy cp invocation to use the already-defined curscriptdir (i.e.,
replace "${scriptdir}/../${scriptpath}" with "${curscriptdir}/../${scriptpath}")
so the local path check and copy succeed.
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)
src/rpm/create_repos.sh (1)
74-81: Consider preserving stderr for debugging failed queries.Redirecting stderr to
/dev/nullon line 75 hides potential dnf errors that could help diagnose why version detection fails.♻️ Suggested improvement
--rhocp-mirror) - repo_version=$(dnf repoquery --qf '%{VERSION}' --latest-limit=1 microshift 2>/dev/null | cut -d. -f1,2) + repo_version=$(dnf repoquery --qf '%{VERSION}' --latest-limit=1 microshift | cut -d. -f1,2) if [ -z "${repo_version}" ] ; then echo "ERROR: Failed to find version of MicroShift available in the repositories" usage
| function create_rhocp_repo() { | ||
| local -r repo_version=$1 | ||
|
|
||
| cat > "${USHIFT_LOCAL_REPO_FILE}" <<EOF | ||
| [microshift-local] | ||
| name=MicroShift Local Repository | ||
| baseurl=${repo_path} | ||
| local -r file="${YUM_REPOS_D}/${OCP_MIRROR_REPO_FILE_PREFIX}-${repo_version}.repo" | ||
| cat > "${file}" <<EOF | ||
| [openshift-mirror-beta] | ||
| name=OpenShift Mirror Beta Repository | ||
| baseurl=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/dependencies/rpms/${repo_version}-el9-beta/ | ||
| enabled=1 | ||
| gpgcheck=0 | ||
| skip_if_unavailable=0 | ||
| EOF | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
# First, find README and documentation about OS requirements
find . -type f \( -name "README*" -o -name "*.md" \) | head -20Repository: microshift-io/microshift
Length of output: 328
🏁 Script executed:
# Search for references to OS version or RHEL/CentOS requirements
rg -i "RHEL|CentOS|Fedora|OS.version|el[0-9]" --type md --type txt | head -20Repository: microshift-io/microshift
Length of output: 1307
🏁 Script executed:
# Check for other el9-beta references
rg "el9-beta" --type shRepository: microshift-io/microshift
Length of output: 357
🏁 Script executed:
# Check the context of create_repos.sh - where is it used?
rg "create_repos\.sh|create_rhocp_repo" --type shRepository: microshift-io/microshift
Length of output: 493
🏁 Script executed:
# Look for OS version detection in build scripts
rg "uname|version_id|os.release" --type sh -A 2 | head -30Repository: microshift-io/microshift
Length of output: 1290
Hardcoded el9-beta will break on CentOS 10 and Fedora.
The baseurl hardcodes el9-beta, but README.md lists CentOS 10 and Fedora as supported platforms. CentOS 10 would require el10-beta, and other versions have different suffixes. Derive the OS suffix dynamically (similar to how quickrpm.sh detects OS versions via /etc/os-release) or constrain this script to RHEL 9/CentOS 9 only.
Note: The same issue exists in ansible/roles/microshift-okd-bootc/files/create_repos.sh.
Closes #195
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.