Limpa dependências versionadas e reconstrói catálogo com 20 projetos
Deploy / Deploy (push) Successful in 29s
Deploy / Deploy (push) Successful in 29s
This commit is contained in:
1 parent
95810ce994
commit
57af93ea60
319 files changed
+155566
-1328045
No files matched your search
@@ -48,14 +48,19 @@ essentia.log.info.active = False
|
||||
essentia.log.warning.active = False
|
||||
|
||||
# ================= CONFIGURAÇÕES =================
|
||||
BASE_DIR = "/var/www/html/trens/src_mmpSearch"
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from etl_settings import DATA_ROOT, MODELS_ROOT, worker_count
|
||||
|
||||
BASE_DIR = str(DATA_ROOT)
|
||||
PASTA_WAVS = os.path.join(BASE_DIR, "wav")
|
||||
PASTA_LOTES_YAML = os.path.join(BASE_DIR, "lotes_yaml")
|
||||
|
||||
# --- SISTEMA DE DOIS MODELOS ---
|
||||
MODELO_EMBEDDING = "discogs-effnet-bs64-1.pb"
|
||||
MODELO_CLASSIFIER = "genre_discogs400.pb"
|
||||
MODELO_CLASSES = "genre_discogs400.json"
|
||||
MODELO_EMBEDDING = str(MODELS_ROOT / "discogs-effnet-bs64-1.pb")
|
||||
MODELO_CLASSIFIER = str(MODELS_ROOT / "genre_discogs400.pb")
|
||||
MODELO_CLASSES = str(MODELS_ROOT / "genre_discogs400.json")
|
||||
|
||||
# Saídas
|
||||
DIR_SAIDA = os.path.join(BASE_DIR, "saida_analises")
|
||||
@@ -516,9 +521,9 @@ def analisar_faixa(caminho_arquivo, embedding_model, classifier_model, classes_r
|
||||
except Exception as e:
|
||||
msg = f"Erro IA Pipeline: {str(e)}"
|
||||
logging.error(msg)
|
||||
metadata["analise_ia"] = {"erro": msg}
|
||||
raise RuntimeError(msg) from e
|
||||
else:
|
||||
metadata["analise_ia"] = {"status": "Modelos nao carregados"}
|
||||
raise RuntimeError("Modelos de IA nao inicializados no worker.")
|
||||
|
||||
# Limpeza Limpa
|
||||
del audio_hq
|
||||
@@ -530,35 +535,10 @@ def analisar_faixa(caminho_arquivo, embedding_model, classifier_model, classes_r
|
||||
|
||||
|
||||
# ================= MAIN (Multiprocessing) =================
|
||||
def worker_analise(caminho):
|
||||
# Processa usando as instâncias dos modelos carregadas na thread mestre
|
||||
global GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES
|
||||
return analisar_faixa(caminho, GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES)
|
||||
|
||||
|
||||
def main():
|
||||
print("\n--- INICIANDO PROCESSADOR + AUDITORIA ---")
|
||||
|
||||
# Referencia variávies globais do script para alimentar os childs process do pool
|
||||
def initialize_analysis_worker():
|
||||
# Cada processo cria suas proprias sessoes TensorFlow.
|
||||
global DATABASE_YAML, GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES
|
||||
|
||||
DATABASE_YAML = carregar_database_yaml()
|
||||
|
||||
ja_processados, lista_resultados = carregar_checkpoint()
|
||||
|
||||
auditor = Auditoria(ARQUIVO_AUDITORIA)
|
||||
|
||||
if not os.path.exists(PASTA_WAVS):
|
||||
print("CRÍTICO: Pasta WAV não encontrada!")
|
||||
return
|
||||
|
||||
todos = [f for f in os.listdir(PASTA_WAVS) if f.lower().endswith((".wav", ".ogg"))]
|
||||
a_fazer = [os.path.join(PASTA_WAVS, f) for f in todos if f not in ja_processados]
|
||||
|
||||
total = len(a_fazer)
|
||||
print(f"Total Arquivos: {len(todos)} | Novos a Fazer: {total}")
|
||||
print(f"Auditoria será salva em: {ARQUIVO_AUDITORIA}")
|
||||
|
||||
# === CARREGAMENTO MODELOS GLOBAIS ===
|
||||
path_embed = (
|
||||
MODELO_EMBEDDING
|
||||
@@ -608,24 +588,61 @@ def main():
|
||||
print("[2/2] Classificador de Gênero carregado.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"ERRO CRÍTICO AO CARREGAR IA: {e}")
|
||||
return
|
||||
raise RuntimeError("Falha ao carregar modelos de IA") from e
|
||||
else:
|
||||
print("Arquivos de modelo incompletos.")
|
||||
return
|
||||
raise FileNotFoundError("Arquivos de modelo incompletos.")
|
||||
|
||||
|
||||
|
||||
def worker_analise(caminho):
|
||||
# Modelos inicializados neste processo, sem herdar sessoes via fork.
|
||||
print(f"[PID {os.getpid()}] Iniciando analise: {os.path.basename(caminho)}", flush=True)
|
||||
global GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES
|
||||
result = analisar_faixa(caminho, GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES)
|
||||
print(f"[PID {os.getpid()}] Finalizou analise: {os.path.basename(caminho)}", flush=True)
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
print("\n--- INICIANDO PROCESSADOR + AUDITORIA ---")
|
||||
|
||||
# Referencia variávies globais do script para alimentar os childs process do pool
|
||||
global DATABASE_YAML, GLOBAL_EMBEDDING, GLOBAL_CLASSIFIER, GLOBAL_CLASSES
|
||||
|
||||
DATABASE_YAML = carregar_database_yaml()
|
||||
|
||||
ja_processados, lista_resultados = carregar_checkpoint()
|
||||
|
||||
auditor = Auditoria(ARQUIVO_AUDITORIA)
|
||||
|
||||
if not os.path.exists(PASTA_WAVS):
|
||||
raise RuntimeError("Pasta de audio nao encontrada.")
|
||||
|
||||
todos = [f for f in os.listdir(PASTA_WAVS) if f.lower().endswith((".wav", ".ogg"))]
|
||||
a_fazer = [os.path.join(PASTA_WAVS, f) for f in todos if f not in ja_processados]
|
||||
|
||||
total = len(a_fazer)
|
||||
print(f"Total Arquivos: {len(todos)} | Novos a Fazer: {total}")
|
||||
print(f"Auditoria será salva em: {ARQUIVO_AUDITORIA}")
|
||||
|
||||
if total == 0:
|
||||
print("Tudo atualizado.")
|
||||
print("Nenhum audio novo; reconstruindo o consolidado do checkpoint.")
|
||||
if not lista_resultados:
|
||||
raise RuntimeError("Nao ha audios nem resultados no checkpoint.")
|
||||
with open(ARQUIVO_FINAL_JSON, "w", encoding="utf-8") as f:
|
||||
json.dump(lista_resultados, f, indent=4, ensure_ascii=False)
|
||||
return
|
||||
|
||||
# ProcessPoolExecutor lidará com N filas ao mesmo tempo
|
||||
max_workers = max(1, multiprocessing.cpu_count() - 1)
|
||||
max_workers = worker_count()
|
||||
print(f"-> Iniciando processamento paralelo com {max_workers} workers.")
|
||||
contagem_sessao = 0
|
||||
|
||||
try:
|
||||
with concurrent.futures.ProcessPoolExecutor(
|
||||
max_workers=max_workers
|
||||
max_workers=max_workers,
|
||||
mp_context=multiprocessing.get_context("spawn"),
|
||||
initializer=initialize_analysis_worker,
|
||||
) as executor:
|
||||
resultados_futuros = {
|
||||
executor.submit(worker_analise, caminho): caminho for caminho in a_fazer
|
||||
@@ -657,7 +674,7 @@ def main():
|
||||
logging.error(f"Erro ao processar um dos arquivos no worker: {e}")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\nParando paralelismo graciosamente...")
|
||||
raise RuntimeError("Analise interrompida pelo operador.")
|
||||
|
||||
finally:
|
||||
auditor.fechar() # Fecha o CSV com segurança
|
||||
@@ -670,6 +687,12 @@ def main():
|
||||
with open(ARQUIVO_FINAL_JSON, "w", encoding="utf-8") as f:
|
||||
json.dump(lista_resultados, f, indent=4, ensure_ascii=False)
|
||||
|
||||
expected = {os.path.basename(path) for path in a_fazer}
|
||||
obtained = {item.get("arquivo") for item in lista_resultados}
|
||||
missing = expected - obtained
|
||||
if missing:
|
||||
raise RuntimeError(f"Analises ausentes para {len(missing)} audios: {sorted(missing)}")
|
||||
|
||||
print(f"Dados JSON: {ARQUIVO_FINAL_JSON}")
|
||||
print(f"Auditoria CSV: {ARQUIVO_AUDITORIA}")
|
||||
|
||||
|
||||
@@ -10,7 +10,12 @@ import glob # Import necessário para ler múltiplos arquivos
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# --- CONFIGURAÇÕES GERAIS ---
|
||||
BASE_DIR = "/var/www/html/trens/src_mmpSearch"
|
||||
import sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from etl_settings import DATA_ROOT, MODELS_ROOT, worker_count
|
||||
|
||||
BASE_DIR = str(DATA_ROOT)
|
||||
LOG_DIR = os.path.join(BASE_DIR, "logs/classificacao_pedagogica")
|
||||
os.makedirs(LOG_DIR, exist_ok=True)
|
||||
TIMESTAMP = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
@@ -264,8 +269,7 @@ def main():
|
||||
dados_projetos = carregar_todos_yamls(PASTA_LOTES_YAML)
|
||||
|
||||
if not dados_projetos:
|
||||
logging.critical("Nenhum dado de projeto carregado. Encerrando.")
|
||||
return
|
||||
raise RuntimeError("Nenhum dado de projeto carregado.")
|
||||
|
||||
# 2. Carregar JSON de Áudio
|
||||
lookup_audio = {}
|
||||
@@ -275,13 +279,15 @@ def main():
|
||||
logging.info(f"Lendo Análise de Áudio: {ARQUIVO_AUDIO_INPUT}")
|
||||
with open(ARQUIVO_AUDIO_INPUT, "r", encoding="utf-8") as f:
|
||||
lista_audio = json.load(f)
|
||||
if not lista_audio:
|
||||
raise RuntimeError("Analise de audio vazia.")
|
||||
for item in lista_audio:
|
||||
chave = normalizar_chave(item.get("arquivo", ""))
|
||||
if chave:
|
||||
lookup_audio[chave] = item
|
||||
total_audio_carregado = len(lista_audio)
|
||||
else:
|
||||
logging.warning(f"Arquivo de áudio {ARQUIVO_AUDIO_INPUT} não encontrado.")
|
||||
raise FileNotFoundError(f"Analise de audio ausente: {ARQUIVO_AUDIO_INPUT}")
|
||||
|
||||
db_final = []
|
||||
estatisticas = {"Iniciante": 0, "Intermediário": 0, "Avançado": 0, "Total": 0}
|
||||
@@ -434,6 +440,9 @@ def main():
|
||||
)
|
||||
continue
|
||||
|
||||
if len(db_final) != len(dados_projetos):
|
||||
raise RuntimeError("Classificacao incompleta; consulte o log.")
|
||||
|
||||
# Salvar Resultado JSON
|
||||
logging.info(f"Salvando JSON Final: {ARQUIVO_FINAL_OUTPUT}")
|
||||
with open(ARQUIVO_FINAL_OUTPUT, "w", encoding="utf-8") as f:
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
"""Configuracao compartilhada do ETL; caminhos relativos ao codigo em uso."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
REPO_ROOT = Path(os.environ.get("MMPSEARCH_REPO_ROOT", Path(__file__).resolve().parents[1])).resolve()
|
||||
DATA_ROOT = Path(os.environ.get("MMPSEARCH_DATA_ROOT", "/var/www/html/trens/src_mmpSearch")).resolve()
|
||||
MODELS_ROOT = Path(os.environ.get("MMPSEARCH_MODELS_ROOT", REPO_ROOT / "scripts" / "classificacao")).resolve()
|
||||
|
||||
def worker_count():
|
||||
requested = int(os.environ.get("MMPSEARCH_WORKERS", "2"))
|
||||
if requested < 1:
|
||||
raise ValueError("MMPSEARCH_WORKERS deve ser positivo.")
|
||||
return min(requested, max(1, (os.cpu_count() or 1) - 1))
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21
-16
@@ -35,12 +35,14 @@ from utils import (
|
||||
SAIDA_ANALISES,
|
||||
)
|
||||
|
||||
from etl_settings import worker_count
|
||||
|
||||
# === CONFIGURAÇÕES DE SEGURANÇA E LOTES ===
|
||||
TIMEOUT_RENDER_SECONDS = 300 # 5 minutos máximo por arquivo
|
||||
MIN_RAM_FREE_MB = 500 # Mínimo de RAM livre para iniciar worker
|
||||
BATCH_SIZE = 250 # Tamanho do lote para o YAML
|
||||
LOTES_FOLDER = os.path.join(SRC_MMPSEARCH, "lotes_yaml") # Pasta dos lotes
|
||||
LIMIT_FILES = 300 # <--- 0 = PROCESSA TUDO | >0 = LIMITA A QUANTIDADE (EX: 50)
|
||||
LIMIT_FILES = int(os.environ.get("MMPSEARCH_LIMIT_FILES", "0")) # <--- 0 = PROCESSA TUDO | >0 = LIMITA A QUANTIDADE (EX: 50)
|
||||
|
||||
# === VARIÁVEL GLOBAL PARA O WORKER (CORREÇÃO MULTIPROCESSING) ===
|
||||
# Necessário para evitar erro de pickle ao passar Lock via argumentos
|
||||
@@ -140,11 +142,7 @@ def check_system_dependencies():
|
||||
|
||||
def get_cpu_safe_count():
|
||||
"""Retorna contagem de CPU menos 1 para não travar o SO."""
|
||||
try:
|
||||
count = multiprocessing.cpu_count()
|
||||
return max(1, count - 1)
|
||||
except:
|
||||
return 1
|
||||
return worker_count()
|
||||
|
||||
|
||||
# --- Funções de Info de Sistema ---
|
||||
@@ -296,7 +294,7 @@ def process_single_file(args):
|
||||
stderr=subprocess.PIPE,
|
||||
check=True,
|
||||
timeout=60,
|
||||
env={"QT_QPA_PLATFORM": "offscreen", **os.environ},
|
||||
env={**os.environ, "QT_QPA_PLATFORM": "offscreen"},
|
||||
)
|
||||
target_mmp_path = output_mmp_path
|
||||
|
||||
@@ -314,7 +312,7 @@ def process_single_file(args):
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=TIMEOUT_RENDER_SECONDS,
|
||||
env={"QT_QPA_PLATFORM": "offscreen", **os.environ},
|
||||
env={**os.environ, "QT_QPA_PLATFORM": "offscreen"},
|
||||
)
|
||||
|
||||
if render_process.returncode != 0:
|
||||
@@ -430,7 +428,7 @@ def main_parallel():
|
||||
|
||||
# Cria pastas (incluindo a de Lotes)
|
||||
create_folders_if_not_exist(
|
||||
[MMPZ_FOLDER, WAV_FOLDER, METADATA_FOLDER, DATA_FOLDER, LOTES_FOLDER]
|
||||
[MMPZ_FOLDER, WAV_FOLDER, METADATA_FOLDER, DATA_FOLDER, LOTES_FOLDER, SAIDA_ANALISES]
|
||||
)
|
||||
|
||||
logging.info(
|
||||
@@ -438,14 +436,12 @@ def main_parallel():
|
||||
)
|
||||
|
||||
if not os.path.exists(MMP_FOLDER):
|
||||
logging.critical(f"Pasta {MMP_FOLDER} não encontrada.")
|
||||
return
|
||||
raise RuntimeError(f"Pasta {MMP_FOLDER} nao encontrada.")
|
||||
|
||||
all_files_raw = [f for f in os.listdir(MMP_FOLDER) if f.endswith((".mmp", ".mmpz"))]
|
||||
all_files_raw = sorted(f for f in os.listdir(MMP_FOLDER) if f.endswith((".mmp", ".mmpz")))
|
||||
|
||||
if not all_files_raw:
|
||||
logging.warning("Nenhum arquivo encontrado.")
|
||||
return
|
||||
raise RuntimeError("Nenhum projeto encontrado para processar.")
|
||||
|
||||
# === APLICAÇÃO DO LIMITE DE ARQUIVOS (ALTERAÇÃO AQUI) ===
|
||||
if LIMIT_FILES and LIMIT_FILES > 0:
|
||||
@@ -537,6 +533,9 @@ def main_parallel():
|
||||
failed_files.append(res)
|
||||
|
||||
# === SALVAMENTO EM LOTES (BATCHING) ===
|
||||
if not successful_data:
|
||||
raise RuntimeError("Nenhum projeto processado com sucesso; ETL interrompido.")
|
||||
|
||||
if successful_data:
|
||||
logging.info(f"Total processado com sucesso: {len(successful_data)}")
|
||||
logging.info(f"Iniciando gravação em lotes (Batch Size: {BATCH_SIZE})...")
|
||||
@@ -579,6 +578,9 @@ def main_parallel():
|
||||
except Exception as e:
|
||||
manifest_report = {"generated": [], "failed": [str(e)]}
|
||||
|
||||
if manifest_report["failed"]:
|
||||
raise RuntimeError(f"Falha nos manifestos: {manifest_report['failed']}")
|
||||
|
||||
duration = time.time() - start_time_global
|
||||
logging.info("=" * 60)
|
||||
logging.info(
|
||||
@@ -597,8 +599,11 @@ def main_parallel():
|
||||
os.path.join(METADATA_FOLDER, "samples-manifest.json"),
|
||||
os.path.join(METADATA_FOLDER, "dependency_report.json"),
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as error:
|
||||
raise RuntimeError("Falha na verificacao de dependencias") from error
|
||||
|
||||
if failed_files and os.environ.get("MMPSEARCH_ALLOW_PARTIAL", "0") != "1":
|
||||
raise RuntimeError(f"{len(failed_files)} projetos falharam. Revise o CSV antes de permitir resultados parciais.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+15
-10
@@ -1,21 +1,26 @@
|
||||
# utils.py
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from etl_settings import REPO_ROOT, DATA_ROOT
|
||||
|
||||
BASE_PATH = "/var/www/html/trens"
|
||||
BASE_PATH_MMPSEARCH = "/var/www/html/trens/mmpSearch"
|
||||
BASE_DATA = "/nethome/jotachina/projetos/mmpSearch"
|
||||
SRC_MMPSEARCH = "/var/www/html/trens/src_mmpSearch"
|
||||
BASE_DATA = str(REPO_ROOT)
|
||||
SRC_MMPSEARCH = str(DATA_ROOT)
|
||||
|
||||
SAIDA_ANALISES = os.path.join(SRC_MMPSEARCH, "saida_analises")
|
||||
MMP_FOLDER = os.path.join(BASE_PATH, "src_mmpSearch", "mmp")
|
||||
MMPZ_FOLDER = os.path.join(BASE_PATH, "src_mmpSearch", "mmpz")
|
||||
WAV_FOLDER = os.path.join(BASE_PATH, "src_mmpSearch", "wav")
|
||||
METADATA_FOLDER = os.path.join(BASE_PATH, "src_mmpSearch", "metadata")
|
||||
SAMPLE_MANIFEST = os.path.join(BASE_PATH, "src_mmpSearch", "metadata", "samples-manifest.json")
|
||||
MMP_FOLDER = os.path.join(SRC_MMPSEARCH, "mmp")
|
||||
MMPZ_FOLDER = os.path.join(SRC_MMPSEARCH, "mmpz")
|
||||
WAV_FOLDER = os.path.join(SRC_MMPSEARCH, "wav")
|
||||
METADATA_FOLDER = os.path.join(SRC_MMPSEARCH, "metadata")
|
||||
SAMPLE_MANIFEST = os.path.join(SRC_MMPSEARCH, "metadata", "samples-manifest.json")
|
||||
SAMPLE_SRC = os.path.join(SRC_MMPSEARCH, "samples")
|
||||
MMP_MANIFEST = os.path.join(BASE_PATH, "src_mmpSearch", "metadata", "mmp-manifest.json")
|
||||
DATA_FOLDER = os.path.join(BASE_DATA, "_data")
|
||||
MMP_MANIFEST = os.path.join(SRC_MMPSEARCH, "metadata", "mmp-manifest.json")
|
||||
DATA_FOLDER = os.environ.get("MMPSEARCH_SITE_DATA_ROOT", os.path.join(BASE_DATA, "_data"))
|
||||
XML_IMPORTED_PATH_PREFIX = os.path.join(SAMPLE_SRC, "imported")
|
||||
SAMPLE_MANIFEST_DATA = os.path.join(DATA_FOLDER, "samples-manifest.json")
|
||||
LOG_FOLDER = os.path.join(SRC_MMPSEARCH, "logs", "handler_logs")
|
||||
@@ -44,7 +49,7 @@ CONFIGS = [
|
||||
"source_dir": WAV_FOLDER, # Vai ler a pasta src_mmpSearch/wav
|
||||
"output_file": os.path.join(DATA_FOLDER, "beats.yml"), # Salva em _data/beats.json
|
||||
"scan_type": "list",
|
||||
"extensions": [".wav", ".mp3"], # Extensões permitidas
|
||||
"extensions": [".wav", ".mp3", ".ogg"], # Extensões permitidas
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Binary file not shown.
+16
-28
@@ -1,34 +1,22 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Interrompe a execução imediatamente se qualquer comando falhar
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
export MMPSEARCH_REPO_ROOT="${MMPSEARCH_REPO_ROOT:-$(dirname -- "$SCRIPT_DIR")}"
|
||||
export MMPSEARCH_DATA_ROOT="${MMPSEARCH_DATA_ROOT:-/var/www/html/trens/src_mmpSearch}"
|
||||
export MMPSEARCH_WORKERS="${MMPSEARCH_WORKERS:-2}"
|
||||
PYTHON_BIN="${MMPSEARCH_PYTHON:-$MMPSEARCH_REPO_ROOT/venv/bin/python3}"
|
||||
|
||||
# Define o caminho absoluto para o seu Python do ambiente virtual
|
||||
PYTHON_BIN="/nethome/jotachina/projetos/mmpSearch/venv/bin/python3"
|
||||
if [[ ! -x "$PYTHON_BIN" ]]; then
|
||||
echo "Python indisponivel: $PYTHON_BIN. Defina MMPSEARCH_PYTHON." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Define o diretório raiz do projeto para garantir que os caminhos relativos funcionem
|
||||
BASE_DIR="/nethome/jotachina/projetos/mmpSearch/scripts"
|
||||
|
||||
echo "================================================================="
|
||||
echo "Iniciando Pipeline Completo do MMPSearch"
|
||||
echo "================================================================="
|
||||
|
||||
# Navega até a raiz do projeto para que os caminhos dos scripts funcionem corretamente
|
||||
cd "$BASE_DIR"
|
||||
|
||||
echo "[1/3] Executando: handler/main.py..."
|
||||
cd "$MMPSEARCH_REPO_ROOT/scripts"
|
||||
echo "[1/3] Extracao, renderizacao e manifestos"
|
||||
"$PYTHON_BIN" handler/main.py
|
||||
echo "handler/main.py concluído!"
|
||||
echo "-----------------------------------------------------------------"
|
||||
|
||||
echo "[2/3] Executando: classificacao/analise_audio.py..."
|
||||
echo "[2/3] Analise de audio"
|
||||
"$PYTHON_BIN" classificacao/analise_audio.py
|
||||
echo "classificacao/analise_audio.py concluído!"
|
||||
echo "-----------------------------------------------------------------"
|
||||
|
||||
echo "[3/3] Executando: classificacao/classificacao_mestre.py..."
|
||||
echo "[3/3] Classificacao dos projetos"
|
||||
"$PYTHON_BIN" classificacao/classificacao_mestre.py
|
||||
echo "classificacao/classificacao_mestre.py concluído!"
|
||||
echo "================================================================="
|
||||
echo "Pipeline finalizado com sucesso!"
|
||||
echo "================================================================="
|
||||
echo "ETL concluido. O build/publicacao do Jekyll e uma etapa separada."
|
||||
Reference in new issue
Block a user