mks cmd executor.tar.gz
Cluster Command Execution Script
This script executes specified commands on a cluster using the Rafay API. It retrieves the project and cluster IDs, runs the command, and outputs the result directly to the console.
Features
- Fetches project and cluster IDs dynamically using the provided details.
- Executes a specified command on the target cluster via the Rafay API.
- Outputs the command execution result.
Prerequisites
- The script assumes that all required tools (example nvidia-smi etc) are already installed on the machine.
- Access to the Rafay API with a valid API key.
Usage
1. Prepare a JSON Configuration File
Create a configuration file (e.g., config.json) with the following format:
{
"base_url": "your_controller_endpoint",
"api_key": "your_api_key",
"project_name": "your_project_name",
"cluster_name": "your_cluster_name",
"command": "your_command",
"timeout": 120
}
2. Run the Script
Execute the script by providing the path to your configuration file as an argument:
chmod +x mks-cmd-executor.sh
./mks-cmd-executor.sh config.json