Skip to content

Commit

Permalink
github: runner: add spec2006
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Nov 27, 2024
1 parent 0a6beaa commit ce26853
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/runner-service.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# build example: `nix-build runner-service.nix --argstr spec2006src /nfs/share/home/spec2006.tar.gz`
{ pkgs ? import <nixpkgs> {}
, spec2006src
}: let
name = "runner-deterload";
runner = import (pkgs.fetchFromGitHub {
owner = "xieby1";
repo = "nix_config";
rev = "402ff6218615ca8ee61dc9a5e9147d1504fd8919";
hash = "sha256-AEUkkkcj6has+1RD7eFvRsH6gZB5PzYjU8Dn/30LDqA=";
} + "/scripts/pkgs/github-runner.nix") {
inherit pkgs;
podmanExtraOpts = ["-v ${spec2006src}:${spec2006src}:ro"];
};
in pkgs.writeTextFile {
name = "${name}.service";
text = ''
# Usage:
# 1. Copy this file to ~/.config/systemd/user/${name}.service
# 2. Replace [token](https://github.com/OpenXiangShan/Deterload/settings/actions/runners/new) below
# 3. Start this service: `systemctl --user start ${name}.service
# *. Inspect the status of this service: `systemctl --user status ${name}.service`
# *. Inspect the output of this service: `journalctl --user -f -u ${name}.service`
[Install]
WantedBy=default.target
[Service]
ExecStart=${runner}/bin/github-runner-nix --labels 'self-hosted,Linux,X64,nix' --ephemeral --url https://github.com/OpenXiangShan/Deterload --token <REPLACE_YOUR_TOKEN_HERE>
Restart=always
[Unit]
After=network.target
Description=Auto start ${name}
'';
}
1 change: 1 addition & 0 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: nix-build -A openblas
- run: nix-build -A spec2006 --arg src /nfs/share/home/spec2006.tar.gz -j29

0 comments on commit ce26853

Please sign in to comment.