Skip to content

feat(slm): implement autobot-backend Docker deployment API bridge (SLM → Ansible → Docker) #3407

@mrveiss

Description

@mrveiss

Context7 Score: 81/100

Test query: "Use the Service Lifecycle Manager to automate the deployment of a Docker container using an Ansible playbook."

Audit Findings

What EXISTS

  • autobot-slm-backend/services/playbook_executor.py — full Ansible playbook runner (production-ready)
  • autobot-slm-backend/api/deployments.py — 6 deployment endpoints (create, list, cancel, rollback) — production-ready
  • autobot-slm-backend/ansible/playbooks/deploy-hybrid-docker.yml — Docker container deployment playbook
  • autobot-backend/services/slm_client.py — SLM HTTP client (agent config only, not deployments)
  • docs/guides/slm-docker-ansible-deployment.md — 1000-line comprehensive guide (covers curl/Python examples direct to SLM)
  • autobot-backend/api/slm/deployments_api_test.py — test file with mocked DeploymentOrchestrator (class doesn't exist)

What is MISSING

  1. No autobot-backend/api/slm/deployments.py — the test file imports DeploymentOrchestrator which doesn't exist; there's no actual API route
  2. No SLMDeploymentService in autobot-backend — slm_client.py only handles agent config, not deployments
  3. No Docker-specific Pydantic models — no DockerContainerSpec, DockerDeploymentRequest types
  4. No integration tests — existing tests only mock; no real SLM call path is tested

Acceptance Criteria

  • autobot-backend/services/slm/deployment_orchestrator.pySLMDeploymentOrchestrator class with:
    • deploy_docker_container(node_id, container_spec) -> DeploymentStatus
    • get_deployment_status(deployment_id) -> DeploymentStatus
    • list_deployments(node_id?) -> List[DeploymentStatus]
    • Calls SLM POST /deployments with playbook + extra_vars from container spec
  • autobot-backend/models/infrastructure.py (new) — DockerContainerSpec, PortMapping, DockerDeploymentRequest, DockerDeploymentStatus Pydantic models
  • autobot-backend/api/slm/deployments.py (real implementation) replacing the mocked test stub:
    • POST /api/v1/slm/deployments/docker — trigger Docker deployment
    • GET /api/v1/slm/deployments/{id} — poll status
    • GET /api/v1/slm/deployments — list
  • Integration test (not mock-only): test calls SLMDeploymentOrchestrator with a real or test-double SLM response
  • docs/guides/slm-docker-ansible-deployment.md updated with "From AutoBot Backend" section showing the new API endpoint + Python client example

Files to Touch

  • autobot-backend/services/slm/deployment_orchestrator.py (new)
  • autobot-backend/models/infrastructure.py (new)
  • autobot-backend/api/slm/deployments.py (implement — currently only test file exists)
  • autobot-backend/api/slm/deployments_api_test.py (update to use real orchestrator)
  • docs/guides/slm-docker-ansible-deployment.md

Related

  • SLM backend deployment API at autobot-slm-backend/api/deployments.py is production-ready — no changes needed there
  • autobot-backend/services/slm_client.py may need create_deployment() method added

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions