Compare commits

...
3 Commits
Author SHA1 Message Date
Andrew Beveridge 5e46cf57fb fix(infra): fix Pulumi alert policy API typos
- AlertPolicyConditionConditionAbsenceArgs -> AlertPolicyConditionConditionAbsentArgs
- autoClose minimum is 30 minutes (1800s), not 10 minutes
2025-12-22 02:15:53 -05:00
Andrew Beveridge ed3e6ae039 fix(infra): add Cloud Build IAM permission to deploy as backend SA
Cloud Build compute service account needs iam.serviceAccountUser role on
the karaoke-backend service account to deploy Cloud Run services.

Without this, Cloud Build fails with:
  PERMISSION_DENIED: Permission 'iam.serviceaccounts.actAs' denied on
  service account karaoke-backend@nomadkaraoke.iam.gserviceaccount.com
2025-12-22 02:13:12 -05:00
Andrew Beveridge 4fe7d84789 Bump version for re-deployment (retry after transient CI failure) 2025-12-22 02:11:38 -05:00
2 changed files with 14 additions and 4 deletions

No files matched your search

+13 -3
View File
@@ -131,6 +131,16 @@ cloudbuild_logging_iam = gcp.projects.IAMMember(
member=f"serviceAccount:{project.number}-compute@developer.gserviceaccount.com",
)
# Grant Cloud Build compute service account permission to deploy as karaoke-backend SA
# This is required for Cloud Build to deploy Cloud Run services that use the backend service account
# Without this, gcloud run deploy fails with: PERMISSION_DENIED: Permission 'iam.serviceaccounts.actAs' denied
cloudbuild_deploy_as_backend = gcp.serviceaccount.IAMMember(
"cloudbuild-deploy-as-backend",
service_account_id=service_account.name,
role="roles/iam.serviceAccountUser",
member=f"serviceAccount:{project.number}-compute@developer.gserviceaccount.com",
)
# ==================== GitHub Actions Deployer Service Account ====================
# This service account is used by GitHub Actions CI/CD via Workload Identity Federation
@@ -878,11 +888,11 @@ service_unavailable_alert = gcp.monitoring.AlertPolicy(
conditions=[
gcp.monitoring.AlertPolicyConditionArgs(
display_name="No healthy instances",
condition_absence=gcp.monitoring.AlertPolicyConditionConditionAbsenceArgs(
condition_absent=gcp.monitoring.AlertPolicyConditionConditionAbsentArgs(
filter='resource.type="cloud_run_revision" AND resource.labels.service_name="karaoke-backend" AND metric.type="run.googleapis.com/container/instance_count"',
duration="300s", # Alert if no instances for 5 minutes
aggregations=[
gcp.monitoring.AlertPolicyConditionConditionAbsenceAggregationArgs(
gcp.monitoring.AlertPolicyConditionConditionAbsentAggregationArgs(
alignment_period="60s",
per_series_aligner="ALIGN_MEAN",
cross_series_reducer="REDUCE_SUM",
@@ -892,7 +902,7 @@ service_unavailable_alert = gcp.monitoring.AlertPolicy(
),
],
alert_strategy=gcp.monitoring.AlertPolicyAlertStrategyArgs(
auto_close="600s",
auto_close="1800s", # Minimum 30 minutes required by GCP
),
documentation=gcp.monitoring.AlertPolicyDocumentationArgs(
content="Karaoke backend service appears to be down - no healthy Cloud Run instances detected.\n\nImmediate actions:\n1. Check Cloud Run logs for crash reasons\n2. Verify recent deployments\n3. Check external dependencies (Modal, AudioShake)\n\nService URL: https://api.nomadkaraoke.com/api/health",
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-gen"
version = "0.75.1"
version = "0.75.2"
description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens."
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
license = "MIT"