Controller
The controller is the central node of a NanoPing cluster. Any centralize service is hosted on the controller such as the hub server.
Basic Usage
Start the Controller
A configuration file is required to start the controller. Use the provided example configuration (controller-config.example.yaml
) or copy the following.
node:
name: controller
http:
address: 127.0.0.1:8769
# To enable basic HTTP authentication, uncomment the following lines and set the username and password
#basicAuth:
# username: admin
# password: admin
hubServer:
authenticationByRequest:
timeout: 5m
# To enable the gRPC bridge, uncomment the following lines
#grpcBridge:
# address: 127.0.0.1:10564
# To enable running pipelines on the controller, uncomment the following line
#pipelines:
# If you start the controller from a working directory containing a `config.yaml` file
sudo npctrl up
# If you start the controller from a different working directory, specify the config file
sudo npctrl -c /path/to/config.yaml up
Access the Controller Dashboard
Open your browser and go to:
http://localhost:8769
Stop the Controller
To stop the controller, run:
sudo npctrl down
Check Controller Version
To check the installed version of the controller, run:
sudo npctrl version
Start the gRPC API Server
To serve the gRPC API on a specific port (e.g., 10432), add the following to the configuration file:
... my other config
grpcBridge:
address: 127.0.0.1:10564
Enable HTTP Basic Authentication
To enable HTTP Basic Auth for the controller, add the following section to the http
configuration:
http:
address: 127.0.0.1:8769
g
# Enable HTTP Basic Auth
basicAuth:
username: "admin"
password: "admin"
Run pipelines on the controller
By default pipelines are not enabled on the controller. To enable it, add the following to the configuration file:
... my other config
pipelines: # Empty object
can also be written as
pipelines: {}
Custom Networks
As we are completing our new Network feature, there is a temporary preview that let you create Custom Networks. The custom network are custom configurations of pipelines and which node they should be run on. In the final version of the Network feature, you will instead provide a template for a pipeline, and all the variables will be replaced with the corresponding values. As of for now, you'll have to create the whole pipeline and copy its json to a file and specify which node it should be run on by the node ID. The following is an example of how to create a custom network. Again, we will like to preface this is a temporary feature and it will be removed as soon as the final version is ready.
... my other config
# Configuration of networks
networks:
custom_networks:
- id: my_custom_network # requires some unique random ID
name: My Custom Network # Human-readable name
node_pipelines:
- node_id: 2abc8870-3ad2-4dfd-8bf4-4ab1c3f7e113 # Node ID of some node
pipeline_json_configs:
- /home/user/configs/custom-network-pipeline-sender.json # Path to the pipeline JSON file that will be run on the node
- node_id: 04488ddf-a305-4a1b-8e97-b036a3f6bca9 # Node ID of some other node
pipeline_json_configs:
- /home/user/configs/custom-network-pipeline-receiver.json
- /home/user/configs/custom-network-pipeline-other-pipeline.json # You can specify multiple pipelines for the same node