Skip to content

Commit fc238e8

Browse files
tosin2013claude
andcommitted
refactor(paths): Use /opt/qubinode_navigator as canonical installation path
Replace all hardcoded /root/qubinode_navigator paths with dynamic QUBINODE_HOME environment variable support. This enables: - Non-root user deployments (e.g., /home/lab-user/qubinode_navigator) - Custom installation paths (e.g., /opt/qubinode_navigator) - Automatic migration from $HOME/qubinode_navigator to /opt Key changes: - Add QUBINODE_HOME setup with migration logic to deploy-qubinode.sh - Update all shell scripts with QUBINODE_HOME detection and fallbacks - Update Python plugins to use os.environ.get('QUBINODE_HOME', '/opt/...') - Update config files to use /opt/qubinode_navigator default - Update docker-compose.yml to use ${QUBINODE_HOME:-/opt/...} for mounts - Update all documentation to reference /opt/qubinode_navigator Migration behavior: 1. If QUBINODE_HOME env var is set, use that path 2. If /opt/qubinode_navigator doesn't exist but $HOME/qubinode_navigator does, automatically migrate (copy) to /opt 3. Fallback to script directory if running from git checkout Fixes #190 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 66cad3f commit fc238e8

File tree

84 files changed

+440
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+440
-271
lines changed

.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ QUBINODE_ADMIN_USER=admin
2323
# Used to identify your Qubinode cluster
2424
QUBINODE_CLUSTER_NAME=qubinode
2525

26+
# =============================================================================
27+
# INSTALLATION PATH
28+
# =============================================================================
29+
30+
# Qubinode Navigator installation directory
31+
# Default: /opt/qubinode_navigator
32+
#
33+
# If not set, scripts will:
34+
# 1. Use /opt/qubinode_navigator as the canonical location
35+
# 2. Auto-migrate from $HOME/qubinode_navigator if /opt doesn't exist
36+
#
37+
# Override only if you need a custom installation path
38+
# QUBINODE_HOME=/opt/qubinode_navigator
39+
2640
# =============================================================================
2741
# DEPLOYMENT CONFIGURATION
2842
# =============================================================================

AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ When starting a session, **automatically detect** the current environment by che
3030

3131
```bash
3232
# 1. Check if running on a Qubinode host
33-
if [ -f "/root/qubinode_navigator/.env" ]; then
33+
if [ -f "/opt/qubinode_navigator/.env" ]; then
3434
echo "Running on Qubinode host"
35-
source /root/qubinode_navigator/.env
35+
source /opt/qubinode_navigator/.env
3636
fi
3737

3838
# 2. Detect OS
@@ -49,7 +49,7 @@ curl -s localhost:8889/health # MCP Server running
4949

5050
| Environment | Indicators | Key Paths |
5151
| -------------------- | -------------------------------- | ------------------------------------- |
52-
| **Development Host** | Has `.env`, libvirtd running | `/root/qubinode_navigator/` |
52+
| **Development Host** | Has `.env`, libvirtd running | `/opt/qubinode_navigator/` |
5353
| **Remote/SSH** | No local `.env`, SSH connection | Clone repo first |
5454
| **Container** | Running inside Airflow container | `/opt/airflow/`, SSH to host for kcli |
5555
| **CI/CD** | GitHub Actions context vars | Use test fixtures |
@@ -542,7 +542,7 @@ ______________________________________________________________________
542542

543543
```bash
544544
# All services status
545-
cd /root/qubinode_navigator/airflow
545+
cd /opt/qubinode_navigator/airflow
546546
podman-compose ps
547547

548548
# Logs
@@ -837,7 +837,7 @@ export QUBINODE_HOME=/path/to/qubinode_navigator
837837

838838
This allows the same configurations to work whether:
839839

840-
- Running as root (`/root/qubinode_navigator`)
840+
- Running as root (`/opt/qubinode_navigator`)
841841
- Running as regular user (`$HOME/qubinode_navigator`)
842842
- Custom installation path (set `QUBINODE_HOME`)
843843

MCP-QUICK-START.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ ______________________________________________________________________
115115
podman ps --filter "name=airflow"
116116

117117
# View MCP config
118-
cat /root/qubinode_navigator/airflow/.env | grep MCP
118+
cat /opt/qubinode_navigator/airflow/.env | grep MCP
119119

