Skip to content

Commit 5085967

Browse files
authored
Merge pull request NVIDIA#18 from LobsterTrap/fix/rpm-fedora43-fixes
fix(rpm): resolve Fedora 43 install and runtime failures
2 parents 8781e68 + f306b78 commit 5085967

6 files changed

Lines changed: 101 additions & 11 deletions

File tree

‎.github/workflows/midstream-container-build.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,38 @@ env:
1717
IMAGE_REGISTRY: ghcr.io/lobstertrap/openshell
1818

1919
jobs:
20+
# ---------------------------------------------------------------------------
21+
# Compute the Cargo version from git tags so container binaries report a
22+
# real version instead of the 0.0.0 placeholder in Cargo.toml.
23+
# ---------------------------------------------------------------------------
24+
compute-versions:
25+
name: Compute versions
26+
runs-on: ubuntu-latest
27+
outputs:
28+
cargo_version: ${{ steps.v.outputs.cargo }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Fetch tags
35+
run: git fetch --tags --force
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v6
39+
40+
- name: Compute cargo version
41+
id: v
42+
run: |
43+
set -euo pipefail
44+
echo "cargo=$(uv run python tasks/scripts/release.py get-version --cargo)" >> "$GITHUB_OUTPUT"
45+
2046
# ---------------------------------------------------------------------------
2147
# Build container images natively on per-arch runners
2248
# ---------------------------------------------------------------------------
2349
build:
2450
name: Build ${{ matrix.component }} (${{ matrix.arch }})
51+
needs: [compute-versions]
2552
runs-on: ${{ matrix.runner }}
2653
timeout-minutes: 60
2754
strategy:
@@ -79,6 +106,8 @@ jobs:
79106
platforms: ${{ matrix.platform }}
80107
push: true
81108
tags: ${{ env.IMAGE_REGISTRY }}/${{ matrix.component }}:${{ github.sha }}-${{ matrix.arch }}
109+
build-args: |
110+
OPENSHELL_CARGO_VERSION=${{ needs.compute-versions.outputs.cargo_version }}
82111
cache-from: type=gha,scope=${{ matrix.component }}-${{ matrix.arch }}
83112
cache-to: type=gha,mode=max,scope=${{ matrix.component }}-${{ matrix.arch }}
84113

‎README.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh |
4141
uv tool install -U openshell
4242
```
4343

44-
Both methods install the latest stable release by default. To install a specific version, set `OPENSHELL_VERSION` (binary) or pin the version with `uv tool install openshell==<version>`. A [`dev` release](https://github.com/LobsterTrap/OpenShell/releases/tag/dev) is also available that tracks the latest commit on `main`.
44+
**Fedora (43+) / RHEL / CentOS Stream (10+) via [COPR](https://copr.fedorainfracloud.org/coprs/maxamillion/openshell/):**
45+
46+
```bash
47+
sudo dnf copr enable maxamillion/openshell
48+
sudo dnf install openshell
49+
```
50+
51+
Both the binary and PyPI methods install the latest stable release by default. To install a specific version, set `OPENSHELL_VERSION` (binary) or pin the version with `uv tool install openshell==<version>`. A [`dev` release](https://github.com/LobsterTrap/OpenShell/releases/tag/dev) is also available that tracks the latest commit on `main`. The COPR repository tracks the `midstream` branch.
4552

4653
### Create a sandbox
4754

‎deploy/docker/cluster-entrypoint.sh‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ fi
8080

8181
IPTABLES=$([ "${USE_IPTABLES_LEGACY:-0}" = "1" ] && echo iptables-legacy || echo iptables)
8282

83+
# ---------------------------------------------------------------------------
84+
# Select kube-proxy mode
85+
# ---------------------------------------------------------------------------
86+
# k3s defaults kube-proxy to iptables mode, which requires the legacy
87+
# ip_tables kernel module. Modern distros (Fedora 41+, RHEL 10+) load only
88+
# nf_tables by default and may not have the legacy modules available.
89+
# k3s v1.35+ (Kubernetes 1.35) supports the native nftables proxy mode at
90+
# GA stability. Detect nftables availability and prefer it; fall back to the
91+
# default iptables mode on older kernels.
92+
KUBE_PROXY_MODE=""
93+
if command -v nft >/dev/null 2>&1 && nft list tables >/dev/null 2>&1; then
94+
echo "Detected nftables kernel support — using kube-proxy nftables mode"
95+
KUBE_PROXY_MODE="--kube-proxy-arg=proxy-mode=nftables"
96+
fi
97+
8398
RESOLV_CONF="/etc/rancher/k3s/resolv.conf"
8499

85100
has_default_route() {
@@ -636,4 +651,4 @@ wait_for_default_route
636651
# k3s v1.35.2+ no longer accepts --resolv-conf as a top-level server flag;
637652
# it must be passed via --kubelet-arg instead.
638653
# shellcheck disable=SC2086
639-
exec /bin/k3s "$@" --kubelet-arg=resolv-conf="$RESOLV_CONF" $EXTRA_KUBELET_ARGS
654+
exec /bin/k3s "$@" --kubelet-arg=resolv-conf="$RESOLV_CONF" $EXTRA_KUBELET_ARGS $KUBE_PROXY_MODE

‎docs/get-started/quickstart.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ If you prefer [uv](https://docs.astral.sh/uv/):
5353
$ uv tool install -U openshell
5454
```
5555

56+
On Fedora (43+) or CentOS Stream / RHEL (10+), install from the [COPR repository](https://copr.fedorainfracloud.org/coprs/maxamillion/openshell/):
57+
58+
```console
59+
$ sudo dnf copr enable maxamillion/openshell
60+
$ sudo dnf install openshell
61+
```
62+
63+
:::{note}
64+
The RPM ships an `/etc/modules-load.d/openshell.conf` file that loads legacy iptables kernel modules required by the gateway cluster. On a fresh install, reboot or run `sudo modprobe ip_tables iptable_nat iptable_filter iptable_mangle` before starting the gateway.
65+
:::
66+
5667
After installing the CLI, run `openshell --help` in your terminal to see the full CLI reference, including all commands and flags.
5768

5869
:::{tip}

‎docs/reference/support-matrix.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ This page lists the platform, software, runtime, and kernel requirements for run
1111

1212
OpenShell publishes multi-architecture container images for `linux/amd64` and `linux/arm64`. The CLI is supported on the following host platforms:
1313

14-
| Platform | Architecture | Status |
15-
| -------------------------------- | --------------------- | --------- |
16-
| Linux (Debian/Ubuntu) | x86_64 (amd64) | Supported |
17-
| Linux (Debian/Ubuntu) | aarch64 (arm64) | Supported |
18-
| macOS (Docker Desktop) | Apple Silicon (arm64) | Supported |
19-
| Windows (WSL 2 + Docker Desktop) | x86_64 | Experimental |
14+
| Platform | Architecture | Status |
15+
| -------------------------------- | --------------------- | ------------ |
16+
| Linux (Debian/Ubuntu) | x86_64 (amd64) | Supported |
17+
| Linux (Debian/Ubuntu) | aarch64 (arm64) | Supported |
18+
| Linux (Fedora 43+) | x86_64 (amd64) | Supported |
19+
| Linux (Fedora 43+) | aarch64 (arm64) | Supported |
20+
| Linux (RHEL/CentOS Stream 10+) | x86_64 (amd64) | Supported |
21+
| Linux (RHEL/CentOS Stream 10+) | aarch64 (arm64) | Supported |
22+
| macOS (Docker Desktop) | Apple Silicon (arm64) | Supported |
23+
| Windows (WSL 2 + Docker Desktop) | x86_64 | Experimental |
2024

2125
## Software Prerequisites
2226

‎openshell.spec‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ BuildRequires: gcc-c++
3131
BuildRequires: make
3232
BuildRequires: cmake
3333
BuildRequires: pkg-config
34+
BuildRequires: systemd-rpm-macros
3435

3536
# Python sub-package build dependencies
3637
BuildRequires: python3-devel
@@ -48,9 +49,12 @@ LLM inference routing.
4849
# --- Python SDK sub-package ---
4950
%package -n python3-%{name}
5051
Summary: OpenShell Python SDK for agent execution and management
51-
Requires: python3-cloudpickle >= 3.0
52-
Requires: python3-grpcio >= 1.60
53-
Requires: python3-protobuf >= 4.25
52+
# Use Recommends instead of Requires because Fedora 43+ ships older
53+
# versions of grpcio (1.48) and protobuf (3.19) than the SDK needs.
54+
# Users on distros with older packages can install these via pip/uv.
55+
Recommends: python3-cloudpickle >= 3.0
56+
Recommends: python3-grpcio >= 1.60
57+
Recommends: python3-protobuf >= 4.25
5458
Recommends: %{name}
5559

5660
%description -n python3-%{name}
@@ -80,12 +84,31 @@ grep -q 'version = "%{version}"' Cargo.toml || (echo "ERROR: Cargo.toml version
8084
%build
8185
# Build only the CLI binary
8286
export CARGO_BUILD_JOBS=%{_smp_build_ncpus}
87+
# Set the default container image tag to match the midstream GHCR registry.
88+
# Without this, the binary defaults to "dev" which does not exist in the
89+
# LobsterTrap registry (only "midstream" tags are published).
90+
export OPENSHELL_IMAGE_TAG=midstream
8391
cargo build --release --bin openshell
8492

8593
%install
8694
# Install CLI binary
8795
install -Dpm 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
8896

97+
# Install modules-load.d config for legacy iptables kernel modules.
98+
# k3s (used by the gateway cluster) bundles its own legacy iptables binary
99+
# for flannel CNI. Modern distros (Fedora 41+, RHEL 10+) only load nf_tables
100+
# by default, so these legacy modules must be explicitly loaded.
101+
install -d %{buildroot}%{_modulesloaddir}
102+
cat > %{buildroot}%{_modulesloaddir}/%{name}.conf << 'EOF'
103+
# Load legacy iptables kernel modules required by k3s flannel CNI.
104+
# Modern kernels use nf_tables by default; these modules provide the
105+
# legacy iptables interface that k3s's bundled iptables-legacy needs.
106+
ip_tables
107+
iptable_nat
108+
iptable_filter
109+
iptable_mangle
110+
EOF
111+
89112
# Install Python SDK modules (test files are intentionally excluded)
90113
install -d %{buildroot}%{python3_sitelib}/%{name}
91114
install -d %{buildroot}%{python3_sitelib}/%{name}/_proto
@@ -129,6 +152,7 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c "from importlib.metadata
129152
%license LICENSE
130153
%doc README.md
131154
%{_bindir}/%{name}
155+
%{_modulesloaddir}/%{name}.conf
132156

133157
%files -n python3-%{name}
134158
%license LICENSE

0 commit comments

Comments
 (0)