From 08bfbf22bb1f8a275646d7dcc786b8a4ec68f592 Mon Sep 17 00:00:00 2001 From: CodeBuddy Attribution Bot Date: Wed, 29 Apr 2026 04:03:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(attribution):=20manageCloudRun=20=E9=9B=B6?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=83=A8=E7=BD=B2=E8=83=BD=E5=8A=9B=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=E4=B8=8D=E6=B8=85=E6=99=B0=EF=BC=8C=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BC=BA=E5=B0=91=20actionable=20=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=AF=BC=E8=87=B4=20Agent=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E7=A1=AE=E5=AE=8C=E6=88=90=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=20(issue=5Fmoj17gxm=5Fj5qv9w)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skills/cloudrun-development/SKILL.md | 66 ++++++++++++++++++- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/config/source/skills/cloudrun-development/SKILL.md b/config/source/skills/cloudrun-development/SKILL.md index a2cdc5ee..535cae9c 100644 --- a/config/source/skills/cloudrun-development/SKILL.md +++ b/config/source/skills/cloudrun-development/SKILL.md @@ -125,10 +125,47 @@ Use CloudBase Run when the task needs a deployed backend service rather than a s ## Access guidance -- **Web/public scenarios** -> enable WEB access intentionally and pair it with the right auth flow. +- **Web/public scenarios** -> enable PUBLIC access intentionally and pair it with the right auth flow. - **Mini Program** -> prefer internal direct connection and avoid unnecessary public exposure. - **Private/VPC scenarios** -> keep public access off unless the product requirement clearly needs it. +## Zero-config deployment + +CloudBase Run supports **zero-config deployment** - you can deploy without specifying `serverConfig`. The platform automatically detects and applies sensible defaults. + +### When to use zero-config + +- **Simple frontend or static sites** - HTML/CSS/JS projects without complex runtime requirements +- **Quick prototyping** - When you need to get something running fast +- **Standard Node.js apps** - When your project has a standard structure (package.json with start script) + +### How zero-config works + +When you omit `serverConfig`: +- **Service type**: Auto-detected (Dockerfile present → container, otherwise checks for Node.js patterns) +- **CPU/Memory**: Default values (0.25 CPU, 0.5 GB memory) +- **Access**: Default access type applied +- **Port**: Container mode uses platform default, Function mode uses 3000 + +### Zero-config deploy example + +```json +{ + "action": "deploy", + "serverName": "my-frontend-app", + "targetPath": "/abs/ws/my-project" +} +``` + +### When explicit config is needed + +Use explicit `serverConfig` when: +- You need specific CPU/memory resources +- You need public web access (`OpenAccessTypes: ["PUBLIC"]`) +- You need specific scaling behavior (MinNum/MaxNum) +- You need custom environment variables +- You have specific port or Dockerfile requirements + ## Quick examples ### Initialize @@ -143,7 +180,17 @@ Use CloudBase Run when the task needs a deployed backend service rather than a s { "action": "run", "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "runOptions": { "port": 3000 } } ``` -### Deploy +### Deploy with zero-config (recommended for simple projects) + +```json +{ + "action": "deploy", + "serverName": "my-frontend-app", + "targetPath": "/abs/ws/my-project" +} +``` + +### Deploy with explicit config (when you need control) ```json { @@ -151,7 +198,7 @@ Use CloudBase Run when the task needs a deployed backend service rather than a s "serverName": "my-svc", "targetPath": "/abs/ws/my-svc", "serverConfig": { - "OpenAccessTypes": ["WEB"], + "OpenAccessTypes": ["PUBLIC"], "Cpu": 0.5, "Mem": 1, "MinNum": 1, @@ -176,3 +223,16 @@ Use CloudBase Run when the task needs a deployed backend service rather than a s - **Deployment failure** -> inspect Dockerfile, build logs, and CPU/memory ratio. - **Local run failure** -> remember only Function mode is supported by local-run tools. - **Performance issues** -> reduce dependencies, optimize initialization, and tune minimum instances. + +## Deployment failure recovery + +When deployment fails, follow these steps: + +1. **Check deployment log**: Use `queryCloudRun(action="getDeployLog", detailServerName="")` to get detailed error messages +2. **Common failure causes**: + - Missing Dockerfile for container mode + - Invalid package.json or missing dependencies + - Port mismatch (app not listening on expected port) + - Resource constraints (CPU/memory ratio must be 1:2) +3. **Retry after fix**: Use `manageCloudRun(action="deploy", ...)` again after fixing the issue +4. **Monitor status**: Use `queryCloudRun(action="detail", detailServerName="")` to check deployment status