feat: remove automatic Happy daemon startup
Removes unreliable automatic Happy Coder daemon startup, allowing users to start it manually when needed for better reliability and control. **Changes:** - scripts/init-repo.sh: Removed Happy daemon startup code and lock cleanup - scripts/startapp.sh: Updated comment to reflect init-repo only handles git - README.md: Updated startup flow documentation and troubleshooting section - CLAUDE.md: Updated startup flow and file descriptions **Benefits:** - No more unreliable automatic daemon startup failures - Users can start Happy daemon manually when needed: `happy daemon start` - Cleaner container startup without Happy-related delays or errors - Happy configuration and credentials still persist on PVC when used **Usage:** Users can now manually start Happy Coder when needed: ```bash happy daemon start # Start when needed happy daemon status # Check status happy daemon stop # Stop if needed ``` Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -60,7 +60,6 @@ Container start
|
|||||||
→ scripts/init-repo.sh
|
→ scripts/init-repo.sh
|
||||||
→ Configure git user & credentials
|
→ Configure git user & credentials
|
||||||
→ Clone GITHUB_REPO (if set)
|
→ Clone GITHUB_REPO (if set)
|
||||||
→ Start Happy Coder
|
|
||||||
→ Launch VSCode as user `user` in /workspace
|
→ Launch VSCode as user `user` in /workspace
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ Container start
|
|||||||
| File | Purpose |
|
| File | Purpose |
|
||||||
|------|---------|
|
|------|---------|
|
||||||
| `Dockerfile` | Image definition — installs Chrome, Node.js, VSCode, Happy Coder; creates non-root user (UID 1000) |
|
| `Dockerfile` | Image definition — installs Chrome, Node.js, VSCode, Happy Coder; creates non-root user (UID 1000) |
|
||||||
| `scripts/init-repo.sh` | Configures git credentials, clones GitHub repo, starts Happy Coder background service |
|
| `scripts/init-repo.sh` | Configures git credentials, clones GitHub repo |
|
||||||
| `scripts/startapp.sh` | Calls init-repo.sh then opens VSCode in the workspace |
|
| `scripts/startapp.sh` | Calls init-repo.sh then opens VSCode in the workspace |
|
||||||
| `chart/` | Helm chart for Kubernetes deployment |
|
| `chart/` | Helm chart for Kubernetes deployment |
|
||||||
| `chart/templates/deployment.yaml` | Deployment spec — main container + MCP sidecar containers |
|
| `chart/templates/deployment.yaml` | Deployment spec — main container + MCP sidecar containers |
|
||||||
|
|||||||
@@ -313,8 +313,6 @@ Container start
|
|||||||
→ /startapp.sh (runs as app user, UID 1000)
|
→ /startapp.sh (runs as app user, UID 1000)
|
||||||
→ init-repo.sh
|
→ init-repo.sh
|
||||||
→ clone / pull GITHUB_REPO into /workspace/{repo}
|
→ clone / pull GITHUB_REPO into /workspace/{repo}
|
||||||
→ rm daemon.state.json.lock — clear stale Happy lock
|
|
||||||
→ happy daemon start — starts Happy Coder background daemon
|
|
||||||
→ IDE=vscode: code --new-window --wait /workspace/{repo}
|
→ IDE=vscode: code --new-window --wait /workspace/{repo}
|
||||||
IDE=antigravity: antigravity --no-sandbox --user-data-dir ~/.config/antigravity ... /workspace/{repo}
|
IDE=antigravity: antigravity --no-sandbox --user-data-dir ~/.config/antigravity ... /workspace/{repo}
|
||||||
IDE=none: sleep infinity
|
IDE=none: sleep infinity
|
||||||
@@ -328,23 +326,28 @@ Container start
|
|||||||
| `/home` | ReadWriteMany PVC (`userhome-{name}`) | Survives pod restarts — stores Claude credentials, dotfiles, git config |
|
| `/home` | ReadWriteMany PVC (`userhome-{name}`) | Survives pod restarts — stores Claude credentials, dotfiles, git config |
|
||||||
| `/workspace` | `emptyDir` | Ephemeral — repo is re-cloned on each pod start |
|
| `/workspace` | `emptyDir` | Ephemeral — repo is re-cloned on each pod start |
|
||||||
|
|
||||||
Happy Coder's runtime state (`HAPPY_HOME_DIR`) is kept in `/home/user/.happy` on the persistent home PVC, so auth credentials and settings survive pod restarts. A stale lock file (`daemon.state.json.lock`) is removed automatically on each startup.
|
Happy Coder's runtime state (`HAPPY_HOME_DIR`) is kept in `/home/user/.happy` on the persistent home PVC, so auth credentials and settings survive pod restarts when manually started.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Happy Coder daemon not starting
|
### Happy Coder (manual startup)
|
||||||
|
|
||||||
|
Happy daemon is not started automatically. Launch it manually when needed:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Start Happy Coder daemon manually
|
||||||
|
happy daemon start
|
||||||
|
|
||||||
# Check daemon status
|
# Check daemon status
|
||||||
happy daemon status
|
happy daemon status
|
||||||
|
|
||||||
# Start manually (also clears any stale lock)
|
|
||||||
happy daemon start
|
|
||||||
|
|
||||||
# View daemon logs
|
# View daemon logs
|
||||||
ls ~/.happy/logs/
|
ls ~/.happy/logs/
|
||||||
|
|
||||||
|
# Stop daemon if needed
|
||||||
|
happy daemon stop
|
||||||
```
|
```
|
||||||
|
|
||||||
### Claude not authenticated
|
### Claude not authenticated
|
||||||
|
|||||||
+1
-13
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Initialize repository and start Happy Coder
|
# Initialize repository
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "=== Repository Initialization ==="
|
echo "=== Repository Initialization ==="
|
||||||
@@ -102,18 +102,6 @@ chown -R "$RUN_UID:$RUN_GID" "$WORKSPACE_DIR"
|
|||||||
mkdir -p "$HOME"
|
mkdir -p "$HOME"
|
||||||
chown "$RUN_UID:$RUN_GID" "$HOME"
|
chown "$RUN_UID:$RUN_GID" "$HOME"
|
||||||
|
|
||||||
# Start Happy Coder daemon. startapp.sh already runs as the app user (UID 1000),
|
|
||||||
# so no sudo needed — Happy/Claude Code will find credentials in the correct home dir.
|
|
||||||
echo "Starting Happy Coder..."
|
|
||||||
|
|
||||||
# Remove stale lock file. HAPPY_HOME_DIR lives on the home PVC so it survives
|
|
||||||
# pod restarts — without this cleanup the daemon refuses to start after a crash.
|
|
||||||
rm -f "${HAPPY_HOME_DIR:-$HOME/.happy}/daemon.state.json.lock"
|
|
||||||
|
|
||||||
cd "$WORKSPACE_DIR"
|
|
||||||
happy daemon start || echo "Happy Coder daemon failed to start, continuing anyway..."
|
|
||||||
|
|
||||||
echo "Happy Coder daemon started"
|
|
||||||
|
|
||||||
# Export workspace directory for startapp.sh
|
# Export workspace directory for startapp.sh
|
||||||
echo "$WORKSPACE_DIR" > /tmp/workspace-dir
|
echo "$WORKSPACE_DIR" > /tmp/workspace-dir
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ set -e
|
|||||||
|
|
||||||
echo "=== Starting Dev Container ==="
|
echo "=== Starting Dev Container ==="
|
||||||
|
|
||||||
# Initialize repository and Happy Coder
|
# Initialize repository
|
||||||
/usr/local/bin/init-repo
|
/usr/local/bin/init-repo
|
||||||
|
|
||||||
# Get workspace directory
|
# Get workspace directory
|
||||||
|
|||||||
Reference in New Issue
Block a user