Skip to content

Commit 6ef1883

Browse files
authored
Fix/node check issue (#59)
* sync_info key change * upgrade helm chart version individual
1 parent af2d003 commit 6ef1883

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

application/config/config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ class Config:
2525
"https://raw.githubusercontent.com/akash-network/provider-configs/main/devices/pcie/gpus.json",
2626
)
2727
KEYRING_BACKEND = environ.get("KEYRING_BACKEND", "file")
28-
AKASH_VERSION = environ.get("AKASH_VERSION", "v0.38.1")
28+
AKASH_VERSION = environ.get("AKASH_VERSION", "v1.0.0")
2929
AKASH_NODE_HELM_CHART_VERSION = environ.get(
30-
"AKASH_NODE_HELM_CHART_VERSION", "12.0.3"
30+
"AKASH_NODE_HELM_CHART_VERSION", "14.0.0"
3131
)
3232
INGRESS_NGINX_VERSION = environ.get("INGRESS_NGINX_VERSION", "4.11.3")
33-
PROVIDER_SERVICES_VERSION = environ.get("PROVIDER_SERVICES_VERSION", "v0.6.10")
33+
PROVIDER_SERVICES_VERSION = environ.get("PROVIDER_SERVICES_VERSION", "v0.10.1")
3434
PROVIDER_SERVICES_HELM_CHART_VERSION = environ.get(
35-
"PROVIDER_SERVICES_HELM_CHART_VERSION", "11.6.0"
35+
"PROVIDER_SERVICES_HELM_CHART_VERSION", "14.0.3"
3636
)
37+
PROVIDER_HOSTNAME_OPERATOR_VERSION = environ.get("PROVIDER_HOSTNAME_OPERATOR_VERSION", "v0.10.0")
38+
PROVIDER_INVENTORY_OPERATOR_VERSION = environ.get("PROVIDER_INVENTORY_OPERATOR_VERSION", "v0.10.0")
3739
PROVIDER_PRICE_SCRIPT_URL = environ.get(
3840
"PROVIDER_PRICE_SCRIPT_URL",
3941
"https://raw.githubusercontent.com/akash-network/helm-charts/main/charts/akash-provider/scripts/price_script_generic.sh",

application/service/upgrade_service.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
from typing import Dict, Tuple
55
from fastapi import status
6+
import time
67

78
from application.config.config import Config
89
from application.exception.application_error import ApplicationError
@@ -325,12 +326,14 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
325326

326327
# Upgrade hostname operator
327328
log.info("Upgrading hostname operator...")
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"
329+
hostname_operator_version = Config.PROVIDER_HOSTNAME_OPERATOR_VERSION.lstrip("v")
330+
akash_hostname_operator_cmd = f"helm -n akash-services upgrade akash-hostname-operator akash/akash-hostname-operator --set image.tag={hostname_operator_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={hostname_operator_version} --devel"
329331
run_ssh_command(ssh_client, akash_hostname_operator_cmd, True, task_id=task_id)
330332

331333
# Upgrade inventory operator
332334
log.info("Upgrading inventory operator...")
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"
335+
inventory_operator_version = Config.PROVIDER_INVENTORY_OPERATOR_VERSION.lstrip("v")
336+
akash_inventory_operator_cmd = f"helm -n akash-services upgrade inventory-operator akash/akash-inventory-operator --set image.tag={inventory_operator_version}" if Config.CHAIN_ID == "akashnet-2" else f"helm -n akash-services upgrade inventory-operator akash-dev/akash-inventory-operator --set image.tag={inventory_operator_version} --devel"
334337
run_ssh_command(ssh_client, akash_inventory_operator_cmd, True, task_id=task_id)
335338

336339
# Update price script
@@ -358,8 +361,11 @@ async def upgrade_provider(self, ssh_client, task_id: str) -> Dict:
358361
# Verify pod versions
359362
log.info("Verifying pod versions...")
360363
verify_cmd = "kubectl -n akash-services get pods -o custom-columns='NAME:.metadata.name,IMAGE:.spec.containers[*].image' | grep -v akash-node"
364+
log.info("Waiting for 20 seconds to allow pods to be upgraded...")
365+
time.sleep(20) # Wait for the pods to be upgraded
361366
stdout, _ = run_ssh_command(ssh_client, verify_cmd, True, task_id=task_id)
362367

368+
363369
if app_version not in stdout:
364370
raise ApplicationError(
365371
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,

0 commit comments

Comments
 (0)