bitcoin-dev-project / warnet

Monitor and analyze the emergent behaviors of Bitcoin networks
https://warnet.dev
MIT License
59 stars 27 forks source link

Build image from PR branch in graph file should use local native architecture #310

Closed pinheadmz closed 2 months ago

pinheadmz commented 2 months ago
diff --git a/src/backends/compose/compose_backend.py b/src/backends/compose/compose_backend.py
index 11f803c..7c6926e 100644
--- a/src/backends/compose/compose_backend.py
+++ b/src/backends/compose/compose_backend.py
@@ -19,6 +19,7 @@ from warnet.utils import (
     default_bitcoin_conf_args,
     parse_raw_messages,
     set_execute_permission,
+    get_architecture,
 )

 from .services import SERVICES
@@ -397,7 +398,7 @@ class ComposeBackend(BackendInterface):
                 LOCAL_REGISTRY,
                 branch,
                 tank.DEFAULT_BUILD_ARGS + tank.build_args,
-                arches="amd64",
+                arches=get_architecture(),
             )
             self.copy_configs(tank)
         elif tank.image:
--- a/src/warnet/utils.py
+++ b/src/warnet/utils.py
@@ -103,8 +103,6 @@ def get_architecture():
     """
     result = subprocess.run(["uname", "-m"], stdout=subprocess.PIPE)
     arch = result.stdout.decode("utf-8").strip()
-    if arch == "arm64":
-        arch = "aarch64"
     if arch is None:
         raise Exception("Failed to detect architecture.")
     return arch
willcl-ark commented 2 months ago

it's an ACK from me