gcp-cloud-run
Serverless-Anwendungen auf GCP Cloud Run bereitstellen
Das Erstellen produktionsreifer serverloser Apps auf GCP ist komplex mit vielen Konfigurationsoptionen. Diese Skill vermittelt bewährte Muster für Cloud Run-Services, Functions, Cold-Start-Optimierung und ereignisgesteuerte Architekturen.
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "gcp-cloud-run". Deploy a containerized API to Cloud Run with 512Mi memory and 1 CPU
النتيجة المتوقعة:
gcloud run deploy my-api --image gcr.io/project-id/my-api:v1 --region us-central1 --platform managed --memory 512Mi --cpu 1 --min-instances 0 --max-instances 100 --allow-unauthenticated
استخدام "gcp-cloud-run". Optimize Cloud Run service for low-latency responses
النتيجة المتوقعة:
Angewendete Cold-Start-Optimierungen: CPU-Boost aktiviert, min-instances auf 1 gesetzt, Speicher auf 1Gi für schnelleren Start erhöht, Lazy Loading für BigQuery-Client implementiert und Concurrency auf 80 für ausgewogenen Durchsatz konfiguriert.
التدقيق الأمني
آمنStatic analyzer detected 43 potential issues but all are false positives. The SKILL.md file contains documentation and code examples (Dockerfiles, JavaScript, YAML, bash) for GCP Cloud Run deployment patterns, not executable code. External command detections are gcloud CLI examples in markdown code blocks. Environment variable access is standard Node.js PORT configuration for Cloud Run. No actual security risks present.
درجة الجودة
ماذا يمكنك بناءه
Web-API-Bereitstellung
Bereitstellung einer Node.js Express-API auf Cloud Run mit automatischer Skalierung, Health Checks und Graceful-Shutdown-Handling.
Ereignisgesteuerte Verarbeitung
Erstellung von Cloud Run Functions, die durch Pub/Sub-Nachrichten oder Cloud Storage-Uploads für asynchrone Datenverarbeitungs-Workflows ausgelöst werden.
Kostenoptimierte Services
Konfiguration von Cloud Run mit richtig dimensionierten Ressourcen, minimalen Instanzen und CPU-Boost für latenzkritische Anwendungen mit Budgetbeschränkungen.
جرّب هذه الموجهات
Help me deploy a Node.js Express application to Google Cloud Run. I have a Dockerfile ready. Guide me through the gcloud commands to build, push, and deploy the container with appropriate memory and CPU settings.
Create a Cloud Run Function that triggers when a file is uploaded to a Cloud Storage bucket. The function should process CSV files and load the data into BigQuery. Include error handling and logging.
My Cloud Run service has 2-3 second cold start latency affecting user experience. Analyze my deployment configuration and recommend specific settings for minimum instances, CPU boost, memory, and code-level optimizations to reduce cold starts.
Design a Cloud Build pipeline that automatically deploys my application to Cloud Run on every git push to main. Include multi-stage Docker builds, security scanning, staging deployment with manual approval, and production rollout with traffic splitting.
أفضل الممارسات
- Verwenden Sie Multi-Stage-Docker-Builds mit distroless-Basis-Images, um Container-Größe und Angriffsfläche zu reduzieren
- Legen Sie angemessene Concurrency-Werte basierend auf den Speicher- und CPU-Anforderungen Ihrer Anwendung fest
- Implementieren Sie Health-Check-Endpunkte und Graceful-Shutdown-Handler für zuverlässige Bereitstellungen
تجنب
- Ausführung CPU-intensiver Workloads ohne Concurrency auf 1 zu setzen, was andere Requests aushungert
- Schreiben großer Dateien in das /tmp-Verzeichnis, was Speicher verbraucht und OOM-Fehler verursacht
- Starten von Hintergrundtasks, die nach dem Senden der Antwort weiterlaufen, da die CPU im Leerlauf gedrosselt wird