-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·97 lines (81 loc) · 3.21 KB
/
setup.sh
File metadata and controls
executable file
·97 lines (81 loc) · 3.21 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
#!/bin/bash
# check if sudo exists as it doesn't on RunPod
if command -v sudo 2>&1 >/dev/null; then
SUDO="sudo"
else
SUDO=""
fi
if command -v apt 2>&1 >/dev/null; then
echo "Installing dependencies using APT. Please consider switching to AWS instead!"
$SUDO apt update -y
$SUDO apt install python3-pip unzip npm -y
elif command -v yum 2>&1 >/dev/null; then
echo "Installing dependencies using YUM"
$SUDO yum install python3-pip unzip npm -y
pip install --upgrade pip
else
echo "FATAL! System does not support either APT or YUM"
exit
fi
$SUDO npm install -g pm2@latest
# Make sure TCP processes have sufficient memory
# Doesn't work on Docker, so check if modifyable first
if [ ! -f /.dockerenv ]; then
TCP_SETTINGS="
# Custom Zeus TCP buffer settings for high-concurrency workloads
net.ipv4.tcp_rmem=4096 131072 13107200
net.ipv4.tcp_wmem=4096 16384 13107200
"
echo "$TCP_SETTINGS" | $PREFIX tee /etc/sysctl.d/99-zeus-subnet-tcp.conf > /dev/null
$SUDO sysctl --system
echo "Increased TCP memory settings for optimal concurrency!"
fi
# install repository itself and CPU only torch
pip install --extra-index-url https://download.pytorch.org/whl/cpu -e . --use-pep517
# Create miner.env if it doesn't exist
if [ -f "miner.env" ]; then
echo "File 'miner.env' already exists. Skipping creation."
else
cat > miner.env << 'EOL'
# Subtensor Network Configuration:
NETUID= # Network UID options: 18, 301
SUBTENSOR_NETWORK= # Networks: finney, test, local
SUBTENSOR_CHAIN_ENDPOINT=
# Endpoints:
# - wss://entrypoint-finney.opentensor.ai:443
# - wss://test.finney.opentensor.ai:443/
# Wallet Configuration:
WALLET_NAME=default
WALLET_HOTKEY=default
# Miner Settings:
AXON_PORT=
BLACKLIST_FORCE_VALIDATOR_PERMIT=True # Default setting to force validator permit for blacklisting
EOL
echo "File 'miner.env' created."
fi
# Create validator.env if it doesn't exist
if [ -f "validator.env" ]; then
echo "File 'validator.env' already exists. Skipping creation."
else
cat > validator.env << 'EOL'
NETUID= # Netuids: 18 (for finney), 301 (for testnet)
SUBTENSOR_NETWORK= # Networks: finney, test, local
SUBTENSOR_CHAIN_ENDPOINT=
# Endpoints:
# - wss://entrypoint-finney.opentensor.ai:443
# - wss://test.finney.opentensor.ai:443/
# Wallet Configuration:
WALLET_NAME=default
WALLET_HOTKEY=default
# Validator Port Setting:
AXON_PORT=
PROXY_PORT=
# API Keys:
CDS_API_KEY= # https://github.com/Orpheus-AI/Zeus/blob/main/docs/Validating.md#ecmwf
PROXY_API_KEY= # Your Proxy API Key, you can generate it yourself
# Optional integrations
DISCORD_WEBHOOK= # https://www.svix.com/resources/guides/how-to-make-webhook-discord/
EOL
echo "File 'validator.env' created."
fi
echo "Environment setup completed successfully."