Configuration Command

The manta_node config command manages node configurations, allowing you to create, modify, and manage configuration files for manta nodes.

Overview

Node configurations are stored as TOML files in ~/.manta/nodes/ directory. Each configuration contains settings for identity, network, datasets, and various runtime parameters. The config command provides an interactive wizard for creating configurations and utilities for managing them.

Subcommands

init - Create Configuration

Create a new configuration interactively with a guided wizard.

manta_node config init

The wizard will prompt you for:

  1. Configuration name - Identifier for this configuration (default: “default”)

  2. JWT Token - Required authentication token from the manager

  3. Node alias - Optional friendly name for the node

  4. Random ID - Whether to use random node IDs

  5. Manager connection - Host and port for the manager service

  6. Dataset mappings - Optional local dataset paths

  7. Advanced settings - Additional configuration options

Example interaction:

$ manta_node config init
┌─ manta_node Configuration ─────────────────────────────┐
│ Node Configuration Setup Wizard                        │
│                                                         │
│ This wizard will help you create a new node            │
│ configuration. Configuration will be saved in          │
│ ~/.manta/nodes/                                        │
└─────────────────────────────────────────────────────────┘

Configuration name [default]: production
JWT Token (secured_token): **********************
Node alias (optional): prod-node-1
Use random node ID? [y/N]: n
Manager host [localhost]: manager.example.com
Manager port [50051]: 50051
Configure dataset mappings? [y/N]: y
Dataset name: mnist
Path for dataset 'mnist': /data/datasets/mnist
Dataset name: (press enter to finish)

✓ Configuration 'production' created successfully!
Saved to: ~/.manta/nodes/production.toml

list - List Configurations

Display all available configurations with their validation status.

manta_node config list

Example output:

┌─ Available Node Configurations ───────────────────────┐
│ Name        │ Path                          │ Status  │
├─────────────┼───────────────────────────────┼─────────┤
│ default     │ ~/.manta/nodes/default.toml  │ Valid   │
│ production  │ ~/.manta/nodes/production.toml│ Valid   │
│ dev         │ ~/.manta/nodes/dev.toml      │ 2 issues│
└─────────────┴───────────────────────────────┴─────────┘

show - Display Configuration

Show detailed information about a specific configuration.

manta_node config show <config_name>

Example:

manta_node config show production

Output includes:

  • Identity settings (alias, random ID, token status)

  • Network configuration (manager host/port)

  • Dataset mappings

  • Metadata (name, description, creation time)

  • Validation status

validate - Validate Configuration

Check if a configuration is valid and ready to use.

manta_node config validate <config_name>

Example:

$ manta_node config validate production
✓ Configuration 'production' is valid

Common validation issues:

  • Missing or placeholder JWT token

  • Invalid network ports (must be 1024-65535)

  • Non-existent dataset paths

  • Excessive resource reservations

edit - Edit Configuration

Open a configuration file in your default text editor.

manta_node config edit <config_name>

The command uses the following editors in order of preference:

  1. $EDITOR environment variable

  2. $VISUAL environment variable

  3. Common editors: nano, vim, vi, emacs, code, notepad

Example:

$ manta_node config edit production
Opening ~/.manta/nodes/production.toml in vim...
✓ Configuration 'production' edited successfully

After editing, the configuration is automatically validated.

delete - Remove Configuration

Delete a configuration file permanently.

manta_node config delete <config_name>

Example:

$ manta_node config delete old-config
Configuration to delete: old-config
File: ~/.manta/nodes/old-config.toml
Are you sure you want to delete configuration 'old-config'? [y/N]: y
✓ Configuration 'old-config' deleted successfully

Configuration File Structure

Configuration files are stored in TOML format with the following sections:

[identity]
secured_token = "your-jwt-token-here"
alias = "node-1"           # Optional friendly name
random_id = false          # Use random node IDs

[network]
manager_host = "localhost"
manager_port = 50051
light_service_host = "0.0.0.0"
light_service_port = 0     # Auto-assigned if 0 or null

[mqtt]
ping_interval = 1
reconnect_attempts = 5
reconnect_delay = 5.0

[containers]
gpu_enabled = true         # null for auto-detect
default_memory_limit = "4G"
default_cpu_limit = "2.0"
docker_network = "host"
runtime = "docker"         # or "podman"

[datasets]
base_path = "/data/datasets"
mount_readonly = true

[datasets.mappings]
mnist = "/data/datasets/mnist"
cifar10 = "/data/datasets/cifar10"

[tasks]
max_concurrent = 2
task_timeout = 3600
retry_attempts = 3
cleanup_on_failure = true
stream_logs = true

[resources]
reserve_cpu_percent = 10
reserve_memory_mb = 512
max_disk_usage_percent = 90
monitor_interval = 30

[logging]
level = "INFO"
filename = "~/.manta/logs/nodes/node-1.log"
log_to_file = true
log_to_console = false
debug_mode = true
max_file_size = "100M"
backup_count = 5

[security]
use_tls = false
cert_folder = "~/.manta/certs"
verify_ssl = true
token_refresh_interval = 3600

[metadata]
name = "production"
created_at = "2024-03-15T10:30:00"
version = "1.0.0"
description = "Production node configuration"

Storage Locations

  • Configuration files: ~/.manta/nodes/*.toml

  • Log files: ~/.manta/logs/nodes/*.log

  • Instance tracking: ~/.manta/nodes/instances/*.json

  • Certificates: ~/.manta/certs/ (when TLS enabled)

Environment Variable Support

Configuration values can reference environment variables using the syntax:

secured_token = "${MANTA_NODE_TOKEN}"
manager_host = "${MANAGER_HOST:localhost}"  # With default value

This allows for secure credential management without storing tokens in files.

Best Practices

  1. Security: Never commit configuration files with real JWT tokens to version control

  2. Naming: Use descriptive names for configurations (e.g., “gpu-cluster”, “edge-node”)

  3. Validation: Always validate configurations after editing

  4. Backups: Keep backups of working configurations before making changes

  5. Environment Variables: Use environment variables for sensitive values like tokens

Common Use Cases

Creating a Development Configuration

# Create config interactively
manta_node config init
# Name it "dev"
# Use localhost for manager
# Skip dataset configuration

Creating a Production Configuration

# Create config with production settings
manta_node config init
# Name it "production"
# Use production manager host
# Configure all required datasets
# Set appropriate resource limits

Cloning a Configuration

# Copy existing config
cp ~/.manta/nodes/default.toml ~/.manta/nodes/staging.toml

# Edit the new config
manta_node config edit staging

# Validate it
manta_node config validate staging

Troubleshooting

Configuration Not Found

If you see “Configuration ‘X’ not found”:

  1. Check available configurations: manta_node config list

  2. Verify the configuration file exists: ls ~/.manta/nodes/

  3. Create a new configuration: manta_node config init

Invalid JWT Token

If validation fails due to JWT token:

  1. Ensure token is set and not a placeholder

  2. Verify token format (should be a valid JWT string)

  3. Check token hasn’t expired

  4. Obtain a new token from the manager if needed

Dataset Path Issues

If dataset paths are invalid:

  1. Verify paths exist: ls /path/to/dataset

  2. Check permissions: ls -la /path/to/dataset

  3. Use absolute paths in configuration

  4. Ensure datasets are mounted if using Docker

See Also