From e9c28c781c340be8e0dbc93bf87d96f810e8d927 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Mon, 22 Jan 2024 15:12:32 +0800 Subject: [PATCH 1/2] fix: aproxy arm/amd revision fix --- src/runner.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/runner.py b/src/runner.py index 6ca6d9e5f..598b76d85 100644 --- a/src/runner.py +++ b/src/runner.py @@ -45,6 +45,9 @@ LXD_PROFILE_YAML = LXD_PROFILE_YAML.parent / "lxd-profile.yml" LXDBR_DNSMASQ_LEASES_FILE = Path("/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases") +APROXY_ARM_REVISION = 9 +APROXY_AMD_REVISION = 8 + class Snap(NamedTuple): """This class represents a snap installation.""" @@ -151,7 +154,7 @@ def create(self, config: CreateRunnerConfig): # Wait some initial time for the instance to boot up time.sleep(60) self._wait_boot_up() - self._install_binaries(config.binary_path) + self._install_binaries(config.binary_path, config.arch) self._configure_runner() self._register_runner( @@ -467,7 +470,7 @@ def _wait_boot_up(self) -> None: logger.info("Finished booting up LXD instance for runner: %s", self.config.name) @retry(tries=10, delay=10, max_delay=120, backoff=2, local_logger=logger) - def _install_binaries(self, runner_binary: Path) -> None: + def _install_binaries(self, runner_binary: Path, arch: ARCH) -> None: """Install runner binary and other binaries. Args: @@ -479,7 +482,15 @@ def _install_binaries(self, runner_binary: Path) -> None: if self.instance is None: raise RunnerError("Runner operation called prior to runner creation.") - self._snap_install([Snap(name="aproxy", channel="edge", revision=6)]) + self._snap_install( + [ + Snap( + name="aproxy", + channel="edge", + revision=APROXY_AMD_REVISION if arch == ARCH.X64 else APROXY_ARM_REVISION, + ) + ] + ) # The LXD instance is meant to run untrusted workload. Hardcoding the tmp directory should # be fine. From 8b253c74e5e55e464735ac391528dc87cd93bf03 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Mon, 22 Jan 2024 15:16:50 +0800 Subject: [PATCH 2/2] chore: switch default arm/amd selection --- src/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner.py b/src/runner.py index 598b76d85..5fa84deab 100644 --- a/src/runner.py +++ b/src/runner.py @@ -487,7 +487,7 @@ def _install_binaries(self, runner_binary: Path, arch: ARCH) -> None: Snap( name="aproxy", channel="edge", - revision=APROXY_AMD_REVISION if arch == ARCH.X64 else APROXY_ARM_REVISION, + revision=APROXY_ARM_REVISION if arch == ARCH.ARM64 else APROXY_AMD_REVISION, ) ] )