Guia Deploy Rapido

🚀 Guia de Deploy Rápido - Novos Componentes

Data: 2025-12-06
Versão: 1.0


📋 Pré-requisitos


🎯 Componentes para Deploy

  1. Feature Store - Armazenamento e cache de features
  2. Model Registry - Versionamento de modelos ML
  3. ML Pipeline - Pipeline de treinamento (opcional)
  4. C-Suite Operations - Já deployado (verificar)

🚀 Deploy Automatizado

Opção 1: Script Automático

cd /home/ec2-user/enviroment/apps/c-suite
chmod +x scripts/deploy_new_components.sh
./scripts/deploy_new_components.sh

Opção 2: Deploy Manual

1. Feature Store

cd csuite-feature-store

# Build
docker build -t csuite-feature-store:latest .

# Deploy
docker stack deploy -c docker-stack.yml feature-store

# Verificar
docker service ls | grep feature-store

2. Model Registry

cd csuite-model-registry

# Build
docker build -t csuite-model-registry:latest .

# Deploy
docker stack deploy -c docker-stack.yml model-registry

# Verificar
docker service ls | grep model-registry

3. ML Pipeline (Opcional)

cd scripts/ml_pipeline

# Build
docker build -t ml-pipeline:latest -f Dockerfile .

# Deploy
docker stack deploy -c docker-stack.yml ml-pipeline

# Verificar
docker service ls | grep ml-pipeline

✅ Validação

Script Automático

chmod +x scripts/validate_new_components.sh
./scripts/validate_new_components.sh

Validação Manual

1. Feature Store

# Health check
curl https://csuite.internut.com.br/feature-store/health

# Listar definições
curl https://csuite.internut.com.br/feature-store/definitions

# Sincronizar com Feature Service
curl -X POST https://csuite.internut.com.br/feature-store/sync-definitions

2. Model Registry

# Health check
curl https://csuite.internut.com.br/model-registry/health

# Listar modelos
curl https://csuite.internut.com.br/model-registry/models

3. C-Suite Operations

# Health check
curl https://csuite.internut.com.br/operations/health

# Dashboard
curl https://csuite.internut.com.br/operations/dashboard?org_id=1

🔧 Configuração do Banco de Dados

Feature Store

# Executar schema
mysql -h <host> -u <user> -p csuite < csuite-feature-store/schema.sql

Model Registry

# Executar schema (se houver)
mysql -h <host> -u <user> -p csuite < csuite-model-registry/schema.sql

Agent Coordination & Learning

# Executar schema
mysql -h <host> -u <user> -p csuite < csuite-executive/csuite-api/schema_agent_coordination.sql

📊 Verificação de Status

Listar Serviços

docker service ls | grep -E "feature-store|model-registry|operations"

Ver Logs

# Feature Store
docker service logs feature-store_feature-store-api

# Model Registry
docker service logs model-registry_model-registry-api

# Operations
docker service logs csuite-operations_csuite-operations-api

Verificar Saúde

# Todos os serviços
docker service ps <service_name> --no-trunc

🔗 URLs dos Serviços

Serviço URL Descrição
Feature Store https://csuite.internut.com.br/feature-store API de features
Model Registry https://csuite.internut.com.br/model-registry API de modelos
Operations https://csuite.internut.com.br/operations Dashboard operacional
Policies UI https://csuite.internut.com.br/executive/policies/policies.html Interface de políticas

🐛 Troubleshooting

Serviço não inicia

# Ver logs detalhados
docker service logs <service_name> --tail 100

# Verificar variáveis de ambiente
docker service inspect <service_name> --pretty | grep -A 20 Env

Erro de conexão com banco

# Verificar se banco está acessível
mysql -h <host> -u <user> -p -e "SELECT 1"

# Verificar variável CSUITE_DB_HOST no serviço
docker service inspect <service_name> --pretty | grep CSUITE_DB_HOST

Erro 404 no Traefik

# Verificar labels do Traefik
docker service inspect <service_name> --pretty | grep traefik

# Verificar rede
docker network ls | grep superbot-swarm-network

📝 Próximos Passos Após Deploy

  1. ✅ Validar todos os endpoints
  2. ✅ Sincronizar Feature Store com Feature Service
  3. ✅ Testar APIs de coordenação e aprendizado
  4. ✅ Acessar interface de políticas
  5. ✅ Configurar monitoramento (se necessário)

🔄 Atualização

Para atualizar um serviço:

# 1. Rebuild
docker build -t <image>:latest .

# 2. Update service
docker service update --image <image>:latest <service_name>

# 3. Verificar
docker service ps <service_name>

Última atualização: 2025-12-06

🔊 Text-to-Speech

1.0x
1.0
Pronto para reproduzir