4242)
4343from veadk .cli .studio_release import (
4444 DEFAULT_RELEASE_PREFIX ,
45+ STUDIO_RELEASE_REGION ,
4546 StudioReleaseError ,
4647 StudioReleaseManifest ,
4748 StudioReleaseStore ,
@@ -85,7 +86,7 @@ class StudioUpdateSettings:
8586 """Immutable identifiers required to update the current Studio."""
8687
8788 bucket : str
88- region : str
89+ deployment_region : str
8990 prefix : str
9091 application_id : str
9192 function_id : str
@@ -96,7 +97,11 @@ def from_env(cls) -> StudioUpdateSettings:
9697 """Load self-update settings injected during Studio deployment."""
9798 return cls (
9899 bucket = os .getenv ("VEADK_STUDIO_UPDATE_BUCKET" , "" ).strip (),
99- region = os .getenv ("VEADK_STUDIO_UPDATE_REGION" , "cn-beijing" ).strip (),
100+ deployment_region = (
101+ os .getenv ("VEADK_STUDIO_DEPLOY_REGION" )
102+ or os .getenv ("AGENTKIT_SANDBOX_REGION" )
103+ or "cn-beijing"
104+ ).strip (),
100105 prefix = os .getenv (
101106 "VEADK_STUDIO_UPDATE_PREFIX" , DEFAULT_RELEASE_PREFIX
102107 ).strip (),
@@ -110,7 +115,7 @@ def enabled(self) -> bool:
110115 """Whether this deployment has all required immutable identifiers."""
111116 return bool (
112117 self .bucket
113- and self .region
118+ and self .deployment_region
114119 and self .prefix
115120 and self .application_id
116121 and self .function_id
@@ -362,7 +367,7 @@ def submit_version(self, version: str | None) -> StudioReleaseManifest:
362367 access_key = access_key ,
363368 secret_key = secret_key ,
364369 session_token = session_token or "" ,
365- region = self ._settings .region ,
370+ region = self ._settings .deployment_region ,
366371 project_name = self ._settings .project ,
367372 )
368373 self ._set_progress ("submitting" , "正在提交 VeFaaS Function 更新" )
@@ -443,7 +448,7 @@ def _record_failure(
443448 (
444449 f"errorId={ self ._error_id } " ,
445450 f"stage={ failure_stage } " ,
446- f"region={ self ._settings .region } " ,
451+ f"region={ self ._settings .deployment_region } " ,
447452 f"project={ self ._settings .project } " ,
448453 f"applicationId={ self ._settings .application_id } " ,
449454 f"functionId={ self ._settings .function_id } " ,
@@ -485,7 +490,7 @@ def _status_failure_payload(
485490 * self ._diagnostic_lines ,
486491 f"errorId={ error_id } " ,
487492 f"stage={ stage } " ,
488- f"region={ self ._settings .region } " ,
493+ f"region={ self ._settings .deployment_region } " ,
489494 f"project={ self ._settings .project } " ,
490495 f"applicationId={ self ._settings .application_id } " ,
491496 f"functionId={ self ._settings .function_id } " ,
@@ -537,7 +542,7 @@ def _load_vefaas_logs(self, revision_number: int = 0) -> list[str]:
537542 access_key = access_key ,
538543 secret_key = secret_key ,
539544 session_token = session_token or "" ,
540- region = self ._settings .region ,
545+ region = self ._settings .deployment_region ,
541546 project_name = self ._settings .project ,
542547 )
543548 raw_lines = service ._get_application_logs (
@@ -561,11 +566,11 @@ def _load_vefaas_logs(self, revision_number: int = 0) -> list[str]:
561566
562567 def _console_url (self ) -> str :
563568 """Return the fixed VeFaaS Function console URL for this Studio."""
564- if not self ._settings .region or not self ._settings .function_id :
569+ if not self ._settings .deployment_region or not self ._settings .function_id :
565570 return ""
566571 return (
567572 "https://console.volcengine.com/vefaas/"
568- f"region:vefaas+{ self ._settings .region } /function/detail/"
573+ f"region:vefaas+{ self ._settings .deployment_region } /function/detail/"
569574 f"{ self ._settings .function_id } "
570575 )
571576
@@ -578,7 +583,7 @@ def _application_status(self) -> tuple[str, str, int, bool]:
578583 access_key = access_key ,
579584 secret_key = secret_key ,
580585 session_token = session_token or "" ,
581- region = self ._settings .region ,
586+ region = self ._settings .deployment_region ,
582587 project_name = self ._settings .project ,
583588 )
584589 status , response = service ._get_application_status (
@@ -662,7 +667,7 @@ def _store(
662667 ) -> StudioReleaseStore :
663668 return StudioReleaseStore (
664669 bucket = self ._settings .bucket ,
665- region = self . _settings . region ,
670+ region = STUDIO_RELEASE_REGION ,
666671 prefix = self ._settings .prefix ,
667672 access_key = access_key ,
668673 secret_key = secret_key ,
0 commit comments