diff --git a/Dockerfile.worker b/Dockerfile.worker index 7064bc088..d8f3420ae 100644 --- a/Dockerfile.worker +++ b/Dockerfile.worker @@ -15,18 +15,28 @@ RUN apk add --no-cache \ RUN addgroup -g 1001 claude && \ adduser -u 1001 -G claude -h /home/claude -D claude -# Install bun +# Install bun globally for all users RUN curl -fsSL https://bun.sh/install | bash ENV PATH="/root/.bun/bin:${PATH}" ENV BUN_INSTALL="/root/.bun" -# Install Claude Code CLI globally +# Install Claude Code CLI globally and make it accessible to all users RUN bun install -g @anthropic-ai/claude-code@1.0.59 && \ ln -sf /root/.bun/bin/claude /usr/local/bin/claude && \ chmod +x /usr/local/bin/claude && \ + chmod +x /root/.bun/bin/claude && \ echo "Testing claude command..." && \ /usr/local/bin/claude --version +# Ensure the non-root user can also access bun and claude +# Add to both bashrc and global environment for broader compatibility +RUN echo 'export PATH="/root/.bun/bin:$PATH"' >> /home/claude/.bashrc && \ + echo 'export BUN_INSTALL="/root/.bun"' >> /home/claude/.bashrc + +# Add environment variables for non-root user access +ENV PATH="/root/.bun/bin:${PATH}" \ + BUN_INSTALL="/root/.bun" + # Copy package files COPY package.json ./ COPY tsconfig.json ./ diff --git a/packages/dispatcher/src/kubernetes/job-manager.ts b/packages/dispatcher/src/kubernetes/job-manager.ts index 51c929a07..903db3b73 100644 --- a/packages/dispatcher/src/kubernetes/job-manager.ts +++ b/packages/dispatcher/src/kubernetes/job-manager.ts @@ -468,7 +468,7 @@ export class KubernetesJobManager { }, }, ], - serviceAccountName: "claude-worker", + serviceAccountName: "peerbot", }, }, }, diff --git a/packages/worker/scripts/entrypoint.sh b/packages/worker/scripts/entrypoint.sh index 7f24f7df3..c08eeefe7 100644 --- a/packages/worker/scripts/entrypoint.sh +++ b/packages/worker/scripts/entrypoint.sh @@ -117,7 +117,7 @@ done echo "🤖 Checking Claude CLI installation..." if command -v claude >/dev/null 2>&1; then claude_version=$(timeout 10 claude --version 2>/dev/null || echo "unknown") - echo " ✅ Claude CLI: $version" + echo " ✅ Claude CLI: $claude_version" # Test Claude CLI basic functionality if timeout 10 claude --help >/dev/null 2>&1; then @@ -150,4 +150,4 @@ echo " - Recovery: ${RECOVERY_MODE:-false}" # Start the worker process echo "🚀 Executing Claude Worker..." -exec node /app/dist/index.js \ No newline at end of file +exec bun run dist/index.js \ No newline at end of file