-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Run multiple instances from same workspace #410
Conversation
* Support running leader and validators from multiple machines using the same NFS mounted workspace. * Changes to setup, leader and validator scripts
multinode-demo/leader.sh
Outdated
@@ -6,5 +6,13 @@ export RUST_LOG=${RUST_LOG:-solana=info} | |||
set -x | |||
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 | |||
|
|||
IPADDR="$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')" | |||
|
|||
if [ -z "$IPADDR" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use bash's builtin [[ instead of [ (which is a program)
doing so saves you having to quote IPADDR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. will do
multinode-demo/leader.sh
Outdated
@@ -6,5 +6,13 @@ export RUST_LOG=${RUST_LOG:-solana=info} | |||
set -x | |||
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400 | |||
|
|||
IPADDR="$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does ifconfig show on a Mac? Looks like you're working really hard here...
on stock Ubuntu this doesn't work (no ifconfig)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you try this on your mac:
ifconfig | awk '/inet(6)? (addr:)?/ {print $2}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifconfig | grep inet shows the following on Mac
inet 192.168.130.37 netmask 0xfffffc00 broadcast 192.168.131.255
On ubuntu it's this
inet addr:10.138.0.3 Bcast:10.138.0.3 Mask:255.255.255.255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend using all the IPs as match possibilities in the leader-${IP} selection
Looks like:
IPS=$(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}')
for ip in $IPS
do
[[ -f leader-${ip}.json ]] && break;
done
echo leader-${ip}.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't understand.. leader.sh is generating the file name based on the ip addr of the machine where it's running. How is $IPS computed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on both Mac and ubuntu:
ifconfig | awk '/inet (addr)?/ {print $2}' | cut -d: -f2 | grep -v '127.0.0.1'
Isn't this essentially duplicated what -d option does? crdt::get_ip_addr()? |
@sakridge and I talked offline. This change allows multiple validators (running on different VMs) from a same workspace (e.g. NFS mounted) to connect. This enables multiple validator JSON files to coexist in the same workspace. |
* Fix token-js docs * Add Freeze/Thaw instructions * Add v2 instructions * Add new instructions to js test * Bump @solana/spl-token to v0.0.8 * Fix didThrow and remove invalidApprove
make `SignerSource::parse` public
using the same NFS mounted workspace.