Skip to content

Commit

Permalink
qemu: pass task resources into driver for cgroup setup
Browse files Browse the repository at this point in the history
As part of the work for 1.7.0 we moved portions of the task cgroup setup down
into the executor. This requires that the executor constructor get the
`TaskConfig.Resources` struct, and this was missing from the `qemu` driver. We
fixed a panic caused by this change in #19089 before we shipped, but this fix
was effectively undo after we added plumbing for custom cgroups for `raw_exec`
in 1.8.0. As a result, running `qemu` tasks always fail on Linux.

This was undetected in testing because our CI environment doesn't have QEMU
installed. I've got all the unit tests running locally again and have added QEMU
installation when we're running the drivers tests.

Fixes: #23250
  • Loading branch information
tgross committed Jul 1, 2024
1 parent 863d42b commit 96c7f1d
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 106 deletions.
3 changes: 3 additions & 0 deletions .changelog/23466.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
qemu: Fixed a bug that prevented `qemu` tasks from running on Linux
```
5 changes: 5 additions & 0 deletions .github/workflows/test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: hashicorp/setup-golang@v3

- name: Install optional dependencies
if: ${{ matrix.groups == 'drivers' }}
run: sudo apt install qemu-system

- name: Run Matrix Tests
env:
GOTEST_GROUP: ${{matrix.groups}}
Expand Down
1 change: 1 addition & 0 deletions drivers/qemu/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive
StdoutPath: cfg.StdoutPath,
StderrPath: cfg.StderrPath,
NetworkIsolation: cfg.NetworkIsolation,
Resources: cfg.Resources.Copy(),
}
ps, err := execImpl.Launch(execCmd)
if err != nil {
Expand Down
Loading

0 comments on commit 96c7f1d

Please sign in to comment.