Changes between Version 7 and Version 8 of expansion/gw16168


Ignore:
Timestamp:
05/01/2026 10:56:04 PM (7 weeks ago)
Author:
Tim Harvey
Comment:

added service for example eiq webapp

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16168

    v7 v8  
    262262jq '(.available_models[] | select(.name == "Qwen2.5-7B-Instruct") |  .enabled) = true' /usr/share/eiq/aaf-connector/server_config.json > /tmp/config.json && \
    263263  mv /tmp/config.json /usr/share/eiq/aaf-connector/server_config.json
    264 jq '(.available_models[] | select(.name == "Qwen2.5-7B-Instruct") | .enabled) = true' /usr/share/eiq
    265 /aaf-connector/server_config.json > /tmp/config.json && mv /tmp/config.json /usr/share/eiq/aaf-connector/server_config.j
    266 son
    267264}}}
    268265  - you can just as easily edit the file manually if you want
     
    427424}}}
    428425
    429 === command-line python chatbot
     426=== command-line python eIQ chatbot
    430427This is a command-line chatbot written in python using the eIQ AAF Connector
    431428
     
    527524}}}
    528525
    529 === Web based python chatbot
     526=== Web based python eIQ chatbot
    530527This is a web based chatbot in python using eIQ AAF Connector
    531528
     
    719716Execution:
    720717{{{#!bash
     718$ mkdir /root/webapp
     719$ cd /root/webapp
    721720$ uv venv # create virtual python env in current dir
    722721$ uv pip install streamlit requests psutil argparse # install python deps
     
    724723}}}
    725724
     725Service:
     726 - if want this to run as a service:
     727{{{#!bash
     728cat << EOF > /etc/systemd/system/eiq-webapp.service:
     729[Unit]
     730Description=Streamlit Webapp for eIQ AAF
     731# Start after network is up
     732After=network.target
     733# We don't use 'After=eiq-aaf-connector.service' to avoid potential boot cycles
     734StartLimitIntervalSec=0
     735
     736[Service]
     737Type=simple
     738User=root
     739# Ensure we are in the directory where webapp.py lives
     740WorkingDirectory=/root/webapp
     741
     742# 1. Wait until the Connector is actually listening on Port 8000
     743ExecStartPre=/bin/bash -c 'until ss -Hltn | grep -E -q ":8000([[:space:]]|$)"; do echo "Waiting for eIQ Connector on Port 8000..." >&2; sleep 5; done'
     744
     745# 2. Launch the app using uv
     746# Note: Using absolute path for uv is safer in systemd
     747ExecStart=/usr/local/bin/uv run streamlit run webapp.py \
     748    --server.address 0.0.0.0 \
     749    --server.port 8501 \
     750    -- \
     751    --user-map users.json \
     752    --host 127.0.0.1 \
     753    --port 8000
     754
     755# Restart logic
     756Restart=on-failure
     757RestartSec=10s
     758StartLimitBurst=0
     759
     760# Standard Logging
     761StandardOutput=journal
     762StandardError=journal
     763
     764[Install]
     765WantedBy=multi-user.target
     766EOF
     767systemctl daemon-reload
     768systemctl enable eiq-webapp.service
     769systemctl start eiq-webapp.service
     770}}}
    726771
    727772== Troubleshooting