This project simulates the flow of an assisted installer agent and allows easy troubleshooting of commands:
agent
is an executable that starts acommand-runner
. It must run withsudo
on the host.command-runner
is an executable packaged as a container that periodically polls acommand-server
and executes the command received from it viansenter
. The command can be another Podman command.command-server
is an HTTP server that loads commands from a JSON file passed via--commands-file
, and loops through them returning one command at a time.
make build
- Update commands.json with the commands you want to run.
- Start all the three components with
make run
, orPOLLING_INTERVAL=7s make run
to change the command polling interval (in Go duration format).
Keep in mind that the agent runs in the foreground, so you will have to open another terminal
window to interact with the command-runner
and command-server
.
When using make run
, the server will run as a container.
You can edit commands.json and make the system pick up the changes:
- If you run the
command-server
manually as an executable on the host (not as a container). - Using
make edit
target. In this case the server container will be restarted as soon as you exit the editor.
View the command execution log using sudo podman logs agent-simulator-command-runner
.
Run make stop
to stop and remove the containers.
The agent
will exit automatically as soon as the command-runner
terminates.
Keep in mind that commands that were sent to the agent and are still running will not be terminated.
This project requires Podman. Make sure you do not have Docker installed on the same machine.