Skip to content

Commit

Permalink
rollback kvm action commits
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-vtimofeenko committed Jan 26, 2024
1 parent 0661792 commit 9d30065
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Enable KVM group perms
# yamllint disable rule:line-length
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# yamllint enable rule:line-length

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix run .#buildAndPushToSpcs -- "ttydContainer"
Expand Down
24 changes: 20 additions & 4 deletions packages/ttydContainer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let
htop# Some monitoring
;
})
++ [ nixConfig ];
++ [ nixConfig fixUpEnv ];
in
pkgs.dockerTools.buildImage {
name = "ttyd-container";
Expand All @@ -69,9 +69,25 @@ pkgs.dockerTools.buildImage {
}) ++ commonPackages;
};

runAsRoot = ''
${pkgs.lib.getExe fixUpEnv}
'';
/* runAsRoot needs nix with `kvm`. This can be achieved with cachix action:
- uses: cachix/install-nix-action@vXX
with:
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
which might need udevadm action:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
source: https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
TODO: try with cachix and try with det sys action for the magic cache.
*/
# runAsRoot = "";

architecture = "amd64";

Expand Down

0 comments on commit 9d30065

Please sign in to comment.