-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_nuclear.sh
More file actions
executable file
·68 lines (59 loc) · 2.07 KB
/
deploy_nuclear.sh
File metadata and controls
executable file
·68 lines (59 loc) · 2.07 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
#!/bin/bash
# NUCLEAR DEPLOYMENT - COMPLETELY ELIMINATE PyMuPDF
set -e
echo "💥 NUCLEAR DEPLOYMENT - PyMuPDF ELIMINATION"
echo "============================================="
# Step 1: Remove ALL PyMuPDF traces
echo "🧹 Step 1: Removing ALL PyMuPDF traces..."
pip uninstall -y PyMuPDF pymupdf4llm fitz || true
pip cache purge || true
# Step 2: Install ONLY our nuclear requirements
echo "📦 Step 2: Installing nuclear requirements (NO PyMuPDF)..."
pip install -r requirements-nuclear.txt
# Step 3: Verify PyMuPDF is completely gone
echo "🔍 Step 3: Verifying PyMuPDF elimination..."
if python -c "import fitz" 2>/dev/null; then
echo "❌ CRITICAL: PyMuPDF is still installed!"
echo "💥 NUCLEAR DEPLOYMENT FAILED!"
exit 1
else
echo "✅ PyMuPDF successfully eliminated"
fi
# Step 4: Test PDF processing with alternatives
echo "🧪 Step 4: Testing PDF processing alternatives..."
python3 -c "
try:
import pypdf
import pdfplumber
import PyPDF2
print('✅ PDF alternatives working: pypdf, pdfplumber, PyPDF2')
except ImportError as e:
print(f'❌ PDF alternative test failed: {e}')
exit(1)
"
# Step 5: Test our PDF processor
echo "🔧 Step 5: Testing PDF processor..."
python3 -c "
try:
from backend.utils.pdf_processor import pdf_processor
print(f'✅ PDF processor initialized with: {pdf_processor.primary_lib}')
print(f'📚 Available libraries: {list(pdf_processor.available_libraries.keys())}')
if 'pymupdf' in pdf_processor.available_libraries and pdf_processor.available_libraries['pymupdf']:
print('❌ ERROR: PyMuPDF is still available in processor!')
exit(1)
else:
print('✅ PyMuPDF not available in processor - using alternatives')
except Exception as e:
print(f'❌ PDF processor test failed: {e}')
exit(1)
"
echo "🎉 NUCLEAR DEPLOYMENT SUCCESSFUL!"
echo "🚀 PyMuPDF completely eliminated!"
echo "📄 PDF processing using alternatives only"
# Start the application
echo "🚀 Starting application..."
if [ -f "backend/app.py" ]; then
cd backend && python app.py
else
python app.py
fi