NEP-0102: NOC Deploy Configuration Protocol
NOC deployment can be complex and error-prone. To simplify this process and minimize configuration and deployment errors, NOC relies on external tools to abstract complexity from the user.
Currently, there are two official configuration tools:
- NOC Tower: A cluster configuration tool with a web interface. It uses Ansible playbooks provided with NOC.
- Gufo Thor: A lightweight tool that uses Docker Compose for quick evaluation and testing of NOC.
During deployment, specific configuration data must be passed from the configuration tool to the migration process to ensure a correct and complete setup with no manual intervention: - Pools: Pools created in the configuration tool must be replicated in the NOC database. - Slots: The service scale must be registered as slots in Consul.
Currently, the configuration protocol is an ad-hoc system that evolved alongside NOC Tower and the playbooks. It lacks a well-defined contract, making it difficult for other tools to support without reverse engineering or reimplementing logic.
Proposal Objective¶
This proposal aims to define a clear contract between the configuration tool and the migration process. It outlines what NOC expects from the configuration tool during deployment.
Passed Configuration¶
Pools¶
Pools must be defined in the configuration tool and written to the NOC database. Required information:
name
: Pool namedescription
: Pool descriptiondiscovery_reschedule_limit
: Optional rate limit for starting discovery (mainly for ETL operations)
Slots¶
Sharded processes must have their slots preconfigured in Consul. Required information:
- process name
: Format should be <service>
or <service>-<pool>
- slots
: Number of slots to reserve
Protocol Specification¶
- A single entry point for the migration process MUST be implemented at
scripts/deploy/migration.sh
- The configuration tool MUST NOT interfere directly with the migration logic. It MUST invoke the migration script.
- Before invoking the migration script, the configuration tool MUST set appropriate environment variables (see below).
- If a variable is not set, the corresponding step in the migration process MUST be skipped.
Required Environment Variables¶
Variable | Description |
---|---|
NOC_MIGRATE_POOL_<pool_name> |
Pool description or empty string |
NOC_MIGRATE_POOLDRL_<pool_name> |
Discovery reschedule limit (optional) |
NOC_MIGRATE_SLOTS_<process> |
Number of slots for non-pooled processes |
NOC_MIGRATE_SLOTS_<process>_<pool> |
Number of slots for pooled processes |
Conclusions¶
- A well-defined contract simplifies the development of configuration tools.
- Environment variables do not leave behind artifacts that could affect future deployments.
- This approach minimizes the risk of user error during deployment.