coder / coder/internal

prototype `coder run` implementation

Open
#574 0 comments 0 reactions 1 assignee Claimed by @dannykopping View on GitHub
spike
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Consider a GitHub Actions workflow job: when it runs, it spins up a VM and then executes a series of scripts on it (steps). Once the job is done, it gets torn down.

We want to enable a similar use-case for `coder run`. Much like `docker run`, `coder run` should spin up a workspace (or attach to an existing one), execute a script, stream back the `std{out,err}` streams and show the exit code.

If we could run our CI jobs on templates which mirror our development environment, we could cut out a number of issues relating to OS, tool, version incompatibilities.

For this prototype, we need to knock together a quick-n-dirty implementation so we can experiment. The goal is to be able to run a GitHub Actions workflow and call out to `coder run` to execute things like `make test` or `make lint`.

This should leverage pre-builds.

It would be especially cool if we could keep the workspace around in the case of failure, so we could shell into it and see why the scripts failed, and rerun them until they work (in the precise env in which they failed initially).

---

Note:

Instead of claiming a prebuild for each _step_ (which would run `coder run`), maybe we could hook into GitHub Actions such that `runs-on` claims the prebuild and all steps execute on that same prebuild.

We should also use the existing `codersdk` for the execution of the scripts over SSH.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.