coder / coder/internal

investigate coder_script ordering methods

Aperta
#759 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
spike
Lingua principale
Nessun dato sulla lingua
Stelle
3
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Problem

We want to tackle [execution ordering for coder_script](https://github.com/coder/coder/issues/10352) in H2 2025. As discussed with the mango team, we need an engineer to investigate two potential options before committing to an RFC and timeline.

The outcome of this investigation should tell us for each approach:
- [ ] How long it would take a single engineer to ship a working MVP (above all else)
- [ ] Any existing tools that may be used to achieve the MVP
- [ ] Potential (major) technical hurdles associated in implementation

Then, it is the responsibility of product to:
- [ ] Identify potential limitations on the resulting user experience
- [ ] Reach out to customers on whether the proposed solutions solve their trouble
- [ ] investigate usage in telemetry

Option 1 optimizes for delivery while satisfying most use cases, and option 2 focuses on elegance and permanence.

### Option 1: Grouped execution ordering

In a `coder_script`, you may define an `execution_group` that determines the sequence in which scripts will be run. You may guarantee the s scripts in execution group `n>m` will run after others in group `m`. All scripts in a given group will run in parallel as they do today. The default group is `0`(?) for backward compatibility. This allows most scripts to be run in parallel, but still provides rudimentary ordering.

```terraform

resource "coder_script" "first_script" {
...
exec_group = 1
}

resource "coder_script" "second_script" {
...
exec_group = 2
}

resource "coder_script" "third_script" {
...
exec_group = 5 # gaps allowed
}
```

### Option 2: Signal based

We introduce new command line tools for sending or waiting on signals in bash like so:

```
coder script waitfor "mysignal"
coder script signal "mysignal"
```

Thus, the execution ordering is defined in the bash script, and signals can be hit/waited upon arbitrarily in the scripts. One drawback is that we can't parse the script ordering from Terraform easily. There is potential to use this outside of the agent context, but for the sake of this investigation we're only focused on `coder_script` utilization

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia leggendo l’issue collegata sull’ordine di esecuzione e gli esempi Terraform di coder_script. Analizza gli approcci all’esecuzione raggruppata e gli approcci CLI basati su segnali, documentando le stime MVP, gli strumenti esistenti e i principali ostacoli all’implementazione; il risultato deve essere un confronto adatto a una decisione RFC.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
bash, terraform
Ambito
cli, devops, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.