@@ -68,9 +68,21 @@ async def check_upgrade_status(self, ssh_client) -> Dict:
6868 """
6969
7070 def get_versions ():
71- node_app_version , node_chart_version = self ._get_helm_release_versions (
72- ssh_client , "node"
73- )
71+ # For mainnet (akashnet-2), get versions from helm release
72+ # For other networks, use configured versions since node is not deployed
73+ is_mainnet = Config .CHAIN_ID == "akashnet-2"
74+
75+ # Get node versions
76+ if is_mainnet :
77+ node_app_version , node_chart_version = self ._get_helm_release_versions (
78+ ssh_client , "node"
79+ )
80+ else :
81+ # For non-mainnet, use configured versions since node is not deployed
82+ node_app_version = Config .AKASH_VERSION
83+ node_chart_version = Config .AKASH_NODE_HELM_CHART_VERSION
84+
85+ # Get provider versions
7486 provider_app_version , provider_chart_version = (
7587 self ._get_helm_release_versions (ssh_client , "provider" )
7688 )
@@ -175,17 +187,19 @@ async def upgrade_network(self, ssh_client, task_id: str) -> Dict:
175187 # Delete the pod to trigger upgrade
176188 # Update Helm repositories
177189 log .info ("Updating Helm repositories..." )
190+ helm_repo_cmd = "helm repo update akash" if Config .CHAIN_ID == "akashnet-2" else "helm repo update akash-dev"
178191 stdout , stderr = run_ssh_command (
179192 ssh_client ,
180- "helm repo update akash" ,
193+ helm_repo_cmd ,
181194 True ,
182195 task_id = task_id ,
183196 )
184197 # Update Helm repositories
185198 log .info ("Verifying akash-node chart availability..." )
199+ helm_search_cmd = "helm search repo akash-node" if Config .CHAIN_ID == "akashnet-2" else "helm search repo akash-dev --devel"
186200 stdout , stderr = run_ssh_command (
187201 ssh_client ,
188- "helm search repo akash-node" ,
202+ helm_search_cmd ,
189203 True ,
190204 task_id = task_id ,
191205 )
@@ -204,7 +218,10 @@ async def upgrade_network(self, ssh_client, task_id: str) -> Dict:
204218 # Upgrade akash-node deployment
205219 log .info (f"Upgrading akash-node to version { app_version } ..." )
206220 if app_needs_upgrade :
207- upgrade_command = f"helm upgrade --install akash-node akash/akash-node -n akash-services --set image.tag={ app_version } "
221+ if Config .CHAIN_ID == "akashnet-2" :
222+ upgrade_command = f"helm upgrade --install akash-node akash/akash-node -n akash-services --set image.tag={ app_version } "
223+ else :
224+ upgrade_command = f"helm upgrade --install akash-node akash-dev/akash-node -n akash-services --set image.tag={ app_version } --devel"
208225 else :
209226 upgrade_command = (
210227 "kubectl delete pod -n akash-services -l app=akash-node"
@@ -267,17 +284,19 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
267284
268285 # Update Helm repositories
269286 log .info ("Updating Helm repositories..." )
287+ helm_repo_cmd = "helm repo update akash" if Config .CHAIN_ID == "akashnet-2" else "helm repo update akash-dev"
270288 stdout , stderr = run_ssh_command (
271289 ssh_client ,
272- "helm repo update akash" ,
290+ helm_repo_cmd ,
273291 True ,
274292 task_id = task_id ,
275293 )
276294
277295 log .info (f"Upgrading provider to version { app_version } ..." )
296+ helm_search_cmd = "helm search repo provider" if Config .CHAIN_ID == "akashnet-2" else "helm search repo provider --devel"
278297 stdout , stderr = run_ssh_command (
279298 ssh_client ,
280- "helm search repo provider" ,
299+ helm_search_cmd ,
281300 True ,
282301 task_id = task_id ,
283302 )
@@ -294,26 +313,18 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
294313
295314 # Backup existing values
296315 log .info ("Backing up helm values..." )
297- backup_cmd = "cd /root/provider && for i in $(helm list -n akash-services -q | grep -vw akash-node); do helm -n akash-services get values $i > ${i}.pre-v0.8.2 .values; done"
316+ backup_cmd = "cd /root/provider && for i in $(helm list -n akash-services -q | grep -vw akash-node); do helm -n akash-services get values $i > ${i}.old .values; done"
298317 run_ssh_command (ssh_client , backup_cmd , True , task_id = task_id )
299318
300319 # Upgrade hostname operator
301320 log .info ("Upgrading hostname operator..." )
302- run_ssh_command (
303- ssh_client ,
304- f"helm -n akash-services upgrade akash-hostname-operator akash/akash-hostname-operator --set image.tag={ app_version } " ,
305- True ,
306- task_id = task_id ,
307- )
321+ akash_hostname_operator_cmd = f"helm -n akash-services upgrade akash-hostname-operator akash/akash-hostname-operator --set image.tag={ app_version } " if Config .CHAIN_ID == "akashnet-2" else f"helm -n akash-services upgrade akash-hostname-operator akash-dev/akash-hostname-operator --set image.tag={ app_version } --devel"
322+ run_ssh_command (ssh_client , akash_hostname_operator_cmd , True , task_id = task_id )
308323
309324 # Upgrade inventory operator
310325 log .info ("Upgrading inventory operator..." )
311- run_ssh_command (
312- ssh_client ,
313- f"helm -n akash-services upgrade inventory-operator akash/akash-inventory-operator --set image.tag={ app_version } " ,
314- True ,
315- task_id = task_id ,
316- )
326+ akash_inventory_operator_cmd = f"helm -n akash-services upgrade inventory-operator akash/akash-inventory-operator --set image.tag={ app_version } " if Config .CHAIN_ID == "akashnet-2" else f"helm -n akash-services upgrade inventory-operator akash-dev/akash-inventory-operator --set image.tag={ app_version } --devel"
327+ run_ssh_command (ssh_client , akash_inventory_operator_cmd , True , task_id = task_id )
317328
318329 # Update price script
319330 log .info ("Updating price script..." )
@@ -327,10 +338,14 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
327338
328339 # Upgrade provider chart
329340 log .info ("Upgrading provider chart..." )
330- provider_upgrade_cmd = (
331- "helm upgrade akash-provider akash/provider -n akash-services -f ~/provider/provider.yaml "
332- '--set bidpricescript="$(cat ~/provider/price_script_generic.sh | openssl base64 -A)"'
333- )
341+ if Config .CHAIN_ID == "akashnet-2" :
342+ provider_upgrade_cmd = (
343+ f"helm upgrade akash-provider akash/provider -n akash-services -f ~/provider/provider.yaml --set bidpricescript=\" $(cat ~/provider/price_script_generic.sh | openssl base64 -A)\" --set image.tag={ app_version } "
344+ )
345+ else :
346+ provider_upgrade_cmd = (
347+ f"helm upgrade akash-provider akash-dev/provider -n akash-services -f ~/provider/provider.yaml --set bidpricescript=\" $(cat ~/provider/price_script_generic.sh | openssl base64 -A)\" --set image.tag={ app_version } --devel"
348+ )
334349 run_ssh_command (ssh_client , provider_upgrade_cmd , True , task_id = task_id )
335350
336351 # Verify pod versions
0 commit comments