From 7b06755893e3f9858ee3f0c31b3d1dec36a6a1dd Mon Sep 17 00:00:00 2001 From: Markus Keil Date: Mon, 15 Apr 2024 18:12:59 +0200 Subject: [PATCH] allow arm64 runners --- Program.cs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Program.cs b/Program.cs index d2bce4d..e049507 100644 --- a/Program.cs +++ b/Program.cs @@ -155,11 +155,26 @@ public static void Main(string[] args) string size = string.Empty; - foreach (string csize in Config.Sizes.Where(x => x.Arch == "x64").Select(x => x.Name)) + string arch = String.Empty; + foreach (var csize in Config.Sizes) { - if (labels.Contains(csize)) + + if (csize.Arch == "x64" && labels.Contains(csize.Name)) { - size = csize; + size = csize.Name; + arch = csize.Arch; + break; + } + if (csize.Arch == "x64" && labels.Contains($"{csize.Name}-x64")) + { + size = csize.Name; + arch = csize.Arch; + break; + } + if (csize.Arch == "arm64" && labels.Contains($"{csize.Name}-arm64")) + { + size = csize.Name; + arch = csize.Arch; break; } } @@ -186,8 +201,8 @@ public static void Main(string[] args) return; } - string newRunner = await cloud.CreateNewRunner("x64", size, runnerToken, orgName); - logger.LogInformation($"New Runner {newRunner} [{size}] entering pool."); + string newRunner = await cloud.CreateNewRunner(arch, size, runnerToken, orgName); + logger.LogInformation($"New Runner {newRunner} [{size} on {arch}] entering pool."); MachineCreatedCount.Labels(orgName, size).Inc(); QueuedJobCount.Labels(orgName, size).Inc();