120120
# Restart if needed
121-
cd /root/qubinode_navigator/airflow && podman-compose restart
121+
cd /opt/qubinode_navigator/airflow && podman-compose restart
122122

123123
# View logs
124124
podman logs -f airflow_airflow-webserver_1 | grep MCP

MCP-SERVER-GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Qubinode Navigator provides two Model Context Protocol (MCP) servers that enable
2323

2424
```bash
2525
# Start Airflow with MCP enabled
26-
cd /root/qubinode_navigator/airflow
26+
cd /opt/qubinode_navigator/airflow
2727
podman-compose --profile mcp up -d
2828

2929
# Verify servers are running
@@ -185,14 +185,14 @@ Configure keys in the respective `.env` files or environment variables.
185185
### Test Airflow MCP
186186

187187
```bash
188-
cd /root/qubinode_navigator
188+
cd /opt/qubinode_navigator
189189
ansible-playbook tests/mcp/test_airflow_mcp.yml
190190
```
191191

192192
### Test AI Assistant MCP
193193

194194
```bash
195-
cd /root/qubinode_navigator/ai-assistant
195+
cd /opt/qubinode_navigator/ai-assistant
196196
./test-fastmcp-poc.sh
197197
```
198198

@@ -218,7 +218,7 @@ netstat -tuln | grep 8889
218218
podman logs airflow-mcp-server
219219

220220
# Restart server
221-
cd /root/qubinode_navigator/airflow
221+
cd /opt/qubinode_navigator/airflow
222222
podman-compose restart airflow-mcp-server
223223
```
224224

ai-assistant/LLAMA_CPP_FIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The running container was built from an older version of the code that expected
4343
### Option 1: Rebuild Container (Recommended)
4444

4545
```bash
46-
cd /root/qubinode_navigator/ai-assistant
46+
cd /opt/qubinode_navigator/ai-assistant
4747
./rebuild-container.sh
4848
```
4949

ai-assistant/scripts/download-model.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -euo pipefail
66

77
# Configuration
88
MODEL_URL="https://huggingface.co/ibm-granite/granite-4.0-micro-GGUF/resolve/main/granite-4.0-micro-Q4_K_M.gguf"
9-
MODEL_DIR="/root/qubinode_navigator/ai-assistant/models"
9+
MODEL_DIR="/opt/qubinode_navigator/ai-assistant/models"
1010
MODEL_FILE="granite-4.0-micro.gguf"
1111
MODEL_PATH="${MODEL_DIR}/${MODEL_FILE}"
1212

ai-assistant/scripts/fetch-kcli-docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class KcliDocsFetcher:
1717
"""Fetches and prepares kcli documentation for RAG ingestion"""
1818

19-
def __init__(self, output_dir: str = "/root/qubinode_navigator/ai-assistant/data/kcli-docs"):
19+
def __init__(self, output_dir: str = "/opt/qubinode_navigator/ai-assistant/data/kcli-docs"):
2020
self.output_dir = Path(output_dir)
2121
self.output_dir.mkdir(parents=True, exist_ok=True)
2222

ai-assistant/scripts/prepare-rag-docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def get_default_input_dir() -> str:
357357

358358
# Check common locations
359359
common_paths = [
360-
"/root/qubinode_navigator",
360+
"/opt/qubinode_navigator",
361361
"/opt/qubinode_navigator",
362362
Path.home() / "qubinode_navigator",
363363
]

ai-assistant/src/agents/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self):
6868
self.rag_service = None
6969
self.lineage_service = None
7070
self.adrs_loaded = False
71-
self.project_root = Path(os.getenv("QUBINODE_ROOT", "/root/qubinode_navigator"))
71+
self.project_root = Path(os.getenv("QUBINODE_ROOT", "/opt/qubinode_navigator"))
7272
self.data_dir = Path(os.getenv("RAG_DATA_DIR", "/app/data"))
7373

7474
async def initialize(

ai-assistant/src/agents/developer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DeveloperDependencies(AgentDependencies):
5050
aider_model: str = "claude-sonnet-4-20250514" # Model for Aider via LiteLLM
5151

5252
# Working directory for code changes
53-
working_directory: str = "/root/qubinode_navigator"
53+
working_directory: str = "/opt/qubinode_navigator"
5454

5555
# Provider cache for Provider-First Rule checks
5656
provider_cache: dict = {}

0 commit comments

Comments
 (0)