From 2cfcf0225c9f2378d3503d8422f31f25f2984231 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Mon, 23 Feb 2026 13:51:54 -0500 Subject: [PATCH] Refactor Dockerfile and analysis script to remove Node.js dependency for Claude CLI installation Signed-off-by: Tiger Kaovilai --- build/ci-Dockerfile | 11 +++++------ docs/design/claude-prow-failure-analysis_design.md | 13 ++++++------- tests/e2e/scripts/analyze_failures.sh | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/build/ci-Dockerfile b/build/ci-Dockerfile index c82986382b7..ad9eff5ce6e 100644 --- a/build/ci-Dockerfile +++ b/build/ci-Dockerfile @@ -14,12 +14,11 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s chmod +x kubectl && \ mv kubectl /usr/local/bin/ -# Install Node.js and Claude CLI -# Using NodeSource setup script for RHEL-based images -RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \ - dnf install -y nodejs && \ - npm install -g @anthropic-ai/claude-code && \ - dnf clean all +# Install Claude CLI (native binary, no Node.js dependency) +# Installer places binary at ~/.local/bin/claude +RUN curl -fsSL https://claude.ai/install.sh | bash && \ + ln -sf ~/.local/bin/claude /usr/local/bin/claude && \ + claude --version # Clone openshift/velero source code for failure analysis # Uses oadp-dev branch to match OADP operator development diff --git a/docs/design/claude-prow-failure-analysis_design.md b/docs/design/claude-prow-failure-analysis_design.md index be0ed279aba..4c9f99c6a69 100644 --- a/docs/design/claude-prow-failure-analysis_design.md +++ b/docs/design/claude-prow-failure-analysis_design.md @@ -63,12 +63,11 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s chmod +x kubectl && \ mv kubectl /usr/local/bin/ -# Install Node.js and Claude CLI -# Using NodeSource setup script for RHEL-based images -RUN curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - && \ - dnf install -y nodejs && \ - npm install -g @anthropic-ai/claude-code && \ - dnf clean all +# Install Claude CLI (native binary, no Node.js dependency) +# Installer places binary at ~/.local/bin/claude +RUN curl -fsSL https://claude.ai/install.sh | bash && \ + ln -sf ~/.local/bin/claude /usr/local/bin/claude && \ + claude --version RUN go mod download && \ mkdir -p $(go env GOCACHE) && \ @@ -332,7 +331,7 @@ preprocess_large_artifacts() { # Check for Claude CLI availability if ! command -v claude &> /dev/null; then echo "⚠ Claude CLI not found in PATH" - echo "Skipping Claude analysis (install with: npm install -g @anthropic-ai/claude-code)" + echo "Skipping Claude analysis (install with: curl -fsSL https://claude.ai/install.sh | bash)" exit $EXIT_CODE fi diff --git a/tests/e2e/scripts/analyze_failures.sh b/tests/e2e/scripts/analyze_failures.sh index 999a1d746b5..c334450beb9 100755 --- a/tests/e2e/scripts/analyze_failures.sh +++ b/tests/e2e/scripts/analyze_failures.sh @@ -171,7 +171,7 @@ preprocess_large_artifacts() { # Check for Claude CLI availability if ! command -v claude &> /dev/null; then echo "⚠ Claude CLI not found in PATH" - echo "Skipping Claude analysis (install with: npm install -g @anthropic-ai/claude-code)" + echo "Skipping Claude analysis (install with: curl -fsSL https://claude.ai/install.sh | bash)" exit $EXIT_CODE fi