Name: Wave
Owner: ASP.NET
Description: Cross-platform tools for running perf and stress tests
Created: 2016-05-06 17:26:31.0
Updated: 2017-12-03 12:38:35.0
Pushed: 2016-10-24 23:51:20.0
Homepage: null
Size: 566
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Wave provides a tool-set for cross platform remote command execution.
The controller is an orchestrator that coordinates and sequences commands. The controller subscribes on job/controllerid
topic and uses commands from a markdown table as follows. The controller is based on callbacks from the target agent as a mechanism of flow control. Commands are defined in markdown table with the following layout -
| Command | Host |Description|
|————-|———–|———–|
| ./startServer.sh
| $(server) |server command|
| .\loadtest.cmd $(server) $(serverurl)
| $(client) | Client command |
Environment variables
may be persisted across commands in the agent which will be available in a spawned process.logdir
and cwd
can be changed as a part of the environment command.The commands can be directly sent the target using the CLI. There is also a web client which gives a remote shell like experience.
For details of the command line client goto ./client
The agent communication is handled through a set of topics which it listens to and outputs messages to. The controller or CLI communicates to the well-know topic as the contracts defined below.
|Topic|Description|
|—-|———–|
|hostid
| Subscribed by the host for synchronous command execution |
|hostid/async
| Subscribed by the host and commands are executed asynchronously |
|hostid/output
| Command output stream |
|hostid/status
| Last command executed |
|client/hostid/config
| Birth and will message which is retained and includes config details like IP and status |
hostname
unless we override the value.The diagram below provides an overview of the communication mechanism between the agents and CLI/Controller.
Install Node if needed.
xec /i https://nodejs.org/dist/v5.11.0/node-v5.11.0-x64.msi /passive
Setup the agent with the required credentials.
ershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$target='c:\cmdport\';$broker='test';$username='test';$password='test';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Wave/master/scripts/Install.ps1'))}"
Git clone the repo and run the install script as follows.
clone http://github.com/aspnet/Wave
./Wave/scripts/install.sh testbroker testuser testpassword
This sets up the flow and connects to the broker and makes the machine ready for remote commands. Refer to install.sh
for details.
The following commands should be used to setup or remove the agent as needed.
update-rc.d cmdport defaults
update-rc.d -f cmdport remove
Optional:
To allow shutdown scenario to work, add the following line to the sudoer
file to avoid interactive prompt. Note that we do not currently support poweroff
and reboot
commands.
_name ALL=(ALL) NOPASSWD: /sbin/shutdown
The docker image is based of the node:argon
image and contains the agent that can be started using the following commands and the logs command enables you to see if the broker succcessfully connected or not.
er pull dotnetperf/wave
er run --name wave1 -p 8001:8000 -e BROKER=[broker] -e PORT=[port] -e USERNAME=[username] -e PASSWORD=[password] -h [hostname] -d dotnetperf/wave
er logs wave1
The image takes 3 environment variables and the hostname which is used to setup the credentials in the agent. Refer to the Dockerfile
To connect to the running instance use the following command to start an interactive shell.
er exec -it wave1 /bin/sh
Once you are done with the agent, you can use the following commands to stop the container and delete the image if necessary.
er stop wave1 && docker rm wave1
er rmi dotnetperf/wave
If you are deploying containers on Ubuntu VM on Hyper-V, then:
nm-tool
on the Ubuntu VM and pick any one of the DNS addresses in the outputsudo vi /etc/default/docker
and add the DNS ip to DOCKER_OPTS parameter.sudo service docker restart
The following instructions are for a standard Mosquitto
MQTT broker.
Use the following instructions to setup an MQTT broker for command dispatch.
apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
apt-get update
apt-get -y install mosquitto
apt-get -y install mosquitto-clients
Configure the password and disable anonymous access
mosquitto_passwd -c /etc/mosquitto/pwfile <username>
nano /etc/mosquitto/mosquitto.conf
Add the following to disable anonymous access and enable websockets.
word_file /etc/mosquitto/pwfile
w_anonymous false
1883
ener 1884
ocol websockets
Restart the service
service mosquitto restart
To be able to connect to the broker you need to open up the port 1883 for Mosquitto. The following setup is for an azure VM. Follow the bread crumb described below and allow incoming packets for port 1883 for Azure VMs.
> Settings >> Network Interfaces >> Network Interface >> Settings >> Network Security Group >> Settings >> Inbound Rules