-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdeploy-to-azure.sh
More file actions
executable file
·98 lines (73 loc) · 2.28 KB
/
deploy-to-azure.sh
File metadata and controls
executable file
·98 lines (73 loc) · 2.28 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
# Script to deploy Jito MEV Analyzer to Azure VM
# Set variables
AZURE_VM_IP="172.174.114.6"
AZURE_VM_USER="winuser"
DEPLOY_DIR="/home/winuser/jito-analyzer"
# Print info
echo "Deploying Jito MEV Analyzer to Azure VM"
echo "IP: $AZURE_VM_IP"
echo "User: $AZURE_VM_USER"
echo "Deploy directory: $DEPLOY_DIR"
# Create deployment directory
echo "Creating deployment files..."
mkdir -p ./deploy
# Copy necessary files to deployment directory
cp Dockerfile ./deploy/
cp docker-compose.yml ./deploy/
cp requirements.txt ./deploy/
cp jito_analyzer_high_perf.py ./deploy/
cp jito_web_server.py ./deploy/
cp run_jito_analyzer.sh ./deploy/
# Create a README file
cat > ./deploy/README.md << EOL
# Jito MEV Analyzer
A web UI for analyzing Jito MEV bundles on Solana using wIndexer API.
## Running the service
\`\`\`
# Build and start the service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the service
docker-compose down
\`\`\`
Access the web UI at http://localhost:8000
EOL
# Make scripts executable
chmod +x ./deploy/run_jito_analyzer.sh
# Package files
echo "Creating deployment package..."
tar -czf jito-analyzer-deploy.tar.gz -C ./deploy .
rm -rf ./deploy
# Option to deploy to Azure VM
read -p "Deploy to Azure VM at $AZURE_VM_IP? (y/n): " DEPLOY_OPTION
if [ "$DEPLOY_OPTION" == "y" ]; then
echo "Deploying to Azure VM..."
# Copy package to Azure VM
scp jito-analyzer-deploy.tar.gz $AZURE_VM_USER@$AZURE_VM_IP:/tmp/
# SSH to VM and set up
ssh $AZURE_VM_USER@$AZURE_VM_IP << EOF
# Create deployment directory
mkdir -p $DEPLOY_DIR
# Extract files
tar -xzf /tmp/jito-analyzer-deploy.tar.gz -C $DEPLOY_DIR
# Navigate to directory
cd $DEPLOY_DIR
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "Docker not found. Please install Docker and Docker Compose first."
exit 1
fi
# Build and start services
docker-compose up -d
# Clean up
rm /tmp/jito-analyzer-deploy.tar.gz
echo "Deployment complete! The Jito MEV Analyzer is running at http://$AZURE_VM_IP:8000"
EOF
echo "Deployment process completed."
else
echo "Skipping deployment to Azure VM."
echo "To deploy manually, copy jito-analyzer-deploy.tar.gz to your VM and extract it."
fi
echo "Done!"