Skip to content

Ability to run multiple commands in a coder_agent #2629

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

Closed
phorcys420 opened this issue Jun 24, 2022 · 4 comments
Closed

Ability to run multiple commands in a coder_agent #2629

phorcys420 opened this issue Jun 24, 2022 · 4 comments

Comments

@phorcys420
Copy link
Member

I would like a clean way to run multiple commands. Currently I have to do the following:

resource "coder_agent" "dev" {
  startup_script = "command1; command2"
}

it does work but it isn't really nice (especially when you want to run something on the code-server host, it just feels improper).

My proposal would a list containing the commands:

resource "coder_agent" "dev" {
  startup_script = ["command1", "command2"]
}

also, maybe a way to group tasks too ?

resource "coder_agent" "dev" {
  startup_script = {
    taskname = ["command1", "command2"]
  }
}

(or maybe with taskname being an object containing {commands = ["command1", "command2"], needed = true}, that way we can completely error if a needed = true scripts fail, and just warn the user somehow if a needed = false script fails)
that way we could identify scripts that cause errors ? (just dropping ideas here about what I think would be nice)

@ketang
Copy link
Contributor

ketang commented Jun 24, 2022

Hi, @phorcys420 . Obviously you're familiar with this mechanism and aware that you could create your own script. Could you describe how that method falls short in your use case?

@phorcys420
Copy link
Member Author

it's not really failing, i'm just saying it looks out of place, + I was told to file an issue because this could be a nice feature. And the named-script with optional parameter would be nice, this issue only exists because it would be dope to have OOTB.

@kylecarbs
Copy link
Member

I think this should be the job of another utility like concurrently. We'll want to show these logs in the UI with #2957, and it gets a bit messy if we start having N number of logs instead of zero or one.

@kylecarbs kylecarbs closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2022
@phorcys420
Copy link
Member Author

As an update, I started making servics using supervisord to split out tasks.

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

No branches or pull requests

3 participants