72caf9743 chore: define network for node manager vm
After applying updates on Arch, my Vagrant and libvirt setup doesn't work like it did before. The
network that Vagrant creates doesn't have internet access. So, the VM needs to be explicitly added
to the default network, rather than the vagrant-libvirt network. Shared folders are also a more
difficult situation now. So one of these were removed.
26baf6a4a feat: node manager logs to stderr
A short-lived program like the node manager doesn't need to log to file. The logs can go straight to
stderr, like most other programs do.
Two global arguments are added to support this: --debug and --trace. Setting either of those
flags will set the logging level to debug or trace, respectively. Normally you can also set an
environment variable, but I'm leaving this out because there are all sorts of different crate scopes
you can set with respect to our program.
BREAKING CHANGE: the previous logging mechanism for logging to file was removed.
We should also consider actually removing the Stdout variant from the LogOutputDest enum,
because it's very non-standard to put logs there.
52a587edc feat: node registry refresh searches for pids
The node registry refresh is changed to determine if each service process is running by searching
for processes that have a binary running at a particular path. Since each node service has its own
copy of the binary, it is uniquely identified by the location of that binary.
The refresh is split into partial or full. In the partial case, we will only attempt to find the PID
by searching for a process by its binary path. If it is found, we set the new PID for the service
and set its status to RUNNING; if it's not found, we set the status to STOPPED. This mechanism
should be robust against user interference, e.g., if they manually start/stop processes by whatever
means. For a full refresh, we also connect to the node's RPC service to get information about
connected peers and listeners.
We will use partial refresh for commands like start and stop, to help us determine whether we
should attempt to start/stop services that were already running or not. These commands will
potentially operate over lots of services so we will avoid the RPC connections here.
Full refresh will be used when the status command runs.
Finally, I have also reassigned the connected peers data, and added/updated some of the log
information which I found useful to have during my testing.
Type of Change
Please mark the types of changes made in this pull request.
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Description
72caf9743 chore: define network for node manager vm
After applying updates on Arch, my Vagrant and libvirt setup doesn't work like it did before. The network that Vagrant creates doesn't have internet access. So, the VM needs to be explicitly added to the
default
network, rather than thevagrant-libvirt
network. Shared folders are also a more difficult situation now. So one of these were removed.26baf6a4a feat: node manager logs to stderr
A short-lived program like the node manager doesn't need to log to file. The logs can go straight to stderr, like most other programs do.
Two global arguments are added to support this:
--debug
and--trace
. Setting either of those flags will set the logging level to debug or trace, respectively. Normally you can also set an environment variable, but I'm leaving this out because there are all sorts of different crate scopes you can set with respect to our program.BREAKING CHANGE: the previous logging mechanism for logging to file was removed.
We should also consider actually removing the
Stdout
variant from theLogOutputDest
enum, because it's very non-standard to put logs there.52a587edc feat: node registry refresh searches for pids
The node registry refresh is changed to determine if each service process is running by searching for processes that have a binary running at a particular path. Since each node service has its own copy of the binary, it is uniquely identified by the location of that binary.
The refresh is split into partial or full. In the partial case, we will only attempt to find the PID by searching for a process by its binary path. If it is found, we set the new PID for the service and set its status to
RUNNING
; if it's not found, we set the status toSTOPPED
. This mechanism should be robust against user interference, e.g., if they manually start/stop processes by whatever means. For a full refresh, we also connect to the node's RPC service to get information about connected peers and listeners.We will use partial refresh for commands like
start
andstop
, to help us determine whether we should attempt to start/stop services that were already running or not. These commands will potentially operate over lots of services so we will avoid the RPC connections here.Full refresh will be used when the
status
command runs.Finally, I have also reassigned the connected peers data, and added/updated some of the log information which I found useful to have during my testing.
Type of Change
Please mark the types of changes made in this pull request.