central source for configs #40
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_compute#40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
e.g the explorers that the project works against
something similar to https://github.com/threefoldtech/zos-config
Analysis & Implementation Plan (v2)
Current State
.envfileshttps://forge.ourworld.tf/.../images.toml(inconstants.rs)constants.rs)What needs to be done
1. Create a new config repo (e.g.,
forge.ourworld.tf/lhumina_code/hero_compute_config)Use TOML (not JSON) — consistent with the rest of the hero ecosystem (
images.toml,Cargo.toml, zinit configs). CI validation can still be done with a TOML linter/schema check step.Structure:
Config file format — include a version field for future schema evolution:
2. Decide what goes in these config files — values shared across all nodes in an environment:
registry_urlHERO_COMPUTE_REGISTRY_URL/ hardcoded defaultmycelium_peersDEFAULT_MYCELIUM_PEERS/ hardcodedexplorer_addressesEXPLORER_ADDRESSESenv varheartbeat_interval_secsoffline_threshold_secsThings that should stay local (per-node
.env): socket paths, ports,MASTER_IP,RUST_LOG, slice size (hardware-dependent).3. Add a config fetcher to hero_compute
{environment}.tomlfrom the raw git URLHERO_COMPUTE_ENV=development.envoverrides (local wins, so operators can still override)image_registry.rswhich already does HTTP GET → parse TOML → return struct. Refactor it into a genericremote_config.rsthat both the image registry and central config use.4. Update
constants.rsto remove hardcoded defaults for mycelium peers and registry URL — these become part of the central config.5. Add CI validation in the config repo. Important security concern: production config changes must require approval from a specific maintainer before merging. If anyone can open a PR to
production.tomland it auto-deploys to all nodes, that's a significant attack surface. Use branch protection + required reviewers.Recommended order of work
image_registry.rsinto a genericremote_config.rsmodule that both the image registry and the central config can use. Avoids duplication.development.tomlcontaining the current hardcoded values, using the versioned TOML format above.remote_config.rs— get it working with a minimal config first.hero_compute/src/main.rs— fetch config before spawning services, with local.envoverrides.constants.rs, source them from the central config instead.Blocker
The
explorer_addressesfield in the central config is only useful once nodes can actually connect to remote explorers over TCP. Until the TCP transport issue is resolved, centralizing that field has no practical effect — nodes in worker mode still need the directMASTER_IPenv var.Note: the explorer_addresses field will be populated but ignored until the native TCP transport issue is resolved. Until then, nodes continue using MASTER_IP + socat bridge. This field is included in the schema now, so the format is stable when TCP lands.