Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic driver to map command calls to shell or shell in container calls. #155

Open
mangelajo opened this issue Oct 24, 2024 · 3 comments
Open

Comments

@mangelajo
Copy link
Member

mangelajo commented Oct 24, 2024

The exporter configuration would look like this:

export:
  power:
    type: jumpstarter.drivers.shell.driver.Shell
    config:
       methods:
          on: "/usr/bin/power on"
          off: "/usr/bin/power off"
          free: "free -h"
          multiline_params: >
             echo "hi,"
             echo "I am a multi-line script"
             echo "I accept parameters ${1} ${2}"
@mangelajo mangelajo converted this from a draft issue Oct 24, 2024
@mangelajo mangelajo assigned mangelajo and NickCao and unassigned mangelajo Oct 24, 2024
@mangelajo
Copy link
Member Author

@NickCao, please explain in the description :)

@NickCao
Copy link
Collaborator

NickCao commented Oct 24, 2024

children:
  power:
    type: jumpstarter.drivers.command.driver.Command
    config:
      on: ["./power_on.sh"]
      off: ["./power_off.sh"]

@mangelajo
Copy link
Member Author

mangelajo commented Oct 25, 2024

What do you think about making it shell-specific instead, so we could run shell commands instead of
just binaries?

Command makes it look very generic, may be Shell is more specific? WDYT?

Also some additional ideas,so we can pass arguments, and another layer so, later in time
we have room for extensibility (i.e. providing other config arguments like shell interpreter or anything like that)

export:
  power:
    type: jumpstarter.drivers.shell.driver.Shell
    config:
       methods:
          on: "/usr/bin/power on"
          off: "/usr/bin/power off"
          free: "free -h"
          multiline_params: >
             echo "hi,"
             echo "I am a multi-line script"
             echo "I accept parameters ${1} ${2}"

@mangelajo mangelajo moved this from Future ideas to Todo in Jumpstarter planning Dec 5, 2024
@mangelajo mangelajo assigned mangelajo and unassigned NickCao and mangelajo Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants