Service Management Playbook

The definitive operational guide for managing the systemd services and timers that constitute the NomadPM platform on the ai6pack host.

Architectural Principles & Dependencies

The NomadPM platform is a multi-service system designed for resilience. The services have explicit dependencies to ensure they start in the correct order after a system reboot. This prevents the application from starting before its critical dependencies (like databases and AI models) are online.

Startup Order

The nomad_app.service is the central nervous system and is configured to wait for all other core services to be fully loaded and listening on their network ports before it starts. This is why you will often see "Waiting for..." messages in the logs during a system-wide restart; this is a sign of a healthy, patient startup, not an error.

Service & Timer Reference

This table provides a complete list of the custom services and timers for the platform.

Unit File Type Purpose
nomad_app.serviceServiceThe core backend application server (FastAPI/Uvicorn).
vllm.serviceServiceServes the 120B "Scholar" AI model for high-level reasoning.
vllm-engineer.serviceServiceServes the 20B "Librarian" AI model for memory and synthesis.
embedding.serviceServiceServes the embedding model for the RAG system.
nomad-executive.timerTimerTriggers the Executive Agent service on a recurring schedule.
nomad-executive.serviceServiceRuns the Executive Agent script to process jobs from the queue.
nomad-prospector.timerTimerTriggers the Prospector Agent service on a recurring schedule.
nomad-prospector.serviceServiceRuns the Prospector Agent script to find stalled work.

Standard Operating Procedures (SOPs)

These are ordered examples for the most common operational scenarios.

SOP-01: Full System Restart

Use this procedure after a reboot or when you need to restart the entire platform from a clean state.

  1. Restart the core AI model and application services. The dependencies we built into nomad_app.service will ensure the correct startup order.
    sudo systemctl restart vllm.service vllm-engineer.service embedding.service nomad_app.service
  2. Restart the agent timers. This will activate the background agent workforce.
    sudo systemctl restart nomad-executive.timer nomad-prospector.timer
  3. Verify system health. Watch the log of the main application. You will see it wait for the other services to come online before starting itself.
    sudo journalctl -u nomad_app.service -f

SOP-02: Deploying a Code Change

Use this procedure when you have modified a Python file in the /opt/nomadpm/backend/ directory (e.g., main.py or agent_logic.py).

  1. Reload the systemd daemon. This is only necessary if you have also edited a .service or .timer file. If you only changed Python code, you can skip this step.
    sudo systemctl daemon-reload
  2. Restart only the main application service. This is the only service that needs to be restarted to load new Python code. You do not need to restart the heavy AI models.
    sudo systemctl restart nomad_app.service
  3. Verify the application starts correctly.
    sudo journalctl -u nomad_app.service -n 50 --no-pager

SOP-03: Debugging a Failed Service

Use this procedure when a service is not behaving correctly (e.g., the UI is unresponsive or jobs are stuck in "pending").

  1. Check the high-level status of the service. This will tell you if it's `active (running)` or `failed`.
    sudo systemctl status nomad_app.service
  2. Get the detailed error log. If the service has failed, this command is the most important diagnostic tool. It will show you the Python traceback or error message that caused the crash.
    sudo journalctl -u nomad_app.service -n 100 --no-pager
  3. After fixing the root cause, restart the service.
    sudo systemctl restart nomad_app.service
← Back to Documentation Home