-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(slm): implement autobot-backend Docker deployment API bridge (SLM → Ansible → Docker) #3407
Copy link
Copy link
Open
Labels
Description
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-readyautobot-slm-backend/ansible/playbooks/deploy-hybrid-docker.yml— Docker container deployment playbookautobot-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 mockedDeploymentOrchestrator(class doesn't exist)
What is MISSING
- No
autobot-backend/api/slm/deployments.py— the test file importsDeploymentOrchestratorwhich doesn't exist; there's no actual API route - No
SLMDeploymentServicein autobot-backend —slm_client.pyonly handles agent config, not deployments - No Docker-specific Pydantic models — no
DockerContainerSpec,DockerDeploymentRequesttypes - No integration tests — existing tests only mock; no real SLM call path is tested
Acceptance Criteria
-
autobot-backend/services/slm/deployment_orchestrator.py—SLMDeploymentOrchestratorclass with:deploy_docker_container(node_id, container_spec) -> DeploymentStatusget_deployment_status(deployment_id) -> DeploymentStatuslist_deployments(node_id?) -> List[DeploymentStatus]- Calls SLM
POST /deploymentswith playbook + extra_vars from container spec
-
autobot-backend/models/infrastructure.py(new) —DockerContainerSpec,PortMapping,DockerDeploymentRequest,DockerDeploymentStatusPydantic models -
autobot-backend/api/slm/deployments.py(real implementation) replacing the mocked test stub:POST /api/v1/slm/deployments/docker— trigger Docker deploymentGET /api/v1/slm/deployments/{id}— poll statusGET /api/v1/slm/deployments— list
- Integration test (not mock-only): test calls
SLMDeploymentOrchestratorwith a real or test-double SLM response -
docs/guides/slm-docker-ansible-deployment.mdupdated 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.pyis production-ready — no changes needed there autobot-backend/services/slm_client.pymay needcreate_deployment()method added
Reactions are currently unavailable