Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: aproxy arm/amd revision fix #204

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand All @@ -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_ARM_REVISION if arch == ARCH.ARM64 else APROXY_AMD_REVISION,
)
]
)

# The LXD instance is meant to run untrusted workload. Hardcoding the tmp directory should
# be fine.
Expand Down
Loading