-
Notifications
You must be signed in to change notification settings - Fork 7
Support multiple cloud providers #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
✅ ESLint check passed! |
|
✅ ESLint check passed! |
|
✅ ESLint check passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a CloudService abstraction to support both OVH (Kubernetes) and AWS (ECS) for bot task execution, refactors existing services to use the new abstraction, and introduces OVH-specific configuration and Kubernetes integration.
- Introduced
CloudService,ICloudService, andCloudModuleto dynamically select OVH or AWS implementations. - Added OVH-specific
OvhService,OVHTaskProcessor, and related modules; updated configuration and.env.example. - Refactored
BotService,CronJobService, andECSClientServiceto use the newCloudServicemethods.
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cloud/cloud.service.ts | New abstraction selecting OVH vs AWS; methods for run/stop |
| src/ovh/ovh.service.ts | OVH Kubernetes implementation of ICloudService |
| src/ovh/processors/ovh-task.processor.ts | Processor for rescheduling failed OVH tasks |
| src/cron-job/cron-job.service.ts | Refactored cron jobs to use CloudService and Logger |
| src/aws/ecs.service.ts | ECS implementation updated to conform to ICloudService |
Comments suppressed due to low confidence (2)
api-backend/src/cloud/cloud.service.ts:55
- The method name 'runTeemsBotTask' has a typo ('Teems' vs 'Teams'). Rename it to 'runTeamsBotTask' for clarity and consistency.
async runTeemsBotTask(command: string[]): Promise<string> {
api-backend/src/cloud/cloud.service.ts:57
- The config key 'ovh.imageTeems' is misspelled; it should be 'ovh.imageTeams' to match the configuration and environment variable naming.
const image = this.configService.get('ovh.imageTeems');
This pull request introduces significant changes to the backend to support multiple cloud providers (OVH and AWS) for bot task execution. It includes the addition of a new
CloudServiceabstraction, updates to existing services to integrate with the new cloud provider logic, and configuration enhancements to support OVH-specific settings. Below is a summary of the most important changes grouped by theme.Cloud Provider Integration
CloudServiceabstraction: Created a new service (api-backend/src/cloud/cloud.service.ts) that dynamically selects the appropriate cloud provider (OVH or AWS) based on configuration and delegates bot task operations like running and stopping tasks.CloudModule: Added a new module (api-backend/src/cloud/cloud.module.ts) to encapsulate the cloud-related logic and export theCloudService.ICloudServiceinterface: Added an interface (api-backend/src/cloud/cloud-service.interface.ts) to standardize cloud operations likerunTask,stopTask, andsyncTaskStatus.OVH-Specific Configuration and Support
OVH_IMAGE_GOOGLE,OVH_IMAGE_TEAMS, andOVH_IMAGE_ZOOMto the.env.examplefile for cloud configuration.configuration.tsfile to include OVH-specific settings likeimageGoogle,imageTeams, andimageZoom, as well as general cloud provider settings (CLOUD_PROVIDER).Refactoring for CloudService Integration
BotService: UpdatedBotService(api-backend/src/bot/bot.service.ts) to use theCloudServicefor bot task operations instead of directly interacting withECSClientService. Removed AWS-specific logic for task definitions and container names. [1] [2] [3] [4] [5]ECSClientService: ModifiedECSClientService(api-backend/src/aws/ecs.service.ts) to implement theICloudServiceinterface and adapt its methods to align with the new abstraction. [1] [2] [3]Dependency Updates
Dockerfile: Changed the base image in theDockerfilefrom Node.js 20 to Node.js 22 for compatibility and performance improvements.@kubernetes/client-nodepackage inpackage.jsonto support OVH Kubernetes operations.Miscellaneous Changes
AppModule: Integrated the newOvhModuleandCloudModuleinto the main application module (api-backend/src/app.module.ts) for dependency injection. [1] [2].gitignore: Addedkubeconfig.ymlto the.gitignorefile to prevent Kubernetes configuration files from being tracked.