[Draft]added gcp support in llm engine #750
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add GCP (Google Cloud Platform) support to model-engine, enabling deployment on GCP infrastructure alongside existing AWS and Azure support.
Changes
New GCP Gateway Implementations:
gcs_filesystem_gateway.py - GCS file operations using smart_open library
gcs_llm_artifact_gateway.py - LLM model artifact storage and retrieval from GCS
gcs_file_storage_gateway.py - High-level file storage interface for GCS
New GCP Repository Implementations:
gcs_file_llm_fine_tune_repository.py - Store/retrieve fine-tune job templates from GCS
gcs_file_llm_fine_tune_events_repository.py - Store/retrieve fine-tune events from GCS
New Queue Delegate:
redis_queue_endpoint_resource_delegate.py - Redis-based queue lifecycle management for GCP (uses Memorystore)
Modified Files:
api/dependencies.py - Added GCP conditionals for dependency injection
celery_autoscaler.py - Added GCP_MEMORYSTORE_REDIS_BROKER constant
infra/gateways/init.py - Export new GCS gateway classes
infra/repositories/init.py - Export new GCS repository classes
requirements.in - Added google-auth and google-cloud-storage dependencies
Architecture Decisions
Celery Broker: GCP uses Redis (Memorystore) - same as ElastiCache pattern
Celery Backend: Uses Redis for task results (not GCS, avoiding need for custom Celery backend)
Storage: Uses smart_open library with GCS client, consistent with S3/ABS patterns
Queue Management: Redis queues are implicit (created on message push), so delegate handles lifecycle tracking and metrics