Skip to content

Commit 317ffd9

Browse files
committed
Update arch check to check on node and not local.
1 parent d3bfc37 commit 317ffd9

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

aiopslab/service/apps/socialnet.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
"""Interface to the social network application from DeathStarBench"""
55

6-
import platform
7-
86
from aiopslab.service.helm import Helm
97
from aiopslab.service.kubectl import KubeCtl
108
from aiopslab.service.apps.base import Application
@@ -22,8 +20,6 @@ def __init__(self):
2220
)
2321
self.create_namespace()
2422
self.create_tls_secret()
25-
# Detect CPU architecture, we need to deploy media-frontend differently on arm
26-
self.is_arm = platform.machine().lower() in ["arm64", "aarch64"]
2723

2824
def load_app_json(self):
2925
super().load_app_json()
@@ -47,15 +43,22 @@ def create_tls_secret(self):
4743
print("TLS secret already exists. Skipping creation.")
4844

4945
def deploy(self):
50-
"""Deploy the Helm configurations."""
51-
if self.is_arm:
52-
# Update image to use arm build image
46+
"""Deploy the Helm configurations with architecture-aware image selection."""
47+
node_architectures = self.kubectl.get_node_architectures()
48+
is_arm = any(arch in ["arm64", "aarch64"] for arch in node_architectures)
49+
50+
if is_arm:
51+
# Use the ARM-compatible image for media-frontend
5352
if "extra_args" not in self.helm_configs:
5453
self.helm_configs["extra_args"] = []
55-
56-
self.helm_configs["extra_args"].append("--set media-frontend.container.image=jacksonarthurclark/media-frontend")
57-
self.helm_configs["extra_args"].append("--set media-frontend.container.imageVersion=latest")
58-
54+
55+
self.helm_configs["extra_args"].append(
56+
"--set media-frontend.container.image=jacksonarthurclark/media-frontend"
57+
)
58+
self.helm_configs["extra_args"].append(
59+
"--set media-frontend.container.imageVersion=latest"
60+
)
61+
5962
Helm.install(**self.helm_configs)
6063
Helm.assert_if_deployed(self.helm_configs["namespace"])
6164

0 commit comments

Comments
 (0)