diff --git a/VERSION b/VERSION index d169b2f..c5d54ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.8 +0.0.9 diff --git a/docs/repo/systemd-units.md b/docs/repo/systemd-units.md index 3b5485f..0f6018e 100644 --- a/docs/repo/systemd-units.md +++ b/docs/repo/systemd-units.md @@ -62,6 +62,40 @@ systemctl --user start smart-ide-global-api smart-ide-sso-gateway systemctl --user status smart-ide-global-api smart-ide-sso-gateway ``` +## ia-dev-gateway, smart-ide-tools-bridge, smart-ide-orchestrator (utilisateur) + +Unités **user** pour : + +- `ia-dev-gateway` (catalogue agents, runs, SSE) +- `smart-ide-tools-bridge` (registry + jobs Carbonyl/PageIndex/Chandra) +- `smart-ide-orchestrator` (routage d’intentions) + +Gabarits : + +- `systemd/user/ia-dev-gateway.service.in` +- `systemd/user/smart-ide-tools-bridge.service.in` +- `systemd/user/smart-ide-orchestrator.service.in` + +Variables : `config/services.local.env` (copie de `config/services.local.env.example`, gitignoré) : + +- `IA_DEV_GATEWAY_TOKEN` +- `TOOLS_BRIDGE_TOKEN` +- `ORCHESTRATOR_TOKEN` + +Prérequis : `npm ci && npm run build` dans : + +- `services/ia-dev-gateway` +- `services/smart-ide-tools-bridge` +- `services/smart-ide-orchestrator` + +Installation : + +```bash +./scripts/install-smart-ide-core-services-systemd-user.sh +systemctl --user start ia-dev-gateway smart-ide-tools-bridge smart-ide-orchestrator +systemctl --user status ia-dev-gateway smart-ide-tools-bridge smart-ide-orchestrator +``` + ## Linger (session fermée) Les timers **user** ne tournent en général que lorsqu’une session utilisateur systemd est active. Pour exécuter les timers après déconnexion graphique complète, activer le **linger** pour l’utilisateur : `loginctl enable-linger ` (décision d’administration machine). diff --git a/scripts/install-smart-ide-core-services-systemd-user.sh b/scripts/install-smart-ide-core-services-systemd-user.sh new file mode 100755 index 0000000..82845c1 --- /dev/null +++ b/scripts/install-smart-ide-core-services-systemd-user.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Installe les unités systemd *utilisateur* pour : +# - ia-dev-gateway +# - smart-ide-tools-bridge +# - smart-ide-orchestrator +# +# Prérequis : +# - config/services.local.env (copie de config/services.local.env.example), gitignoré +# - builds npm (tsc) des services concernés +# +# Usage : +# ./scripts/install-smart-ide-core-services-systemd-user.sh +# Puis : +# systemctl --user start ia-dev-gateway smart-ide-tools-bridge smart-ide-orchestrator +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +UNIT_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user" + +IA_IN="${ROOT}/systemd/user/ia-dev-gateway.service.in" +TOOLS_IN="${ROOT}/systemd/user/smart-ide-tools-bridge.service.in" +ORCH_IN="${ROOT}/systemd/user/smart-ide-orchestrator.service.in" + +IA_OUT="${UNIT_DIR}/ia-dev-gateway.service" +TOOLS_OUT="${UNIT_DIR}/smart-ide-tools-bridge.service" +ORCH_OUT="${UNIT_DIR}/smart-ide-orchestrator.service" + +mkdir -p "$UNIT_DIR" +sed "s|@SMART_IDE_ROOT@|$ROOT|g" "$IA_IN" >"$IA_OUT" +sed "s|@SMART_IDE_ROOT@|$ROOT|g" "$TOOLS_IN" >"$TOOLS_OUT" +sed "s|@SMART_IDE_ROOT@|$ROOT|g" "$ORCH_IN" >"$ORCH_OUT" +chmod 0644 "$IA_OUT" "$TOOLS_OUT" "$ORCH_OUT" + +systemctl --user daemon-reload +systemctl --user enable ia-dev-gateway.service +systemctl --user enable smart-ide-tools-bridge.service +systemctl --user enable smart-ide-orchestrator.service + +echo "Unités : $IA_OUT" +echo " $TOOLS_OUT" +echo " $ORCH_OUT" +echo "Démarrage : systemctl --user start ia-dev-gateway smart-ide-tools-bridge smart-ide-orchestrator" +echo "État : systemctl --user status ia-dev-gateway smart-ide-tools-bridge smart-ide-orchestrator" + diff --git a/systemd/user/ia-dev-gateway.service.in b/systemd/user/ia-dev-gateway.service.in new file mode 100644 index 0000000..2568028 --- /dev/null +++ b/systemd/user/ia-dev-gateway.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=smart_ide — ia-dev-gateway (agents, runs, SSE) +Documentation=file://@SMART_IDE_ROOT@/docs/repo/service-ia-dev-gateway.md +After=network-online.target + +[Service] +Type=simple +WorkingDirectory=@SMART_IDE_ROOT@/services/ia-dev-gateway +EnvironmentFile=-@SMART_IDE_ROOT@/config/services.local.env +ExecStart=/usr/bin/node @SMART_IDE_ROOT@/services/ia-dev-gateway/dist/server.js +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=default.target + diff --git a/systemd/user/smart-ide-orchestrator.service.in b/systemd/user/smart-ide-orchestrator.service.in new file mode 100644 index 0000000..76b5ab0 --- /dev/null +++ b/systemd/user/smart-ide-orchestrator.service.in @@ -0,0 +1,20 @@ +[Unit] +Description=smart_ide — orchestrator (intent router) +Documentation=file://@SMART_IDE_ROOT@/docs/repo/service-smart-ide-orchestrator.md +After=network-online.target +After=ia-dev-gateway.service +After=smart-ide-tools-bridge.service +Wants=ia-dev-gateway.service +Wants=smart-ide-tools-bridge.service + +[Service] +Type=simple +WorkingDirectory=@SMART_IDE_ROOT@/services/smart-ide-orchestrator +EnvironmentFile=-@SMART_IDE_ROOT@/config/services.local.env +ExecStart=/usr/bin/node @SMART_IDE_ROOT@/services/smart-ide-orchestrator/dist/server.js +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=default.target + diff --git a/systemd/user/smart-ide-tools-bridge.service.in b/systemd/user/smart-ide-tools-bridge.service.in new file mode 100644 index 0000000..e6c85d5 --- /dev/null +++ b/systemd/user/smart-ide-tools-bridge.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=smart_ide — tools-bridge (registry + tool jobs) +Documentation=file://@SMART_IDE_ROOT@/docs/repo/service-smart-ide-tools-bridge.md +After=network-online.target + +[Service] +Type=simple +WorkingDirectory=@SMART_IDE_ROOT@/services/smart-ide-tools-bridge +EnvironmentFile=-@SMART_IDE_ROOT@/config/services.local.env +ExecStart=/usr/bin/node @SMART_IDE_ROOT@/services/smart-ide-tools-bridge/dist/server.js +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=default.target +