Skip to content

Add support for Fioconfig - #109

Merged
doanac merged 7 commits into
mainfrom
fioconfig-support
Oct 31, 2025
Merged

Add support for Fioconfig#109
doanac merged 7 commits into
mainfrom
fioconfig-support

Conversation

@doanac

@doanac doanac commented Oct 24, 2025

Copy link
Copy Markdown
Member

This series of changes introduces support for fioconfig in the following ways:

  • fioup daemon will now check config during each interval
  • fioup config-check can be run by hand
  • fioup run-and-report can be used exactly like the version in fioconfig

@doanac
doanac requested review from detsch and mike-sul October 24, 2025 03:08
@doanac

doanac commented Oct 24, 2025

Copy link
Copy Markdown
Member Author

This is missing documentation, but I want y'all to give feedback before we try and do that. I think docs can be a separate PR.

@doanac

doanac commented Oct 24, 2025

Copy link
Copy Markdown
Member Author

This is missing a couple things, but I wanted y'all to see what I have. Things missing:

  • a systemd service to extract secrets earlier in the boot
  • documentation

@doanac
doanac force-pushed the fioconfig-support branch from bc8f8f2 to a64cd58 Compare October 24, 2025 03:39
Comment thread cmd/fioup/daemon.go Outdated
Comment thread cmd/fioup/daemon.go Outdated
@doanac
doanac force-pushed the fioconfig-support branch from a64cd58 to 25cba14 Compare October 27, 2025 20:24
Comment thread cmd/fioup/daemon.go Outdated
Comment thread internal/register/docker.go
@mike-sul

Copy link
Copy Markdown
Collaborator

@doanac Maybe it makes sense to move the first 3 commits into the separate PR?

Comment thread cmd/fioup/daemon.go Outdated
@doanac

doanac commented Oct 28, 2025

Copy link
Copy Markdown
Member Author

Maybe it makes sense to move the first 3 commits into the separate PR?

totally. I'd been thinking about doing this in an attempt to make this less noisy. But as 3 different PRs. I'll start splitting them now.

@doanac
doanac force-pushed the fioconfig-support branch from 25cba14 to 6364065 Compare October 30, 2025 18:18
@doanac

doanac commented Oct 30, 2025

Copy link
Copy Markdown
Member Author

@mike-sul @detsch - this is a new approach based on all the daemon refactor work. I'm hitting a small thing with app switching that Mike seems to know how to fix. However, the logging appears to show its doing the right things with config-reload logic.

Comment thread cmd/fioup/config_check.go
Comment thread cmd/fioup/run_and_report.go
Comment thread cmd/fioup/run_and_report.go
Comment thread cmd/fioup/daemon.go Outdated
Comment thread cmd/fioup/daemon.go
Comment thread cmd/fioup/daemon.go
@doanac
doanac force-pushed the fioconfig-support branch from cfb7fc7 to 35c025b Compare October 31, 2025 15:15
@doanac
doanac force-pushed the fioconfig-support branch 2 times, most recently from 6ee4c75 to e00bbe7 Compare October 31, 2025 15:46
This works just like the `fioconfig check-in` command

Signed-off-by: Andy Doan <andy@foundries.io>
This allows secrets to be extracted earlier in the boot for services
that may need them before fioup daemon is up and running.

Signed-off-by: Andy Doan <andy@foundries.io>
This mimicks the same handy feature included in fioconfig.

Signed-off-by: Andy Doan <andy@foundries.io>
Signed-off-by: Andy Doan <andy@foundries.io>
This uses the same naming as the LmP so that fioctl and the WebUI will
work the same way regardless of the OTA client.

Signed-off-by: Andy Doan <andy@foundries.io>
If the command is run with a TTY, we'll assume the user is running
commands from the CLI and wants a more basic output.

If no TTY is present, we'll assume a daemon mode from a service where
structured logging would be preferred.

Example with TTY:
```
$ fioup check
ERROR: Unable to run lshw: error=exec: no command
2 [intel-corei7-64-lmp-2]

3 [intel-corei7-64-lmp-3]

8 [intel-corei7-64-lmp-8-debian-sway]
    telegraf-agent      hub.foundries.io/andy-debian-sway/telegraf-agent@sha256:f35401dbe539037b9a624bf74f5f3200b3fd2b2f86f922009720f2a82ac87cca

Current version: intel-corei7-64-lmp-8-debian-sway
You are running the latest version.

$ fioup daemon
Daemon starting: pid=276378
ERROR: Unable to run lshw: error=exec: no command
Extracting file: file=z-50-fioctl.toml
Extracting file: file=fioconfig-oneshot-diag
Extracting file: file=fioup-test
Extracting file: file=foo
Config on server has not changed
[1/5] Checking:ERROR: Error during update: error=failed at state Checking: latest target installation attempts has reached the limit (3)
Waiting before next check...: interval=1m0s
```

Example with no TTY:
```
$ fioup check 2>&1 | tee /dev/null
time=2025-10-23T21:59:46.963-05:00 level=ERROR msg="Unable to run lshw" error="exec: no command"
2 [intel-corei7-64-lmp-2]

3 [intel-corei7-64-lmp-3]

8 [intel-corei7-64-lmp-8-debian-sway]
    telegraf-agent      hub.foundries.io/andy-debian-sway/telegraf-agent@sha256:f35401dbe539037b9a624bf74f5f3200b3fd2b2f86f922009720f2a82ac87cca

Current version: intel-corei7-64-lmp-8-debian-sway
You are running the latest version.

$ fioup daemon 2>&1 | tee /dev/null
time=2025-10-23T22:03:52.462-05:00 level=INFO msg="Daemon starting" pid=276395
time=2025-10-23T22:03:52.462-05:00 level=ERROR msg="Unable to run lshw" error="exec: no command"
time=2025-10-23T22:03:52.463-05:00 level=INFO msg="Extracting file" file=z-50-fioctl.toml
time=2025-10-23T22:03:52.463-05:00 level=INFO msg="Extracting file" file=fioconfig-oneshot-diag
time=2025-10-23T22:03:52.463-05:00 level=INFO msg="Extracting file" file=fioup-test
time=2025-10-23T22:03:52.463-05:00 level=INFO msg="Extracting file" file=foo
time=2025-10-23T22:03:52.687-05:00 level=INFO msg="Config on server has not changed"
[1/5] Checking:time=2025-10-23T22:03:52.949-05:00 level=ERROR msg="Error during update" error="failed at state Checking: latest target installation attempts has reached the limit (3)"
time=2025-10-23T22:03:52.949-05:00 level=INFO msg="Waiting before next check..." interval=1m0s
```
Signed-off-by: Andy Doan <andy@foundries.io>
Before using fioconfig operations, we need to ensure we have permission
to extract files into the secrets directory. This command will produce
an error like:
```
$ ./bin/fioup config-extract
ERROR: Unable to create files in `secrets-dir`: open /run/secrets/.test-writeable: permission denied
```

Signed-off-by: Andy Doan <andy@foundries.io>
@doanac
doanac force-pushed the fioconfig-support branch from e00bbe7 to 49122a1 Compare October 31, 2025 16:04
@doanac

doanac commented Oct 31, 2025

Copy link
Copy Markdown
Member Author

rebased on latest main.

@doanac
doanac merged commit b350374 into main Oct 31, 2025
6 checks passed
@doanac
doanac deleted the fioconfig-support branch October 31, 2025 16:05
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