Skip to content

MIP-0001: Configuration and API#1

Open
rkuester wants to merge 1 commit into
256foundation:mainfrom
rkuester:mip-configuration-and-api
Open

MIP-0001: Configuration and API#1
rkuester wants to merge 1 commit into
256foundation:mainfrom
rkuester:mip-configuration-and-api

Conversation

@rkuester

@rkuester rkuester commented May 31, 2026

Copy link
Copy Markdown
Collaborator

MIP-0001 sets out the requirements for Mujina's configuration system and REST API: one tree of named nodes unifying defaults, config files, environment variables, command-line arguments, and the API, with values that are readable, subscribable, validated, and persisted across restarts.

This PR is where the document is read and revised, so comments and line suggestions go here. For comfortable reading, the rendered view is easier than the diff: https://github.com/rkuester/mujina-mips/blob/mip-configuration-and-api/mip-0001-configuration-and-api.md

It grew out of reviewing the YAML-configuration PR (256foundation/mujina#36) on dev call #2 and the earlier "static config file" discussion (256foundation/mujina#23), which it subsumes.

Please poke holes.

@jayrmotta jayrmotta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it a lot, my research says this has the best of a lot of different projects. I compared this proposal against: Braiins OS, ESP-Miner, LuxOS, systemd, Git, Open WRT, Kubernetes, Home Assistant, among others.

I also think this shouldn't be introduced at once, perhaps we can have intermediate steps and learn along the way as it seems a bit overwhelming at first.

One thing that came up in my research was the ability to know where a property that ended up in the saved config came from, as we would have several folders and multiple files per folder then what some software do is to offer an option to track properties that might be conflicting or taking a different precedence than intended.

Some other findings and opinions below in the comments.

written by system services at boot and cleared on reboot. See below.
4. Admin config files (`/etc/mujina/config.yaml` and
`/etc/mujina/config.d/*.yaml`), the administrator's space, never
written by a package. Conventional for a Unix daemon and kept for

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what never written by a package means here

Comment on lines +194 to +206
```
PUT /api/v0/boards/e100-e2f56f9b/target_power_w
```

Setting one value is therefore a single PUT to that leaf. To change
several fields of a node in one atomic request, PATCH the node with a
partial document, which updates only the fields it names and leaves
the rest alone:

```
PATCH /api/v0/boards/e100-e2f56f9b
{ "target_frequency_mhz": 525, "target_voltage_v": 1.15 }
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if some change in config result in a panic/crash or the hardware being unreachable in the network? We could put the device in a dangerous loop or get locked out of it remotely.

I've done some research and some communities adopt a stage/commit approach where changes done to the configs in runtime become staged but require an explicit commit/flush command to write them to disk. That way a hard reset would be enough to rollback the previous config and bring it back without some major intervention.

Comment on lines +309 to +318
A startup argument, something like `--delete-saved-config`, sets the
saved config aside before the daemon loads anything. Recovery is the
sharpest reason: a saved value that keeps the daemon from starting
leaves no running daemon to accept a delete, so the escape must be
reachable at startup. It also gives a clean reset, dropping every
runtime override to return the daemon to its file-and-default
configuration. Because it clears all overrides at once, it renames the
existing file aside rather than destroying it, leaving the user a copy
to restore what was good. Wholesale delete of saved config while the
daemon runs is a separate convenience and is deferred.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this as the last resort, if I'm a mining ops engineer and some device is misbehaving I would try other things before SSHing into it and "messing" with its internal state.

This is probably unrelated to the design decision of writing to the saved config on every live update, but it would be the only resort for operators that somehow locked themselves out of some device's API or even starting up properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants