Commit Graph
53 Commits
Author SHA1 Message Date
Andrew Beveridge aee2b48ffd Merge origin/main into feature/batch-5-flacfetch-audio-search
Resolved conflicts to combine:
- Batch 4 (YouTube URL input) from main
- Batch 5 (Flacfetch audio search) from this branch

Both features are now fully integrated:
- P2 (YouTube URLs): ✅ COMPLETE
- P3 (Flacfetch search): ✅ COMPLETE
- A1 (--auto-download): ✅ COMPLETE

remote_cli.py now supports:
- File upload mode (original)
- YouTube URL mode (from main)
- Audio search mode (from this branch)

Documentation updated to reflect both batches complete.
Version bumped to 0.71.42.
2025-12-11 20:10:03 -05:00
Andrew Beveridge 89cc9e9113 fix: Enable Cloud Tasks in deployment for scalable architecture
The scalable architecture (Cloud Tasks queues, IAM, infrastructure) was
deployed via Pulumi but never activated in the Cloud Run deployment.

Changes:
- Enable ENABLE_CLOUD_TASKS=true environment variable
- Set CLOUD_RUN_SERVICE_URL for Cloud Tasks callbacks
- Set GCP_REGION for queue location consistency
- Change concurrency from 4 to 1 for true container isolation
- Increase max-instances from 10 to 50 for higher throughput

