Giter Club home page Giter Club logo

assisted-agent-simulator's Introduction

This project simulates the flow of an assisted installer agent and allows easy troubleshooting of commands:

  1. agent is an executable that starts a command-runner. It must run with sudo on the host.
  2. command-runner is an executable packaged as a container that periodically polls a command-server and executes the command received from it via nsenter. The command can be another Podman command.
  3. 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.

Build

make build

Run

  1. Update commands.json with the commands you want to run.
  2. Start all the three components with make run, or POLLING_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.

Stop

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.

Container Runtime

This project requires Podman. Make sure you do not have Docker installed on the same machine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.