Skip to content

Commit 5169822

Browse files
SecAI-Hubclaude
andcommitted
Fix build: guard agent/ui/diffusion-worker paths in build-services.sh
The agent, UI, and diffusion-worker pip install steps assumed /tmp/services/{agent,ui,diffusion-worker} exist in the container build context, but these paths are not mounted by BlueBuild. All other services (airlock, Go services, quarantine, search-mediator) already had if-exists guards. Add the same defensive checks so the build continues with a warning instead of failing with exit code 1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56b670b commit 5169822

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

files/scripts/build-services.sh

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,34 +226,46 @@ done
226226

227227
# --- Agent service (policy-bound local autopilot) ---
228228
echo "Building: agent"
229-
pip3 install --prefix=/usr --no-cache-dir /tmp/services/agent 2>/dev/null || \
230-
pip3 install --prefix=/usr --break-system-packages --no-cache-dir /tmp/services/agent
231-
cat > "${INSTALL_DIR}/agent" <<'WRAPPER'
229+
if [ -d "/tmp/services/agent" ]; then
230+
pip3 install --prefix=/usr --no-cache-dir /tmp/services/agent 2>/dev/null || \
231+
pip3 install --prefix=/usr --break-system-packages --no-cache-dir /tmp/services/agent
232+
cat > "${INSTALL_DIR}/agent" <<'WRAPPER'
232233
#!/usr/bin/env python3
233234
from agent.app import main
234235
main()
235236
WRAPPER
236-
chmod +x "${INSTALL_DIR}/agent"
237-
echo " -> ${INSTALL_DIR}/agent"
237+
chmod +x "${INSTALL_DIR}/agent"
238+
echo " -> ${INSTALL_DIR}/agent"
239+
else
240+
echo "WARNING: /tmp/services/agent not found — agent service will not be available"
241+
fi
238242

239243
# Web UI
240244
echo "Building: ui"
241-
pip3 install --prefix=/usr --no-cache-dir /tmp/services/ui 2>/dev/null || \
242-
pip3 install --prefix=/usr --break-system-packages --no-cache-dir /tmp/services/ui
243-
cat > "${INSTALL_DIR}/ui" <<'WRAPPER'
245+
if [ -d "/tmp/services/ui" ]; then
246+
pip3 install --prefix=/usr --no-cache-dir /tmp/services/ui 2>/dev/null || \
247+
pip3 install --prefix=/usr --break-system-packages --no-cache-dir /tmp/services/ui
248+
cat > "${INSTALL_DIR}/ui" <<'WRAPPER'
244249
#!/usr/bin/env python3
245250
from ui.app import main
246251
main()
247252
WRAPPER
248-
chmod +x "${INSTALL_DIR}/ui"
249-
echo " -> ${INSTALL_DIR}/ui"
253+
chmod +x "${INSTALL_DIR}/ui"
254+
echo " -> ${INSTALL_DIR}/ui"
255+
else
256+
echo "WARNING: /tmp/services/ui not found — UI service will not be available"
257+
fi
250258

251259
# Diffusion worker
252260
echo "Installing: diffusion-worker"
253261
DIFFUSION_DIR="/opt/secure-ai/services/diffusion-worker"
254262
mkdir -p "$DIFFUSION_DIR"
255-
cp /tmp/services/diffusion-worker/app.py "$DIFFUSION_DIR/app.py"
256-
echo " -> ${DIFFUSION_DIR}/app.py"
263+
if [ -f "/tmp/services/diffusion-worker/app.py" ]; then
264+
cp /tmp/services/diffusion-worker/app.py "$DIFFUSION_DIR/app.py"
265+
echo " -> ${DIFFUSION_DIR}/app.py"
266+
else
267+
echo "WARNING: /tmp/services/diffusion-worker/app.py not found — diffusion worker will not be available"
268+
fi
257269

258270
# --- llm-search-mediator (standalone: privacy-preserving search bridge) ---
259271
echo "Installing: llm-search-mediator"

0 commit comments

Comments
 (0)