This completes Phase 1 of the scalable architecture migration, ensuring
each job gets dedicated container resources with no contention.
2025-12-11 15:45:03 -05:00
Andrew Beveridge ☄️ db55205127 feat: Add Cloud Tasks infrastructure for scalable job processing (#18)
Complete scalable architecture implementation (Phase 1 & 2)

Phase 1 - Cloud Tasks Integration:
- Add idempotency checks to all worker endpoints
- Add ENABLE_CLOUD_TASKS and GCP_REGION settings
- Update WorkerService with Cloud Tasks support

Phase 2 - Cloud Run Jobs:
- Add Cloud Run Job for long-running video encoding
- Add CLI entry point to video_worker.py
- Add google-cloud-run dependency

All 1043 tests pass. Infrastructure deployed via Pulumi.
2025-12-11 04:05:42 -05:00
Andrew Beveridge 5630cfd253 fix: address CodeRabbit review comments for Batch 4
1. _validate_url now handles None and non-string inputs safely
   - Added early guard: if url is None or not isinstance(url, str)
   - Updated function signature to accept Optional[str]

2. Fixed cookie tempfile leak in file_handler.py
   - Use context manager pattern to safely write cookies
   - Track cookie_file_path instead of cookie_file object
   - Guaranteed cleanup in finally block

3. Removed unused style_params_path from submit_job_from_url
   - URL-based jobs don't support custom styles (would need signed URL upload)
   - Added warning when user provides --style_params_json with URL input
   - Updated docstring to clarify limitation

Also merged latest main which added job_logging_context for log isolation.
2025-12-11 03:23:49 -05:00
Andrew Beveridge 07c459258a docs: add scalable architecture plan for 100+ concurrent jobs
Create comprehensive SCALABLE-ARCHITECTURE-PLAN.md covering:
- Cloud Tasks for guaranteed delivery and horizontal scaling
- Cloud Run Jobs for long-running video encoding tasks
- Shared pipeline architecture for code reuse (DRY, SOLID)
- Dedicated resources per job (no CPU/memory contention)
- Implementation roadmap with phased approach
- Resource configuration and cost estimates

Update BACKEND-FEATURE-PARITY-PLAN.md to reference new document.
2025-12-11 03:00:21 -05:00
Andrew Beveridge 651cbbdbca feat: Batch 5 - Flacfetch audio search for remote CLI
Add support for searching and downloading audio by artist+title in remote mode,
enabling the same functionality as the local CLI's flacfetch integration.

New features:
- `karaoke-gen-remote "Artist" "Title"` - search for audio without providing a file
- `--auto-download` flag for automatic best-quality selection
- `-y` flag also triggers auto-download mode
- Interactive mode displays search results for user selection

Backend changes:
- New AudioSearchService integrating flacfetch library
- New API endpoints: POST /api/audio-search/search, GET /api/audio-search/{job_id}/results, POST /api/audio-search/{job_id}/select
- New job statuses: searching_audio, awaiting_audio_selection, downloading_audio
- Job model extended with audio_search_artist, audio_search_title, auto_download fields

Remote CLI changes:
- Detects artist+title input without file path
- Displays search results interactively
- Handles audio source selection flow
- Supports both interactive and auto-download modes

Tests:
- 20+ unit tests for AudioSearchService and Job model fields
- Tests for state transitions and API response handling

Documentation:
- Updated BACKEND-FEATURE-PARITY-PLAN.md with batch 5 status

Version bump: 0.71.26 -> 0.71.28
2025-12-11 02:38:41 -05:00
Andrew Beveridge 441f99edeb Merge main: resolve conflicts with Batch 3 (existing instrumental)
Resolves merge conflicts between Batch 4 (YouTube URL input) and Batch 3
(existing instrumental) which was merged while this branch was in progress.

Combined changes:
- Both Batch 3 and Batch 4 are now marked complete in documentation
- Remote CLI now supports both URL input AND existing_instrumental parameter
- Tests include both existing instrumental tests and URL input tests
- Updated poetry.lock with yt-dlp dependency
2025-12-11 02:30:13 -05:00
Andrew Beveridge 985f5c7718 feat: Batch 4 - YouTube URL input support
Implements YouTube URL input (P2 parameter) for the remote CLI and backend:

- Remote CLI: Detect URL input via is_url(), route to new submit_job_from_url() method
- Backend: New /api/jobs/create-from-url endpoint accepts URL with optional artist/title
- Backend: Audio worker downloads from URL using yt-dlp, auto-detects artist/title from metadata
- FileHandler: Added download_video() and extract_metadata_from_url() methods
- Dependencies: Added yt-dlp to pyproject.toml

Features:
- URL detection in remote CLI positional arguments
- Auto-detection of artist/title from YouTube video metadata
- Support for YouTube, Vimeo, SoundCloud, and other yt-dlp supported platforms
- Metadata cleanup (removes common suffixes like "Official Video")
- Cookie support for authenticated downloads (YOUTUBE_COOKIES env var)

Tests: 20+ unit tests covering URL validation, request/response models, Job URL field
2025-12-11 02:09:20 -05:00
Andrew Beveridge 2b5ef28789 feat: Batch 3 - Existing Instrumental Support for Remote CLI
Add --existing_instrumental parameter to remote CLI to allow users to upload
and use their own pre-made instrumental file instead of AI-separated audio.

Key changes:
- remote_cli.py: Add existing_instrumental parameter to submit_job()
- file_upload.py: Add existing_instrumental file type with duration validation (±0.5s)
- job.py: Add existing_instrumental_gcs_path field to Job and JobCreate models
- video_worker.py: Download and use user-provided instrumental for final video encoding

Backend still runs AI separation for stems (to provide consistent download outputs),
but uses the user-provided instrumental for the final karaoke video.

Includes 20+ unit tests and maintains >70% coverage.
2025-12-11 02:06:18 -05:00
Andrew Beveridge de6322dd87 feat: Batch 2 - Audio Separation Model Selection
Add support for custom audio separation models in remote CLI:
- `--clean_instrumental_model`: Stage 1 separation model
- `--backing_vocals_models`: Backing vocals separation models
- `--other_stems_models`: Multi-stem separation models (bass, drums, etc.)

Implementation:
- Remote CLI: Added 3 form fields to submit_job(), sends models as comma-separated strings
- Backend: Added 3 Form parameters to /api/jobs/upload, parses comma-separated lists
- Job model: Added clean_instrumental_model, backing_vocals_models, other_stems_models fields
- Audio worker: create_audio_processor() accepts model params from job, passes to Modal API

This enables A/B testing different models and using newer models as they release.
Models are sent to the Modal-hosted audio-separator API which can download any model
on demand and caches them.

Resolves: Batch 2 from BACKEND-FEATURE-PARITY-PLAN.md
2025-12-11 01:05:30 -05:00
Andrew Beveridge d57282c770 docs: mark Batch 1 complete, add instructions for future agents
Update BACKEND-FEATURE-PARITY-PLAN.md:
- Mark Batch 1 (Lyrics Configuration) as complete with PR #8
- Update Quick Parity Summary (Lyrics: 100%)
- Mark L1-L4 parameters as ✅ implemented
- Add "Instructions for Implementing a Batch" section:
  - Test coverage requirements (>70%)
  - Required documentation updates checklist
  - Version bump requirement
  - PR format guidelines
- Update Next Steps to reflect current progress
- Add Recent Changes entry for v0.71.22
2025-12-11 00:37:41 -05:00
Andrew Beveridge ef9c4fc243 Added much improved feature parity plan 2025-12-11 00:15:32 -05:00
Andrew Beveridge 1f030333ae fix: reduce anchor sequence logging verbosity and fix duplicate logs
- Change verbose N-GRAM, ANCHOR SEARCH, and FILTERING logs from INFO to DEBUG level
- Keep only high-level summary logs at INFO (start, completion, totals)
- Fix duplicate logging by removing redundant logger handlers from hierarchy
  - job_log_context no longer adds handlers to root logger
  - LYRICS_WORKER_LOGGERS reduced to top-level package loggers only
- Bump version to 0.71.20
2025-12-10 22:49:59 -05:00
Andrew Beveridge 6dc3962797 Simplify CI/Docker: use poetry and Python 3.13 everywhere
- Update CI to use poetry instead of pip with frozen requirements
- Upgrade CI from Python 3.12 to 3.13 (matches pyproject.toml and dev env)
- Simplify Dockerfile.base to use pip install -e . directly
- Remove requirements-frozen.txt (caused Python version mismatches)
- Update documentation to reflect simpler setup
2025-12-10 13:40:55 -05:00
Andrew Beveridge d35b8c4db0 Vendor lyrics-transcriber and optimize Docker builds
- Bundle lyrics-transcriber directly via pyproject.toml packages directive
  instead of PyPI dependency, allowing rapid iteration without publishing
- Add all lyrics-transcriber dependencies to karaoke-gen's deps
- Optimize Docker builds: base image now contains only dependencies (no code),
  app image adds code on top for fast ~1-2 min rebuilds
- Generate requirements-frozen.txt from poetry.lock for reproducible builds
- Update CI to use frozen requirements
- Add comprehensive documentation in docs/01-reference/VENDORED-LYRICS-TRANSCRIBER.md
  with un-vendoring instructions for when changes are pushed upstream
2025-12-10 13:23:12 -05:00
Andrew Beveridge 8456aac142 docs: Update documentation for v0.71.0 release (core feature parity milestone)
This marks the first successful end-to-end run of karaoke-gen-remote with
the Google Cloud backend. All core features are now working:

- README.md completely rewritten with comprehensive documentation:
  - Both CLI tools (karaoke-gen, karaoke-gen-remote) fully documented
  - API reference for backend endpoints
  - Infrastructure deployment guide with Pulumi
  - Style configuration examples
  - Output file structure

- BACKEND-FEATURE-PARITY-PLAN.md updated to reflect:
  - All core processing features complete
  - All distribution features working (YouTube, Dropbox, GDrive, Discord)
  - Future architecture plans for shared pipeline refactor
  - Comprehensive testing/deployment sections

- Job model enhanced with request_metadata field for operational tracking
2025-12-10 01:39:51 -05:00
Andrew Beveridge a2f3a4709a feat: Store OAuth client credentials in Secret Manager
- Device auth endpoints now read client_id/client_secret from Secret Manager
- New secrets: youtube-client-credentials, gdrive-client-credentials
- Passing credentials in request body is now optional (for backwards compat)
- Simpler API: just POST to /api/auth/youtube/device with empty body
- Updated documentation

Version bump to 0.70.26
2025-12-09 18:26:18 -05:00
Andrew Beveridge 16a100efb2 feat: Add OAuth credential management with device authorization flow
Implements comprehensive OAuth credential management for the backend:

1. CredentialManager service:
   - Validates YouTube, Google Drive, and Dropbox credentials
   - Automatically refreshes expired tokens
   - Device Authorization Flow for re-authentication
   - Discord alerts when credentials need attention

2. API endpoints (/api/auth/*):
   - GET /status - Check all credential statuses
   - POST /validate - Validate specific services before job submission
   - POST /youtube/device - Start YouTube device auth flow
   - GET /youtube/device/{code} - Poll for auth completion
   - Similar endpoints for Google Drive

3. Pre-job validation:
   - Jobs requiring YouTube/Dropbox/GDrive are rejected if credentials invalid
   - Clear error messages with auth_url for re-authorization

4. Startup validation:
   - Validates all credentials on backend startup
   - Sends Discord alert if any credentials need attention

5. Documentation:
   - docs/00-current-plan/OAUTH-CREDENTIAL-MANAGEMENT.md
   - Covers credential setup, device flow, troubleshooting

Version bump to 0.70.24
2025-12-09 17:31:56 -05:00
Andrew Beveridge 84e7b7b77a feat: Implement native API distribution services and shared pipeline architecture
Phase 1: Native API Distribution Services
- Add dropbox_service.py with native Dropbox SDK for folder listing, upload, and sharing links
- Add gdrive_service.py with native Google Drive API for folder uploads and public share
- Add dropbox_path and gdrive_folder_id fields to Job model and JobCreate
- Update file_upload.py API to accept new distribution parameters
- Update video_worker.py to use native services for distribution
- Add --dropbox_path and --gdrive_folder_id CLI arguments to remote CLI
- Add dropbox>=11.0.0 dependency to backend requirements

Phase 2: Shared Pipeline Architecture
- Create karaoke_gen/pipeline/ module with base classes and context
- Implement PipelineStage protocol and StageResult for consistent stage execution
- Add PipelineContext dataclass for passing state through stages
- Create SeparationStage wrapping AudioProcessor
- Create TranscriptionStage wrapping LyricsProcessor
- Create ScreensStage for title/end screen generation
- Create RenderStage for video rendering with lyrics
- Create FinalizeStage wrapping KaraokeFinalise
- Add LocalExecutor for in-process stage execution
- Add RemoteExecutor for backend API stage execution

This enables:
- Remote CLI to use native Dropbox/GDrive APIs instead of rclone
- Same output locations and brand codes as local CLI
- Foundation for unified pipeline that works in both local and cloud contexts
2025-12-09 15:41:04 -05:00
Andrew Beveridge 2e396aaa0b docs: Rewrite feature parity plan with accurate distribution requirements
- Added detailed specification for all 5 distribution features
- Clarified that remote mode uses APIs directly (not local filesystem)
- Updated implementation status to reflect reality
- Added target remote CLI alias showing final command
- Added testing checklist for verifying true parity
- Documented required secrets and their formats

Key insight: Same outputs must appear in same cloud locations
regardless of whether using karaoke-gen or karaoke-gen-remote
2025-12-09 14:56:08 -05:00
Andrew Beveridge 500af61530 feat: Add distribution features - Dropbox upload and YouTube upload support
Phase 1 of Backend Feature Parity Plan:

Dropbox Upload (rclone):
- Add organised_dir_rclone_root field to Job model
- Create backend/services/rclone_service.py to load rclone.conf from Secret Manager
- Wire through from API to video_worker and KaraokeFinalise

YouTube Upload:
- Create backend/services/youtube_service.py for OAuth credential management
- Load credentials from Secret Manager (youtube-oauth-credentials secret)
- Add --enable_youtube_upload flag to CLI
- Update video_worker to pass credentials to KaraokeFinalise

Other changes:
- Update remote_cli.py to support new distribution parameters
- Update BACKEND-FEATURE-PARITY-PLAN.md with implementation status
- Bump version to 0.70.12
2025-12-09 01:45:44 -05:00
Andrew Beveridge e72690e1c9 Grant GitHub Actions SA permission to read Cloud Build logs
Cloud Build stores logs in a GCS bucket ({PROJECT_NUMBER}.cloudbuild-logs.googleusercontent.com).
The existing roles/cloudbuild.builds.editor role doesn't include storage read access to this bucket,
causing CI to fail to display build failure details.

- Add BucketIAMMember in Pulumi to grant roles/storage.objectViewer on the Cloud Build logs bucket
- Minor doc tweak to clarify "same outputs" principle
- Bump version to 0.70.9
2025-12-09 01:19:12 -05:00
Andrew Beveridge 8a99556b32 Add comprehensive backend feature parity plan documentation
- Create BACKEND-FEATURE-PARITY-PLAN.md with:
  - Vision for unified karaoke-gen ecosystem (local CLI, remote CLI, web UI)
  - Detailed implementation plan for YouTube upload, Dropbox sync, email draft
  - Phase-based approach prioritizing distribution features
  - Important files reference for new agents
  - Shared pipeline architecture vision for future refactoring
- Archive CLI-FEATURE-PARITY.md with redirect to new document
- Bump version to 0.70.8
2025-12-09 01:14:32 -05:00
Andrew Beveridge c769118e80 Enhance remote CLI output file parity with local CLI
- Update screens_worker.py to upload title/end screen images (.jpg, .png) in addition to .mov files
- Enhance download_outputs() in remote_cli.py to:
  - Download title/end screen files (.mov, .jpg, .png)
  - Download with_vocals intermediate video (.mkv)
  - Use descriptive stem naming matching local CLI (e.g., "Vocals model_bs_roformer...")
  - Extract individual .cdg and .mp3 files from CDG ZIP
  - Copy instrumental files to root directory
- Update CLI-FEATURE-PARITY.md documentation with enhanced file download structure
- Bump version to 0.70.7
2025-12-09 00:57:21 -05:00
Andrew Beveridge 6e9d9a14ed Update CLI-FEATURE-PARITY.md with recent fixes and style loader refactor 2025-12-09 00:37:27 -05:00
Andrew Beveridge e6b72a828f Add documentation for style loader refactor and future architecture plans 2025-12-09 00:25:47 -05:00
Andrew Beveridge 7e3619b4a6 Tidied old docs 2025-12-09 00:04:20 -05:00
Andrew Beveridge d071c4834f Update CLI feature parity docs with completed style/CDG/Discord support
Documents the implementation of:
- Style configuration upload (--style_params_json)
- CDG/TXT package generation (--enable_cdg, --enable_txt)
- Discord webhook notifications (--discord_webhook_url)
- Brand code generation (--brand_prefix)
- Improved file download with proper naming

All features reuse existing KaraokeFinalise code - no duplicate implementations.
2025-12-08 05:06:01 -05:00
Andrew Beveridge 9a6767aee8 Added new version of remote CLI with (in theory) more feature parity with karaoke-gen 2025-12-08 04:39:50 -05:00
Andrew Beveridge fc729647d8 Add tests and update documentation for review integration
- Add test_routes_review.py with unit tests for:
  - Review router structure verification
  - Minimal styles config requirements (catches font_path/ass_name issues)
  - Render video worker default styles
  - Job status transitions for review flow
  - JobManager.fail_job() method

- Update test_emulator_integration.py with:
  - Review ping endpoint test
  - Correction data access control tests
  - Preview video endpoint test
  - Annotations endpoint test
  - Render video worker endpoint test

- Update CURRENT-STATUS.md:
  - Mark Phase 1.3 as COMPLETE
  - Document successful end-to-end test (job 166cc144)
  - Add complete workflow diagram
  - Document lessons learned (styles config requirements)
  - Update quick reference with review UI URL
2025-12-07 23:02:32 -05:00
Andrew Beveridge 7d527298a7 Implement human review integration with LyricsTranscriber UI
This commit implements the complete human review workflow for lyrics
correction, integrating the LyricsTranscriber React frontend with the
cloud backend.

Key changes:
- Add review.py router with endpoints compatible with LyricsTranscriber UI
- Add render_video_worker.py for post-review video generation
- Add RENDERING_VIDEO status and update state transitions
- Add fail_job() method to JobManager for proper error handling
- Fix lyrics_worker to upload corrections.json with correct filename
- Fix screens_worker to transition to AWAITING_REVIEW (not instrumental)
- Add storage_service methods: upload_json(), download_json()

The complete workflow now works:
1. Upload → parallel audio separation + lyrics transcription
2. Screen generation (title/end)
3. Human review via LyricsTranscriber UI (localhost:5173)
4. Preview video generation during review
5. Post-review video render with corrected lyrics
6. Instrumental selection (clean vs with_backing)
7. Final video encoding (4 formats: lossless mp4/mkv, lossy mp4, 720p)
8. Job completion

Tested end-to-end with local GCP emulators.
2025-12-07 22:58:03 -05:00
Andrew Beveridge ec840b2e69 Removed Audacity LOF generation and app launching 2025-12-07 19:26:53 -05:00
Andrew Beveridge ad0cb72353 Unify testing: run all tests from repo root with 'pytest'
Changes:
- Add backend dependencies to root pyproject.toml
- Configure pytest to discover tests from tests/, backend/tests/
- Skip emulator/integration tests when services not available
- Add run-backend-local.sh for local development
- Add comprehensive TESTING-GUIDE.md documentation

Now you can:
- pytest           # Run all 379 tests from repo root
- ./scripts/run-backend-local.sh  # Run backend locally

Emulator tests auto-skip unless emulators are running.
Integration tests require RUN_INTEGRATION_TESTS=true.
2025-12-07 19:07:50 -05:00
Andrew Beveridge feb2d89b3e Implement Phase 1 & 2: Real audio and lyrics workers
✅ Phase 1: Audio Worker
- Reuses karaoke_gen.AudioProcessor for Modal API calls
- 2-stage separation: clean instrumental + backing vocals
- Uploads all stems to GCS
- Added audio-separator[remote] dependency
- Added AUDIO_SEPARATOR_API_URL env var
- Zero code duplication

✅ Phase 2: Lyrics Worker
- Reuses karaoke_gen.LyricsProcessor for AudioShake + correction
- Automatic lyrics correction via lyrics_transcriber library
- Generates corrections JSON for review interface
- Added lyrics API env vars (AudioShake, Genius, RapidAPI, Spotify)
- Zero code duplication

Both workers follow DRY principle and reuse battle-tested CLI code.
Maximum code reuse = maximum maintainability.
2025-12-02 01:19:41 -05:00
Andrew Beveridge 4b7d7d2ffc Add comprehensive worker implementation plan
Created detailed plan for actually implementing karaoke generation:

📋 Analysis:
- Reviewed karaoke_gen CLI workflow documentation
- Identified that karaoke_gen ALREADY calls remote APIs (Modal, AudioShake)
- Workers don't need to refactor karaoke_gen - just call same APIs

✅ Implementation Strategy:
Phase 1: Audio Worker - Call Modal API directly for stem separation
Phase 2: Lyrics Worker - Use AudioShake + lyrics_transcriber library
Phase 3: Human Interaction - Corrections submission + instrumental selection
Phase 4: Screens Worker - Generate title/end screens
Phase 5: Video Worker - Final video assembly and encoding
Phase 6: Optional - CDG/TXT generation

🔑 Key Insights:
- lyrics_transcriber is already available in lyrics_transcriber_local/
- Modal API can be called directly (no need for AudioProcessor class)
- AudioShake API can be called directly
- Video encoding fits within Cloud Run timeout (60 min)
- FFmpeg can be included in Docker image

Next: Implement audio worker with actual Modal API integration
2025-12-02 01:09:49 -05:00
Andrew Beveridge c06626169d Update CD to use Workload Identity Federation (more secure)
- Project has policy preventing service account key creation
- Switched to Workload Identity Federation (no keys needed!)
- Created setup script for Workload Identity
- Added manual setup instructions
- Updated GitHub Actions workflow

Benefits:
✅ No service account keys to manage
✅ Automatic credential rotation
✅ Better security posture
✅ No key expiration issues

Setup: See docs/03-deployment/CD-SETUP-INSTRUCTIONS.md
2025-12-02 00:32:10 -05:00
Andrew Beveridge a61b74b355 Add Continuous Deployment (CD) pipeline with GitHub Actions
✅ Features:
- Auto-deploy to Cloud Run after all tests pass
- Only deploys on push to replace-modal-with-google-cloud branch (not PRs)
- Builds Docker image with commit SHA tags for easy rollback
- Verifies deployment health automatically
- ~7 min total time from push to live

📚 Documentation:
- Comprehensive CD setup guide (docs/03-deployment/CD-SETUP.md)
- Automated setup script (scripts/setup-cd.sh)
- Updated GitHub Actions README with CD info
- Deployment status tracking document

🔐 Security:
- Uses GCP service account with minimal necessary permissions
- Requires GitHub secrets: GCP_SA_KEY, ADMIN_TOKENS
- Setup script creates service account and generates key
- Documentation includes security best practices

📋 Next Steps:
1. Run ./scripts/setup-cd.sh to create service account
2. Add GCP_SA_KEY and ADMIN_TOKENS to GitHub secrets
3. Push to branch → automatic deployment!

This completes the CI/CD pipeline:
- CI: 73 automated tests (unit + integration)
- CD: Automatic deployment on test success
2025-12-02 00:30:11 -05:00
Andrew Beveridge 8e9df9c765 Add CI setup completion documentation 2025-12-01 20:34:52 -05:00
Andrew Beveridge 7cbde5acca Add comprehensive emulator-based integration testing
- Implement 11 emulator integration tests (Firestore + GCS)
- Add emulator management scripts (start/stop/run-tests)
- Fix module-level mock isolation issues
- Add TEST_SERVER_URL support for worker service routing
- Create comprehensive testing documentation
- All 73 tests passing (62 unit + 11 emulator integration)

Benefits:
- 2s test runtime vs 10+ min for cloud tests
- Zero cloud costs for testing
- Tests use real Firestore/GCS emulators
- Caught bugs unit tests missed (e.g. input_media_gcs_path)

Test Results:
✅ Unit Tests: 62 passed (0.4s)
✅ Emulator Tests: 11 passed (2.0s)
2025-12-01 20:32:47 -05:00
Andrew Beveridge 9faa62bdb0 Added unit tests with thorough coverage 2025-12-01 19:02:42 -05:00
Andrew Beveridge bc7c1304df Got new version of backend with (in theory) full karaoke-gen CLI functionality deployed on Cloud Run 2025-12-01 02:19:38 -05:00
Andrew Beveridge 455b5a03c6 Added API subdomain and simple auth token system 2025-12-01 00:47:31 -05:00
Andrew Beveridge aaf8bf5e40 Finished phase 1.3 2025-11-30 23:20:40 -05:00
Andrew Beveridge 42c7d2537e Phase 1.2 complete 2025-11-30 23:02:28 -05:00
Andrew Beveridge e3fea67a5c Updated next steps now we know what the karaoke-gen CLI does 2025-11-30 22:33:48 -05:00
Andrew Beveridge 84b153cf24 Tidied up docs, added clear explanation of karaoke-gen requirements for cloud based on CLI 2025-11-30 22:22:58 -05:00
Andrew Beveridge 4a7be0ede7 GCP backend deployed and "working" but in reality not actually doing much yet 2025-11-30 21:37:04 -05:00
Andrew Beveridge 7966930188 feat: Implement Infrastructure as Code with Pulumi
- Add Pulumi infrastructure definition for all GCP resources
- Implement Docker build with layer caching via Cloud Build
- Fix Artifact Registry permissions for Cloud Build service accounts
- Remove deprecated manual setup scripts and docs
- Add comprehensive documentation:
  - Infrastructure as Code migration guide
  - Cloud Build permissions troubleshooting
  - Next steps for Cloud Run deployment
  - Session summary and cleanup verification

All GCP resources now managed in code:
- Firestore, Cloud Storage, Artifact Registry
- Service Account with IAM bindings
- Secret Manager secrets
- Cloud Build permissions

Resolves permission issues and establishes single source of truth for infrastructure.
2025-11-30 20:07:47 -05:00
Andrew Beveridge 5955a76565 First pass of refactor to use react, cloudflare pages, GCP plus Modal 2025-11-30 17:13:20 -05:00
Andrew Beveridge c36a200885 Reorganized docs 2025-11-30 15:17:39 -05:00