Skip to content

fix(ansible): NPU play installs from docker/npu-worker/requirements.txt, which does not exist #13744

Description

@mrveiss

Part of #13743 · Wave 2, no blockers.

autobot-slm-backend/ansible/playbooks/deploy-native-services.yml:371 installs the NPU worker's dependencies from:

- name: Install Python dependencies for NPU Worker
  pip:
    requirements: /opt/autobot/src/docker/npu-worker/requirements.txt

There is no docker/npu-worker/ directory in the repo:

$ find . -name "npu-worker" -type d | grep -v .worktrees
./autobot-slm-backend/ansible/roles/npu-worker      # the role, not a docker dir

The real files are autobot-npu-worker/requirements.txt (Linux, openvino>=2026.2.1 + torch) and autobot-infrastructure/autobot-npu-worker/docker/requirements-npu.txt.

Why it matters

This is not dead code. docs/developer/SERVICE_MANAGEMENT.md:350 documents ansible-playbook playbooks/deploy-native-services.yml --tags npu as the operator entry point, and INFRASTRUCTURE_DEPLOYMENT.md does the same. The documented way to deploy the NPU worker natively points at a path that cannot resolve.

Fix

Point the play at the canonical requirements file. Decide which of the two is canonical for a native Linux deploy — the role (roles/npu-worker) is the better-maintained path and should be the reference for what "correct" looks like.

Acceptance criteria

  • The play installs from a requirements file that exists in the repo.
  • A syntax/reference check covers it, so a renamed requirements file fails CI instead of a deploy.
  • Verified by deliberate failure: pointing at a bogus path makes the check fail.

Activity

  1. mrveiss commented on Aug 8, 2026

    @mrveiss
    OwnerAuthor

    Tracked under epic #13743 (Python 3.14 consistency). Audit with the measurements: docs/audit/python_314_consistency.md, landing in PR #13750.

  2. github-actions commented on Aug 9, 2026

    @github-actions
    Contributor

    PR #13785 (merged to Dev_new_gui) references this issue with a close keyword.

    fix(ansible): reference a requirements file that exists, and guard host patterns (#13744, #13745)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  3. mrveiss commented on Aug 9, 2026

    @mrveiss
    OwnerAuthor

    Delivered and merged: PR #13785, squashed as efcb3ff.

    AC 1 — the play installs from /opt/autobot/src/autobot-npu-worker/requirements.txt.

    The issue suggested roles/npu-worker as the reference for which file is canonical. It does not answer that — the role installs an inline package list, not a requirements file:

    - name: Install OpenVINO and dependencies
      ansible.builtin.pip:
        name: [openvino>=2024.0, openvino-dev, numpy, pillow, transformers, optimum[openvino]]

    So the choice came down to the two files on their merits. autobot-npu-worker/requirements.txt is the native source tree — minimal, exactly the NPU surface. The sibling under autobot-infrastructure/.../docker/ is the container recipe and carries the whole web stack (fastapi, uvicorn, redis, pytest) that this play installs separately a few tasks later. A play named deploy-native-services.yml takes the native one. Its relative -e ../autobot_shared and -c ../constraints/shared.txt resolve on the host because the preceding task syncs the full source tree to /opt/autobot/src/.

    AC 2 — scripts/check_ansible_file_references.py, run by a new ansible-file-references workflow on any ansible/** yml change. It exploits the one thing that makes this statically decidable: the deploy syncs the repo to /opt/autobot/src/, so a path under that prefix is a repo path.

    AC 3 — deliberate failure, restoring the original bogus path:

    Ansible plays reference repo paths that do not exist:
      autobot-slm-backend/ansible/playbooks/deploy-native-services.yml:380: requirements -> docker/npu-worker/requirements.txt does not exist in the repo
    exit=1
    

    and with the fix:

    check_ansible_file_references: 1 deployed-src reference(s) resolve; 216 host pattern(s) resolve against 8 inventories.
    exit=0
    
    scripts/check_ansible_file_references_test.py    22 passed
    

    The first draft of the guard was broken and passed — it reported 0 deployed-src reference(s) resolve: green, and checking nothing. _EXCLUDE_DIRS was matched against the absolute path, and the checkout lives under .worktrees/, so every file in the repo was excluded. Exclusions are now relative, with a test for that case, and the end-to-end test asserts the output does not say 0 — so a future change that silently stops discovering plays fails rather than passes.

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions