-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_app.sh
More file actions
77 lines (74 loc) · 2.67 KB
/
start_app.sh
File metadata and controls
77 lines (74 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Script de inicio para el contenedor
# Permite iniciar Streamlit, JupyterLab, o ambos
echo "=========================================="
echo " Report Assambler - Inicio de Servicios"
echo "=========================================="
echo ""
echo "Este contenedor puede ejecutar dos servicios:"
echo " • Streamlit: Aplicación web (Compilador y Clasificador)"
echo " • JupyterLab: Entorno de desarrollo interactivo"
echo ""
echo "¿Qué querés hacer?"
echo ""
echo "1) Iniciar solo Streamlit"
echo "2) Iniciar solo JupyterLab"
echo "3) Iniciar ambos servicios (Streamlit + JupyterLab)"
echo "4) Entrar al shell sin iniciar servicios"
echo ""
read -p "Elegí una opción (1-4): " opcion
case $opcion in
1)
echo ""
echo "🚀 Iniciando Streamlit..."
echo "📱 Accedé desde tu navegador en: http://localhost:8501"
echo "⚠️ Presioná Ctrl+C para detener el servicio"
echo ""
streamlit run app/streamlit_launcher.py --server.port 8501 --server.address 0.0.0.0
;;
2)
echo ""
echo "🚀 Iniciando JupyterLab..."
echo "📱 Accedé desde tu navegador en: http://localhost:8889"
echo "⚠️ Presioná Ctrl+C para detener el servicio"
echo ""
jupyter lab --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=''
;;
3)
echo ""
echo "🚀 Iniciando ambos servicios..."
echo "📱 Streamlit: http://localhost:8501"
echo "📱 JupyterLab: http://localhost:8889"
echo ""
echo "⚠️ Presioná Ctrl+C para detener ambos servicios"
echo ""
# Iniciar Streamlit en background
streamlit run app/streamlit_launcher.py --server.port 8501 --server.address 0.0.0.0 &
STREAMLIT_PID=$!
# Iniciar JupyterLab en foreground
jupyter lab --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=''
# Si JupyterLab se detiene, también detener Streamlit
kill $STREAMLIT_PID 2>/dev/null
;;
4)
echo ""
echo "💻 Entrando al shell interactivo..."
echo ""
echo "💡 Comandos útiles:"
echo " • Iniciar Streamlit:"
echo " streamlit run app/streamlit_launcher.py --server.port 8501 --server.address 0.0.0.0"
echo ""
echo " • Iniciar JupyterLab:"
echo " jupyter lab --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=''"
echo ""
echo " • Ejecutar tests:"
echo " cd tests && pytest -s test_assembler.py"
echo ""
exec bash
;;
*)
echo ""
echo "❌ Opción inválida. Iniciando shell..."
exec bash
;;
esac