Skip to content

Commit 6e41092

Browse files
authored
Fix/compare version (#57)
* fix compare version if provider and node is prefix * right way to remove prefix * remove specific versions while upgrading for hostname and inventory * code correction
1 parent 7275dc8 commit 6e41092

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

application/service/provider_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def _check_akash_node_readiness(self, ssh_client, task_id: str):
343343
redis_client = get_redis_client()
344344
try:
345345
# First check if pod is running
346-
pod_timeout = 600 # 10 minutes
346+
pod_timeout = 1800 # 30 minutes
347347
sync_timeout = 6000 # 100 minutes
348348
check_interval = 10 # Check every 10 seconds
349349
start_time = time.time()

application/service/upgrade_service.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,17 @@ async def upgrade_network(self, ssh_client, task_id: str) -> Dict:
218218
# Upgrade akash-node deployment
219219
log.info(f"Upgrading akash-node to version {app_version}...")
220220
if app_needs_upgrade:
221+
run_ssh_command(
222+
ssh_client,
223+
"helm -n akash-services uninstall akash-node",
224+
True,
225+
task_id=task_id,
226+
)
221227
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}"
228+
# Install a fresh akash-node release with desired version
229+
upgrade_command = f"helm -n akash-services install akash-node akash/akash-node --set image.tag={app_version}"
223230
else:
224-
upgrade_command = f"helm upgrade --install akash-node akash-dev/akash-node -n akash-services --set image.tag={app_version} --devel"
231+
upgrade_command = f"helm -n akash-services install akash-node akash-dev/akash-node --set image.tag={app_version} --devel"
225232
else:
226233
upgrade_command = (
227234
"kubectl delete pod -n akash-services -l app=akash-node"
@@ -318,12 +325,12 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
318325

319326
# Upgrade hostname operator
320327
log.info("Upgrading hostname operator...")
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"
328+
akash_hostname_operator_cmd = "helm -n akash-services upgrade akash-hostname-operator akash/akash-hostname-operator" if Config.CHAIN_ID == "akashnet-2" else "helm -n akash-services upgrade akash-hostname-operator akash-dev/akash-hostname-operator --devel"
322329
run_ssh_command(ssh_client, akash_hostname_operator_cmd, True, task_id=task_id)
323330

324331
# Upgrade inventory operator
325332
log.info("Upgrading inventory operator...")
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"
333+
akash_inventory_operator_cmd = "helm -n akash-services upgrade inventory-operator akash/akash-inventory-operator" if Config.CHAIN_ID == "akashnet-2" else "helm -n akash-services upgrade inventory-operator akash-dev/akash-inventory-operator --devel"
327334
run_ssh_command(ssh_client, akash_inventory_operator_cmd, True, task_id=task_id)
328335

329336
# Update price script

0 commit comments

Comments
 (0)