Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions veadk/integrations/ve_faas/ve_faas.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,20 @@ def _release_application(self, app_id: str):
url = cloud_resource["framework"]["url"]["system_url"]
return url
else:
logger.error(f"Release application failed: {full_response}")
logs = self._get_application_logs(app_id=app_id)
log_text = ""
for log_line in logs:
log_text += log_line.strip() + "\n"
logger.error(
f"Release application failed. Application ID: {app_id}, Status: {status}"
)
import re

logs = "\n".join(self._get_application_logs(app_id=app_id))
log_text = re.sub(
r'([{"\']?(key|secret|token|pass|auth|credential|access|api|ak|sk|doubao|volces|coze)[^"\'\s]*["\']?\s*[:=]\s*)(["\']?)([^"\'\s]+)(["\']?)|([A-Za-z0-9+/=]{20,})',
lambda m: f"{m.group(1)}{m.group(3)}******{m.group(5)}"
if m.group(1)
else "******",
logs,
flags=re.IGNORECASE,
)
raise Exception(f"Release application failed. Logs:\n{log_text}")

def _get_application_status(self, app_id: str):
Expand Down Expand Up @@ -294,10 +303,6 @@ def _update_function_code(

# Get application status and extract function info
status, full_response = self._get_application_status(app_id)
if status == "deploy_fail":
raise ValueError(
f"Cannot update failed application. Current status: {status}"
)

# Extract function name from application config
cloud_resource = full_response["Result"]["CloudResource"]
Expand Down