33
44"""Interface to the social network application from DeathStarBench"""
55
6- import platform
7-
86from aiopslab .service .helm import Helm
97from aiopslab .service .kubectl import KubeCtl
108from 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