|
1 | 1 | --- |
2 | | -- name: Aleph Protocol - Phase 2 The Vault (panopticon-vault) |
| 2 | +- name: Aleph Protocol - Play 1 The Vault Initialization (panopticon-vault) |
3 | 3 | hosts: panopticon_vault |
4 | 4 | become: true |
5 | 5 | tasks: |
|
89 | 89 | - name: Provision the 'quanux-telemetry' bucket via API |
90 | 90 | command: "mc mb myminio/quanux-telemetry --insecure" |
91 | 91 | register: mb_result |
92 | | - failed_when: mb_result.rc != 0 and 'Bucket already exists' not in mb_result.stderr and 'BucketAlreadyOwnedByYou' not in mb_result.stderr |
| 92 | + failed_when: mb_result.rc != 0 and 'Bucket already exists' not in mb_result.stderr and 'BucketAlreadyOwnedByYou' not in mb_result.stderr and 'already own it' not in mb_result.stderr |
93 | 93 | changed_when: "mb_result.rc == 0" |
94 | 94 |
|
95 | 95 | - name: Enable Bucket Versioning (Absolute HA/Active-Active Readiness) |
|
102 | 102 | changed_when: "ilm_result.rc == 0" |
103 | 103 |
|
104 | 104 |
|
105 | | -- name: Aleph Protocol - Phase 3 The Write Path (panopticon-forge) |
| 105 | +- name: Aleph Protocol - Play 2 The Forge Artifacts (panopticon-forge) |
106 | 106 | hosts: panopticon_forge |
107 | 107 | become: true |
108 | 108 | tasks: |
|
111 | 111 | url: https://packages.timber.io/vector/0.38.0/vector-0.38.0-x86_64-unknown-linux-musl.tar.gz |
112 | 112 | dest: /tmp/vector.tar.gz |
113 | 113 |
|
114 | | - - name: Extract Vector |
| 114 | + - name: Extract Vector Tarball natively bypassing `strip-components` syntax |
115 | 115 | unarchive: |
116 | 116 | src: /tmp/vector.tar.gz |
117 | | - dest: /usr/local/bin |
118 | | - extra_opts: |
119 | | - - --strip-components=2 |
120 | | - - "vector-x86_64-unknown-linux-musl/bin/vector" |
| 117 | + dest: /tmp |
121 | 118 | remote_src: true |
122 | 119 |
|
| 120 | + - name: Transplant Vector Binary to System PATH |
| 121 | + command: mv /tmp/vector-x86_64-unknown-linux-musl/bin/vector /usr/local/bin/vector |
| 122 | + args: |
| 123 | + creates: /usr/local/bin/vector |
| 124 | + |
123 | 125 | - name: Ensure Vector config directory exists |
124 | 126 | file: |
125 | 127 | path: /etc/vector |
|
218 | 220 | enabled: true |
219 | 221 | state: restarted |
220 | 222 |
|
221 | | -- name: Aleph Protocol - Phase 3 The Write Path (panopticon-ledger) |
| 223 | +- name: Aleph Protocol - Play 3 The Ledger Audit (panopticon-ledger) |
222 | 224 | hosts: panopticon_ledger |
223 | 225 | become: true |
224 | 226 | tasks: |
|
241 | 243 | repo: deb https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main |
242 | 244 | state: present |
243 | 245 |
|
244 | | - - name: Install Native OpenSearch |
245 | | - apt: |
246 | | - name: opensearch |
247 | | - state: present |
248 | | - update_cache: true |
249 | | - environment: |
250 | | - OPENSEARCH_INITIAL_ADMIN_PASSWORD: "{{ opensearch_admin_password }}" |
| 246 | + - name: Install Native OpenSearch (Forced Shell Environment to secure zxcvbn password) |
| 247 | + shell: "env OPENSEARCH_INITIAL_ADMIN_PASSWORD='{{ opensearch_admin_password }}' DEBIAN_FRONTEND=noninteractive apt-get install -y opensearch=2.19.4" |
| 248 | + args: |
| 249 | + executable: /bin/bash |
| 250 | + creates: /etc/opensearch/opensearch.yml |
251 | 251 |
|
252 | 252 | - name: OpenSearch VPC Binding |
253 | 253 | lineinfile: |
|
284 | 284 | state: restarted |
285 | 285 |
|
286 | 286 |
|
287 | | -- name: Aleph Protocol - Phase 4 The Read Path (panopticon-oracle) |
| 287 | +- name: Aleph Protocol - Play 4 The Oracle Compilation (panopticon-oracle) |
288 | 288 | hosts: panopticon_oracle |
289 | 289 | become: true |
290 | 290 | tasks: |
|
328 | 328 | CREATE VIEW IF NOT EXISTS quanux_telemetry_live AS |
329 | 329 | SELECT * FROM read_parquet('s3://quanux-telemetry/telemetry/*/*/*/*/*.parquet', hive_partitioning=1); |
330 | 330 |
|
331 | | - - name: Install DuckDB PostgreSQL Emulation Wrapper (Hasura Connector Dependency) |
332 | | - # In a true Tier-1 physical drop, this would be a custom compiled C++ daemon. |
333 | | - # For Phase 4 automated dropping, we utilize a lightweight Python psycopg2/duckdb bridge to expose port 5432. |
| 331 | + - name: Install Native PostgreSQL Database |
334 | 332 | apt: |
335 | 333 | name: |
336 | | - - python3-venv |
337 | | - - python3-pip |
| 334 | + - postgresql |
| 335 | + - postgresql-contrib |
338 | 336 | state: present |
| 337 | + update_cache: true |
339 | 338 |
|
340 | | - - name: Create Python VENV for DuckDB-Oculus PG Bridge |
341 | | - command: python3 -m venv /opt/quanux/oculus_env |
342 | | - args: |
343 | | - creates: /opt/quanux/oculus_env/bin/activate |
344 | | - |
345 | | - - name: Install DuckDB, PGServer & Cython natively |
346 | | - pip: |
347 | | - name: |
348 | | - - duckdb |
349 | | - - pgserver |
350 | | - - Cython |
351 | | - virtualenv: /opt/quanux/oculus_env |
352 | | - virtualenv_command: /usr/bin/python3 -m venv |
353 | | - |
354 | | - - name: Generate DuckDB PG Emulation Wrapper (Cython source) |
355 | | - copy: |
356 | | - dest: /opt/quanux/oculus_env/duckdb_pg_wrapper.pyx |
357 | | - content: | |
358 | | - # cython: language_level=3 |
359 | | - import sys |
360 | | - from runpy import run_module |
361 | | -
|
362 | | - def run(): |
363 | | - sys.argv = [ |
364 | | - "duckdb_pg_wrapper", |
365 | | - "--host", "0.0.0.0", |
366 | | - "--port", "5432", |
367 | | - "--init-sql", "/etc/duckdb/init.sql", |
368 | | - "/var/lib/duckdb/quanux.duckdb" |
369 | | - ] |
370 | | - run_module("pgserver", run_name="__main__") |
371 | | -
|
372 | | - - name: Generate Setup script for Cython compilation |
373 | | - copy: |
374 | | - dest: /opt/quanux/oculus_env/setup.py |
375 | | - content: | |
376 | | - from setuptools import setup |
377 | | - from Cython.Build import cythonize |
378 | | -
|
379 | | - setup( |
380 | | - ext_modules=cythonize("duckdb_pg_wrapper.pyx", compiler_directives={'language_level' : "3"}) |
381 | | - ) |
382 | | -
|
383 | | - - name: Compile DuckDB Oculus wrapper into C-extension (.so) |
| 339 | + - name: Configure PostgreSQL Network Bindings |
384 | 340 | shell: | |
385 | | - source /opt/quanux/oculus_env/bin/activate |
386 | | - python3 setup.py build_ext --inplace |
387 | | - args: |
388 | | - chdir: /opt/quanux/oculus_env |
389 | | - creates: /opt/quanux/oculus_env/duckdb_pg_wrapper.c |
| 341 | + for conf in /etc/postgresql/*/main/postgresql.conf; do |
| 342 | + sed -i "s/^#\?listen_addresses.*/listen_addresses = '*'/g" "$conf" |
| 343 | + done |
390 | 344 |
|
391 | | - - name: Create DuckDB-Oculus SystemD Service Wrapper (Cythonized) |
392 | | - copy: |
393 | | - dest: /etc/systemd/system/duckdb-oculus.service |
394 | | - content: | |
395 | | - [Unit] |
396 | | - Description=DuckDB Oculus PostgreSQL Emulator (C-Extension) |
397 | | - After=network-online.target |
398 | | -
|
399 | | - [Service] |
400 | | - WorkingDirectory=/opt/quanux/oculus_env |
401 | | - ExecStart=/opt/quanux/oculus_env/bin/python3 -c "import duckdb_pg_wrapper; duckdb_pg_wrapper.run()" |
402 | | - Restart=always |
403 | | - LimitNOFILE=65536 |
404 | | -
|
405 | | - [Install] |
406 | | - WantedBy=multi-user.target |
| 345 | + - name: Configure PostgreSQL VPC Subnet Trust |
| 346 | + shell: | |
| 347 | + for hba in /etc/postgresql/*/main/pg_hba.conf; do |
| 348 | + if ! grep -q "0.0.0.0/0 trust" "$hba"; then |
| 349 | + echo "host all all 0.0.0.0/0 trust" >> "$hba" |
| 350 | + fi |
| 351 | + done |
407 | 352 |
|
408 | | - - name: Enable and restart DuckDB-Oculus |
| 353 | + - name: Enable and restart PostgreSQL |
409 | 354 | systemd: |
410 | | - name: duckdb-oculus |
| 355 | + name: postgresql |
411 | 356 | daemon_reload: true |
412 | 357 | enabled: true |
413 | 358 | state: restarted |
414 | 359 |
|
415 | | -- name: Aleph Protocol - Phase 4 The Read Path (panopticon-nexus) |
| 360 | + - name: Hydrate QuanuX Database and Users |
| 361 | + become: true |
| 362 | + become_user: postgres |
| 363 | + shell: | |
| 364 | + psql -tc "SELECT 1 FROM pg_database WHERE datname = 'quanux'" | grep -q 1 || psql -c "CREATE DATABASE quanux;" |
| 365 | + psql -c "ALTER USER postgres WITH PASSWORD 'postgres';" |
| 366 | +
|
| 367 | + - name: Execute Extension Protocol |
| 368 | + become: true |
| 369 | + become_user: postgres |
| 370 | + shell: psql -d quanux -c "CREATE EXTENSION IF NOT EXISTS pgcrypto;" |
| 371 | + |
| 372 | +- name: Aleph Protocol - Play 5 The Nexus & AI Bridge (panopticon-nexus) |
416 | 373 | hosts: panopticon_nexus |
417 | 374 | become: true |
418 | 375 | tasks: |
419 | | - - name: Ensure Docker and Docker Compose are installed |
| 376 | + - name: Install Docker daemon natively and start the service |
420 | 377 | apt: |
421 | 378 | name: |
422 | 379 | - docker.io |
423 | 380 | - docker-compose-v2 |
424 | 381 | state: present |
425 | 382 | update_cache: true |
426 | 383 |
|
| 384 | + - name: Ensure Docker daemon is enabled and started |
| 385 | + systemd: |
| 386 | + name: docker |
| 387 | + state: started |
| 388 | + enabled: true |
| 389 | + |
| 390 | + - name: Pull the Hasura GraphQL Docker image explicitly |
| 391 | + command: docker pull hasura/graphql-engine:v2.37.0 |
| 392 | + |
427 | 393 | - name: Ensure Nexus directory exists |
428 | 394 | file: |
429 | 395 | path: /opt/quanux/nexus |
|
436 | 402 | services: |
437 | 403 | graphql-engine: |
438 | 404 | image: hasura/graphql-engine:v2.37.0 |
439 | | - ports: |
440 | | - - "8080:8080" |
| 405 | + network_mode: "host" |
441 | 406 | environment: |
442 | 407 | HASURA_GRAPHQL_ENABLE_CONSOLE: "true" |
443 | 408 | HASURA_GRAPHQL_DEV_MODE: "true" |
444 | 409 | HASURA_GRAPHQL_ADMIN_SECRET: "${QUANUX_HASURA_SECRET}" |
445 | 410 | # The Supergraph mappings to the decoupled matrix: |
| 411 | + HASURA_GRAPHQL_DATABASE_URL: "postgresql://postgres:postgres@{{ hostvars[groups['panopticon_oracle'][0]]['internal_ip'] }}:5432/quanux" |
446 | 412 | QUANUX_ORACLE_URL: "postgresql://postgres:postgres@{{ hostvars[groups['panopticon_oracle'][0]]['internal_ip'] }}:5432/quanux" |
447 | 413 | QUANUX_LEDGER_URL: "http://{{ hostvars[groups['panopticon_ledger'][0]]['internal_ip'] }}:9200" |
448 | 414 | restart: always |
449 | 415 |
|
450 | | - - name: Launch Hasura Supergraph (Dynamic Injection) |
| 416 | + - name: Execute docker compose up -d with dynamic vault secrets |
451 | 417 | command: docker compose up -d |
452 | 418 | args: |
453 | 419 | chdir: /opt/quanux/nexus |
454 | 420 | environment: |
455 | 421 | QUANUX_HASURA_SECRET: "{{ hasura_admin_secret }}" |
| 422 | + |
| 423 | + - name: Create Python VENV for FastMCP Bridge |
| 424 | + command: python3 -m venv /opt/quanux/mcp_env |
| 425 | + args: |
| 426 | + creates: /opt/quanux/mcp_env/bin/activate |
| 427 | + |
| 428 | + - name: Pip install setuptools, Cython, fastmcp via explicit VENV binary |
| 429 | + shell: /opt/quanux/mcp_env/bin/pip install --upgrade setuptools Cython fastmcp |
| 430 | + |
| 431 | + - name: Transplant FastMCP Bridge Source Core (Cython & Python) |
| 432 | + copy: |
| 433 | + src: "/Users/Duncan/Antigravity/QuanuX/QuanuX/QuanuX-Observability/python/mcp_bridge/{{ item }}" |
| 434 | + dest: "/opt/quanux/nexus/{{ item }}" |
| 435 | + loop: |
| 436 | + - mcp_server.py |
| 437 | + - telemetry_compiler.pyx |
| 438 | + - setup_compiler.py |
| 439 | + |
| 440 | + - name: Compile the telemetry_compiler.pyx translation bridge |
| 441 | + command: /opt/quanux/mcp_env/bin/python setup_compiler.py build_ext --inplace |
| 442 | + args: |
| 443 | + chdir: /opt/quanux/nexus |
| 444 | + creates: /opt/quanux/nexus/telemetry_compiler.c |
| 445 | + |
| 446 | + - name: Create FastMCP SystemD Service Wrapper |
| 447 | + copy: |
| 448 | + dest: /etc/systemd/system/quanux-mcp.service |
| 449 | + content: | |
| 450 | + [Unit] |
| 451 | + Description=QuanuX FastMCP Bridge (Cython Native) |
| 452 | + After=docker.service network-online.target |
| 453 | +
|
| 454 | + [Service] |
| 455 | + WorkingDirectory=/opt/quanux/nexus |
| 456 | + Environment="QUANUX_HASURA_URL=http://{{ hostvars[groups['panopticon_nexus'][0]]['internal_ip'] }}:8080/v1/graphql" |
| 457 | + ExecStart=/opt/quanux/mcp_env/bin/python -m mcp_server |
| 458 | + Restart=always |
| 459 | +
|
| 460 | + [Install] |
| 461 | + WantedBy=multi-user.target |
| 462 | +
|
| 463 | + - name: Start the quanux-mcp service natively |
| 464 | + systemd: |
| 465 | + name: quanux-mcp |
| 466 | + daemon_reload: true |
| 467 | + enabled: true |
| 468 | + state: restarted |
0 commit comments