π§ͺ Real SkyPilot Validation Test
Browse filesAdded minimal test that actually provisions a cloud machine and validates the complete infrastructure.
## Why This Test?
Previous test_end_to_end.py ran LOCALLY only and did NOT test:
- β SkyPilot provisioning real machines
- β Cloud setup in clean environment
- β Internet connectivity in VM
- β Real costs
This test ACTUALLY provisions a machine and validates everything.
## What It Tests
### Setup (~2 min):
1. β
Machine provisioning (spot instance)
2. β
Internet connectivity
3. β
Python environment
4. β
Git clone from HuggingFace
5. β
Dependencies installation
6. β
GPU detection (if available)
### Validation (~3 min):
7. β
Repository structure (all files present)
8. β
Python imports (numpy, librosa, soundfile)
9. β
Synthetic data generation (7 samples)
10. β
Audio processing (loading + features)
11. β
Ensemble voting system
## Cost
**~$0.10** for 5 minutes
- Uses cheapest spot GPU (L4, T4, or V100)
- Can use CPU-only if no GPU quota
- Auto-cleanup after test
## Usage
```bash
# Install SkyPilot
pip install "skypilot[gcp,aws]"
# Configure cloud
gcloud auth login # or aws configure
sky check
# Run test (provisions REAL machine!)
sky launch scripts/cloud/skypilot_test_minimal.yaml
# Monitor
sky logs ensemble-test-minimal -f
# Cleanup
sky down ensemble-test-minimal
```
## Expected Output
```
β
ALL TESTS PASSED!
π Summary:
β Machine provisioned successfully
β Internet connectivity working
β Python environment functional
β Repository cloned and validated
β Dependencies installed
β Synthetic data generation works
β Audio processing works
β Ensemble voting works
π SkyPilot infrastructure validated!
π° Cost: ~$0.10 for this test
```
## Documentation
See TEST_SKYPILOT_REAL.md for:
- Complete setup guide
- Troubleshooting
- Comparison: local vs real test
- Next steps after validation
## After This Test Passes
You can confidently run:
- Fine-tuning: `sky launch scripts/cloud/skypilot_finetune.yaml`
- Multi-GPU: `sky launch scripts/cloud/skypilot_multi_gpu.yaml`
- Annotation: `sky launch scripts/cloud/skypilot_annotate_orpheus.yaml`
**This validates the ACTUAL cloud infrastructure works!** β
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- TEST_SKYPILOT_REAL.md +319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
| 4 |
+
|
| 5 |
+
O teste `test_end_to_end.py` rodou **apenas localmente** e validou a estrutura, mas NΓO testou:
|
| 6 |
+
|
| 7 |
+
- β SkyPilot provisionar mΓ‘quina de verdade
|
| 8 |
+
- β Setup em ambiente cloud limpo
|
| 9 |
+
- β Download de dependΓͺncias
|
| 10 |
+
- β Acesso Γ internet na VM
|
| 11 |
+
- β Custo real
|
| 12 |
+
|
| 13 |
+
Este teste **realmente provisiona uma mΓ‘quina** e valida tudo funcionar.
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## π° Custo Estimado
|
| 18 |
+
|
| 19 |
+
**~$0.10** para 5 minutos de teste
|
| 20 |
+
|
| 21 |
+
- Usa instΓ’ncia spot (70% desconto)
|
| 22 |
+
- GPU mais barata (L4, T4, ou V100)
|
| 23 |
+
- Auto-cleanup ao terminar
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## π Como Rodar
|
| 28 |
+
|
| 29 |
+
### PrΓ©-requisitos
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
# 1. Instalar SkyPilot
|
| 33 |
+
pip install "skypilot[gcp,aws,azure]"
|
| 34 |
+
|
| 35 |
+
# 2. Configurar pelo menos um cloud
|
| 36 |
+
# OpΓ§Γ£o A: GCP (recomendado)
|
| 37 |
+
gcloud auth login
|
| 38 |
+
gcloud config set project SEU_PROJECT_ID
|
| 39 |
+
|
| 40 |
+
# OpΓ§Γ£o B: AWS
|
| 41 |
+
aws configure
|
| 42 |
+
|
| 43 |
+
# OpΓ§Γ£o C: Azure
|
| 44 |
+
az login
|
| 45 |
+
|
| 46 |
+
# 3. Verificar setup
|
| 47 |
+
sky check
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**Importante**: VocΓͺ precisa ter pelo menos 1 cloud configurado e com quota para GPU spot.
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## π§ͺ Rodar Teste Real
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
# Commitar o novo arquivo primeiro
|
| 58 |
+
git add scripts/cloud/skypilot_test_minimal.yaml TEST_SKYPILOT_REAL.md
|
| 59 |
+
git commit -m "Add real SkyPilot validation test"
|
| 60 |
+
git push
|
| 61 |
+
|
| 62 |
+
# LanΓ§ar teste (provisiona mΓ‘quina real!)
|
| 63 |
+
sky launch scripts/cloud/skypilot_test_minimal.yaml
|
| 64 |
+
|
| 65 |
+
# Monitorar em tempo real
|
| 66 |
+
sky logs ensemble-test-minimal -f
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## π O Que SerΓ‘ Testado
|
| 72 |
+
|
| 73 |
+
### Durante Setup (~2 min):
|
| 74 |
+
1. β
**Machine provisioning** - SkyPilot encontra e cria instΓ’ncia
|
| 75 |
+
2. β
**Internet connectivity** - Acesso ao HuggingFace
|
| 76 |
+
3. β
**Python environment** - Python 3.x disponΓvel
|
| 77 |
+
4. β
**Git clone** - Repository baixado
|
| 78 |
+
5. β
**Dependencies** - numpy, librosa, soundfile instalados
|
| 79 |
+
6. β
**GPU detection** (se disponΓvel)
|
| 80 |
+
|
| 81 |
+
### Durante Run (~3 min):
|
| 82 |
+
7. β
**Repository structure** - Todos arquivos presentes
|
| 83 |
+
8. β
**Python imports** - Bibliotecas funcionando
|
| 84 |
+
9. β
**Synthetic data generation** - 7 samples criados
|
| 85 |
+
10. β
**Audio processing** - Loading e features
|
| 86 |
+
11. β
**Ensemble voting** - Sistema de votaΓ§Γ£o
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## β
Output Esperado
|
| 91 |
+
|
| 92 |
+
Se tudo funcionar, vocΓͺ verΓ‘:
|
| 93 |
+
|
| 94 |
+
```
|
| 95 |
+
==================================================
|
| 96 |
+
β
ALL TESTS PASSED!
|
| 97 |
+
==================================================
|
| 98 |
+
|
| 99 |
+
π Summary:
|
| 100 |
+
β Machine provisioned successfully
|
| 101 |
+
β Internet connectivity working
|
| 102 |
+
β Python environment functional
|
| 103 |
+
β Repository cloned and validated
|
| 104 |
+
β Dependencies installed
|
| 105 |
+
β Synthetic data generation works
|
| 106 |
+
β Audio processing works
|
| 107 |
+
β Ensemble voting works
|
| 108 |
+
|
| 109 |
+
π SkyPilot infrastructure validated!
|
| 110 |
+
|
| 111 |
+
π° Cost: ~$0.10 for this test (5 minutes)
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
## π Troubleshooting
|
| 117 |
+
|
| 118 |
+
### "No GPU available"
|
| 119 |
+
|
| 120 |
+
**SoluΓ§Γ£o 1**: Edite o YAML para usar CPU apenas:
|
| 121 |
+
|
| 122 |
+
```yaml
|
| 123 |
+
resources:
|
| 124 |
+
use_spot: true
|
| 125 |
+
cpus: 2+ # Remove a linha accelerators
|
| 126 |
+
memory: 8+
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
**SoluΓ§Γ£o 2**: Tente outro cloud:
|
| 130 |
+
|
| 131 |
+
```bash
|
| 132 |
+
sky launch --cloud aws scripts/cloud/skypilot_test_minimal.yaml
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
### "Quota exceeded"
|
| 136 |
+
|
| 137 |
+
```bash
|
| 138 |
+
# Ver suas quotas
|
| 139 |
+
sky quota
|
| 140 |
+
|
| 141 |
+
# Tentar regiΓ£o diferente ou cloud diferente
|
| 142 |
+
sky launch --cloud azure scripts/cloud/skypilot_test_minimal.yaml
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
### "Setup failed"
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
# Ver logs detalhados
|
| 149 |
+
sky logs ensemble-test-minimal
|
| 150 |
+
|
| 151 |
+
# SSH para debug
|
| 152 |
+
sky ssh ensemble-test-minimal
|
| 153 |
+
|
| 154 |
+
# Dentro da VM:
|
| 155 |
+
cd ensemble-tts-annotation
|
| 156 |
+
python3 scripts/test/test_end_to_end.py
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
### "Git clone failed"
|
| 160 |
+
|
| 161 |
+
Pode ser problema de rede. Tente novamente:
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
sky down ensemble-test-minimal
|
| 165 |
+
sky launch scripts/cloud/skypilot_test_minimal.yaml
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
---
|
| 169 |
+
|
| 170 |
+
## π§Ή Cleanup
|
| 171 |
+
|
| 172 |
+
```bash
|
| 173 |
+
# Parar instΓ’ncia (mantΓ©m dados)
|
| 174 |
+
sky stop ensemble-test-minimal
|
| 175 |
+
|
| 176 |
+
# Deletar completamente
|
| 177 |
+
sky down ensemble-test-minimal
|
| 178 |
+
|
| 179 |
+
# Verificar que foi deletada
|
| 180 |
+
sky status
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
**IMPORTANTE**: Sempre faΓ§a cleanup para nΓ£o acumular custos!
|
| 184 |
+
|
| 185 |
+
---
|
| 186 |
+
|
| 187 |
+
## π Depois do Teste
|
| 188 |
+
|
| 189 |
+
### Se Passou β
|
| 190 |
+
|
| 191 |
+
VocΓͺ pode rodar com confianΓ§a:
|
| 192 |
+
|
| 193 |
+
```bash
|
| 194 |
+
# Fine-tuning completo (~30min, ~$1)
|
| 195 |
+
sky launch scripts/cloud/skypilot_finetune.yaml
|
| 196 |
+
|
| 197 |
+
# Multi-GPU (~15min, ~$3)
|
| 198 |
+
sky launch scripts/cloud/skypilot_multi_gpu.yaml
|
| 199 |
+
|
| 200 |
+
# Annotation (~3-4h, ~$12)
|
| 201 |
+
sky launch scripts/cloud/skypilot_annotate_orpheus.yaml
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
### Se Falhou β
|
| 205 |
+
|
| 206 |
+
1. Verifique os logs: `sky logs ensemble-test-minimal`
|
| 207 |
+
2. Tente outro cloud: `--cloud aws` ou `--cloud azure`
|
| 208 |
+
3. Use CPU se nΓ£o tem quota de GPU
|
| 209 |
+
4. Reporte o erro com logs completos
|
| 210 |
+
|
| 211 |
+
---
|
| 212 |
+
|
| 213 |
+
## π― DiferenΓ§as: Teste Local vs Teste Real
|
| 214 |
+
|
| 215 |
+
| Aspecto | Teste Local | Teste SkyPilot Real |
|
| 216 |
+
|---------|-------------|---------------------|
|
| 217 |
+
| **Custo** | $0 | ~$0.10 |
|
| 218 |
+
| **DuraΓ§Γ£o** | 16s | 5min |
|
| 219 |
+
| **Provisioning** | β NΓ£o testa | β
Testa |
|
| 220 |
+
| **Cloud setup** | β NΓ£o testa | β
Testa |
|
| 221 |
+
| **Internet** | β
Usa local | β
Testa VM |
|
| 222 |
+
| **Dependencies** | β
JΓ‘ instaladas | β
Instala do zero |
|
| 223 |
+
| **GPU** | β NΓ£o testa | β
Testa (se disponΓvel) |
|
| 224 |
+
| **Custo real** | β NΓ£o valida | β
Valida |
|
| 225 |
+
|
| 226 |
+
---
|
| 227 |
+
|
| 228 |
+
## π‘ Por Que Fazer Este Teste?
|
| 229 |
+
|
| 230 |
+
1. **Valida SkyPilot estΓ‘ configurado** corretamente
|
| 231 |
+
2. **Testa sua quota** de GPU spot
|
| 232 |
+
3. **Confirma custo real** antes de gastar $12+ em annotation
|
| 233 |
+
4. **Identifica problemas** de rede/permissions/quota
|
| 234 |
+
5. **DΓ‘ confianΓ§a** para rodar tarefas mais caras
|
| 235 |
+
|
| 236 |
+
---
|
| 237 |
+
|
| 238 |
+
## π Comandos Completos (Copy-Paste)
|
| 239 |
+
|
| 240 |
+
### Setup Inicial (primeira vez):
|
| 241 |
+
|
| 242 |
+
```bash
|
| 243 |
+
# Instalar
|
| 244 |
+
pip install "skypilot[gcp,aws]"
|
| 245 |
+
|
| 246 |
+
# Configurar GCP (se for usar GCP)
|
| 247 |
+
gcloud auth login
|
| 248 |
+
gcloud config set project SEU_PROJECT_ID
|
| 249 |
+
|
| 250 |
+
# Verificar
|
| 251 |
+
sky check
|
| 252 |
+
```
|
| 253 |
+
|
| 254 |
+
### Rodar Teste:
|
| 255 |
+
|
| 256 |
+
```bash
|
| 257 |
+
# Commitar (se ainda nΓ£o fez)
|
| 258 |
+
git add -A
|
| 259 |
+
git commit -m "Add SkyPilot real test"
|
| 260 |
+
git push
|
| 261 |
+
|
| 262 |
+
# LanΓ§ar
|
| 263 |
+
sky launch scripts/cloud/skypilot_test_minimal.yaml
|
| 264 |
+
|
| 265 |
+
# Monitorar
|
| 266 |
+
sky logs ensemble-test-minimal -f
|
| 267 |
+
|
| 268 |
+
# Cleanup
|
| 269 |
+
sky down ensemble-test-minimal
|
| 270 |
+
```
|
| 271 |
+
|
| 272 |
+
### Se Deu Erro:
|
| 273 |
+
|
| 274 |
+
```bash
|
| 275 |
+
# Ver logs
|
| 276 |
+
sky logs ensemble-test-minimal
|
| 277 |
+
|
| 278 |
+
# Tentar outro cloud
|
| 279 |
+
sky launch --cloud aws scripts/cloud/skypilot_test_minimal.yaml
|
| 280 |
+
|
| 281 |
+
# Ver status
|
| 282 |
+
sky status
|
| 283 |
+
|
| 284 |
+
# ForΓ§ar cleanup
|
| 285 |
+
sky down -a
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
---
|
| 289 |
+
|
| 290 |
+
## β
Checklist
|
| 291 |
+
|
| 292 |
+
Antes de rodar teste real:
|
| 293 |
+
|
| 294 |
+
- [ ] SkyPilot instalado (`pip install "skypilot[gcp,aws]"`)
|
| 295 |
+
- [ ] Pelo menos 1 cloud configurado (`sky check`)
|
| 296 |
+
- [ ] Quota disponΓvel (GPU spot ou CPU)
|
| 297 |
+
- [ ] Arquivo commitado no repositΓ³rio
|
| 298 |
+
- [ ] Pronto para gastar ~$0.10
|
| 299 |
+
|
| 300 |
+
Depois do teste:
|
| 301 |
+
|
| 302 |
+
- [ ] Teste passou (ALL TESTS PASSED)
|
| 303 |
+
- [ ] Cleanup feito (`sky down ensemble-test-minimal`)
|
| 304 |
+
- [ ] Custo verificado (`sky cost-report`)
|
| 305 |
+
- [ ] Pronto para prΓ³xima etapa!
|
| 306 |
+
|
| 307 |
+
---
|
| 308 |
+
|
| 309 |
+
## π Pronto?
|
| 310 |
+
|
| 311 |
+
```bash
|
| 312 |
+
sky launch scripts/cloud/skypilot_test_minimal.yaml
|
| 313 |
+
```
|
| 314 |
+
|
| 315 |
+
**Este comando vai realmente provisionar uma mΓ‘quina e validar tudo!** π
|
| 316 |
+
|
| 317 |
+
---
|
| 318 |
+
|
| 319 |
+
**ApΓ³s este teste passar, vocΓͺ tem 100% de certeza que o sistema funciona na nuvem!** β
|
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Minimal SkyPilot test - validates cloud provisioning works
|
| 2 |
+
# Cost: ~$0.10 for 5 minutes
|
| 3 |
+
# This actually provisions a machine and tests the setup
|
| 4 |
+
|
| 5 |
+
name: ensemble-test-minimal
|
| 6 |
+
|
| 7 |
+
resources:
|
| 8 |
+
use_spot: true
|
| 9 |
+
|
| 10 |
+
# Use cheapest GPU available (or CPU if no GPU quota)
|
| 11 |
+
accelerators: {L4:1, T4:1, V100:1} # Try L4 first (cheapest)
|
| 12 |
+
# If no GPU quota, comment above and use CPU:
|
| 13 |
+
# cpus: 2+
|
| 14 |
+
|
| 15 |
+
memory: 8+
|
| 16 |
+
disk_size: 50
|
| 17 |
+
|
| 18 |
+
setup: |
|
| 19 |
+
set -e
|
| 20 |
+
|
| 21 |
+
echo "=================================================="
|
| 22 |
+
echo "π§ͺ SKYPILOT MINIMAL TEST"
|
| 23 |
+
echo "=================================================="
|
| 24 |
+
echo ""
|
| 25 |
+
echo "Testing:"
|
| 26 |
+
echo " 1. Machine provisioning β"
|
| 27 |
+
echo " 2. Internet connectivity"
|
| 28 |
+
echo " 3. Python environment"
|
| 29 |
+
echo " 4. Git clone"
|
| 30 |
+
echo " 5. Dependencies install"
|
| 31 |
+
echo " 6. Repository structure"
|
| 32 |
+
echo ""
|
| 33 |
+
|
| 34 |
+
# Test 1: Machine info
|
| 35 |
+
echo "π Machine Info:"
|
| 36 |
+
echo " Hostname: $(hostname)"
|
| 37 |
+
echo " CPU cores: $(nproc)"
|
| 38 |
+
echo " Memory: $(free -h | grep Mem | awk '{print $2}')"
|
| 39 |
+
echo " Disk: $(df -h / | tail -1 | awk '{print $2}')"
|
| 40 |
+
|
| 41 |
+
# Check GPU (if available)
|
| 42 |
+
if command -v nvidia-smi &> /dev/null; then
|
| 43 |
+
echo " GPU: $(nvidia-smi --query-gpu=name --format=csv,noheader)"
|
| 44 |
+
else
|
| 45 |
+
echo " GPU: None (CPU-only)"
|
| 46 |
+
fi
|
| 47 |
+
echo ""
|
| 48 |
+
|
| 49 |
+
# Test 2: Internet
|
| 50 |
+
echo "π Testing internet connectivity..."
|
| 51 |
+
curl -s -o /dev/null -w " HTTP Status: %{http_code}\n" https://huggingface.co/
|
| 52 |
+
echo ""
|
| 53 |
+
|
| 54 |
+
# Test 3: Python
|
| 55 |
+
echo "π Python environment:"
|
| 56 |
+
python3 --version
|
| 57 |
+
pip3 --version
|
| 58 |
+
echo ""
|
| 59 |
+
|
| 60 |
+
# Test 4: Install minimal dependencies
|
| 61 |
+
echo "π¦ Installing minimal dependencies..."
|
| 62 |
+
pip install -q numpy soundfile librosa
|
| 63 |
+
echo " β numpy, soundfile, librosa installed"
|
| 64 |
+
echo ""
|
| 65 |
+
|
| 66 |
+
# Test 5: Git clone
|
| 67 |
+
echo "π₯ Cloning repository..."
|
| 68 |
+
if [ ! -d "ensemble-tts-annotation" ]; then
|
| 69 |
+
git clone -q https://huggingface.co/marcosremar2/ensemble-tts-annotation
|
| 70 |
+
echo " β Repository cloned"
|
| 71 |
+
else
|
| 72 |
+
echo " β Repository already exists"
|
| 73 |
+
fi
|
| 74 |
+
echo ""
|
| 75 |
+
|
| 76 |
+
echo "β
Setup complete!"
|
| 77 |
+
|
| 78 |
+
run: |
|
| 79 |
+
cd ensemble-tts-annotation
|
| 80 |
+
|
| 81 |
+
echo ""
|
| 82 |
+
echo "=================================================="
|
| 83 |
+
echo "π§ͺ RUNNING VALIDATION TESTS"
|
| 84 |
+
echo "=================================================="
|
| 85 |
+
echo ""
|
| 86 |
+
|
| 87 |
+
# Test 6: Repository structure
|
| 88 |
+
echo "π Validating repository structure..."
|
| 89 |
+
|
| 90 |
+
REQUIRED_FILES=(
|
| 91 |
+
"README.md"
|
| 92 |
+
"QUICK_START_SKYPILOT.md"
|
| 93 |
+
"scripts/cloud/skypilot_finetune.yaml"
|
| 94 |
+
"scripts/data/create_synthetic_test_data.py"
|
| 95 |
+
"scripts/test/test_end_to_end.py"
|
| 96 |
+
"ensemble_tts/__init__.py"
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
ALL_FOUND=true
|
| 100 |
+
for file in "${REQUIRED_FILES[@]}"; do
|
| 101 |
+
if [ -f "$file" ]; then
|
| 102 |
+
echo " β $file"
|
| 103 |
+
else
|
| 104 |
+
echo " β $file NOT FOUND"
|
| 105 |
+
ALL_FOUND=false
|
| 106 |
+
fi
|
| 107 |
+
done
|
| 108 |
+
echo ""
|
| 109 |
+
|
| 110 |
+
if [ "$ALL_FOUND" = false ]; then
|
| 111 |
+
echo "β Some files missing!"
|
| 112 |
+
exit 1
|
| 113 |
+
fi
|
| 114 |
+
|
| 115 |
+
# Test 7: Python imports
|
| 116 |
+
echo "π Testing Python imports..."
|
| 117 |
+
python3 -c "
|
| 118 |
+
import sys
|
| 119 |
+
import numpy as np
|
| 120 |
+
import soundfile as sf
|
| 121 |
+
import librosa
|
| 122 |
+
|
| 123 |
+
print(' β numpy:', np.__version__)
|
| 124 |
+
print(' β soundfile:', sf.__version__)
|
| 125 |
+
print(' β librosa:', librosa.__version__)
|
| 126 |
+
|
| 127 |
+
# Test basic functionality
|
| 128 |
+
audio = np.random.randn(16000)
|
| 129 |
+
print(' β numpy array creation works')
|
| 130 |
+
|
| 131 |
+
# Test librosa
|
| 132 |
+
rms = librosa.feature.rms(y=audio)[0].mean()
|
| 133 |
+
print(f' β librosa feature extraction works (RMS: {rms:.4f})')
|
| 134 |
+
"
|
| 135 |
+
echo ""
|
| 136 |
+
|
| 137 |
+
# Test 8: Synthetic data generation (1 sample)
|
| 138 |
+
echo "π΅ Testing synthetic data generation..."
|
| 139 |
+
python3 scripts/data/create_synthetic_test_data.py \
|
| 140 |
+
--output test_data_tmp \
|
| 141 |
+
--samples 1
|
| 142 |
+
|
| 143 |
+
# Check if files created
|
| 144 |
+
AUDIO_COUNT=$(find test_data_tmp -name "*.wav" | wc -l)
|
| 145 |
+
echo " β Created $AUDIO_COUNT audio files"
|
| 146 |
+
|
| 147 |
+
if [ "$AUDIO_COUNT" -ne 7 ]; then
|
| 148 |
+
echo " β Expected 7 files, got $AUDIO_COUNT"
|
| 149 |
+
exit 1
|
| 150 |
+
fi
|
| 151 |
+
|
| 152 |
+
# Test audio loading
|
| 153 |
+
FIRST_AUDIO=$(find test_data_tmp -name "*.wav" | head -1)
|
| 154 |
+
python3 -c "
|
| 155 |
+
import soundfile as sf
|
| 156 |
+
import librosa
|
| 157 |
+
|
| 158 |
+
audio, sr = sf.read('$FIRST_AUDIO')
|
| 159 |
+
print(f' β Audio loading works: {len(audio)/sr:.1f}s @ {sr}Hz')
|
| 160 |
+
|
| 161 |
+
rms = librosa.feature.rms(y=audio)[0].mean()
|
| 162 |
+
print(f' β Feature extraction: RMS={rms:.4f}')
|
| 163 |
+
"
|
| 164 |
+
echo ""
|
| 165 |
+
|
| 166 |
+
# Test 9: Voting system
|
| 167 |
+
echo "π³οΈ Testing ensemble voting..."
|
| 168 |
+
python3 -c "
|
| 169 |
+
import sys
|
| 170 |
+
sys.path.insert(0, '.')
|
| 171 |
+
|
| 172 |
+
from ensemble_tts.voting import WeightedVoting
|
| 173 |
+
|
| 174 |
+
predictions = [
|
| 175 |
+
{'label': 'happy', 'confidence': 0.85, 'model_name': 'model1', 'model_weight': 0.5},
|
| 176 |
+
{'label': 'happy', 'confidence': 0.75, 'model_name': 'model2', 'model_weight': 0.3},
|
| 177 |
+
{'label': 'neutral', 'confidence': 0.65, 'model_name': 'model3', 'model_weight': 0.2},
|
| 178 |
+
]
|
| 179 |
+
|
| 180 |
+
voter = WeightedVoting()
|
| 181 |
+
result = voter.vote(predictions, key='label')
|
| 182 |
+
|
| 183 |
+
print(f' β Voting works: {result[\"label\"]} ({result[\"confidence\"]:.2%})')
|
| 184 |
+
"
|
| 185 |
+
echo ""
|
| 186 |
+
|
| 187 |
+
# Cleanup
|
| 188 |
+
rm -rf test_data_tmp
|
| 189 |
+
|
| 190 |
+
echo "=================================================="
|
| 191 |
+
echo "β
ALL TESTS PASSED!"
|
| 192 |
+
echo "=================================================="
|
| 193 |
+
echo ""
|
| 194 |
+
echo "π Summary:"
|
| 195 |
+
echo " β Machine provisioned successfully"
|
| 196 |
+
echo " β Internet connectivity working"
|
| 197 |
+
echo " β Python environment functional"
|
| 198 |
+
echo " β Repository cloned and validated"
|
| 199 |
+
echo " β Dependencies installed"
|
| 200 |
+
echo " β Synthetic data generation works"
|
| 201 |
+
echo " β Audio processing works"
|
| 202 |
+
echo " β Ensemble voting works"
|
| 203 |
+
echo ""
|
| 204 |
+
echo "π SkyPilot infrastructure validated!"
|
| 205 |
+
echo ""
|
| 206 |
+
echo "π° Cost: ~$0.10 for this test (5 minutes)"
|
| 207 |
+
echo ""
|
| 208 |
+
echo "π Next steps:"
|
| 209 |
+
echo " 1. Fine-tune: sky launch scripts/cloud/skypilot_finetune.yaml"
|
| 210 |
+
echo " 2. Multi-GPU: sky launch scripts/cloud/skypilot_multi_gpu.yaml"
|
| 211 |
+
echo " 3. Annotate: sky launch scripts/cloud/skypilot_annotate_orpheus.yaml"
|
| 212 |
+
echo ""
|
| 213 |
+
|
| 214 |
+
num_nodes: 1
|