Skip to content

Conversation

@RajikaKeminda
Copy link
Contributor

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 CloudService abstraction, 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

  • Added CloudService abstraction: 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.
  • Introduced CloudModule: Added a new module (api-backend/src/cloud/cloud.module.ts) to encapsulate the cloud-related logic and export the CloudService.
  • Defined ICloudService interface: Added an interface (api-backend/src/cloud/cloud-service.interface.ts) to standardize cloud operations like runTask, stopTask, and syncTaskStatus.

OVH-Specific Configuration and Support

  • Updated environment variables: Added OVH-specific variables such as OVH_IMAGE_GOOGLE, OVH_IMAGE_TEAMS, and OVH_IMAGE_ZOOM to the .env.example file for cloud configuration.
  • Enhanced configuration file: Extended the configuration.ts file to include OVH-specific settings like imageGoogle, imageTeams, and imageZoom, as well as general cloud provider settings (CLOUD_PROVIDER).

Refactoring for CloudService Integration

  • Refactored BotService: Updated BotService (api-backend/src/bot/bot.service.ts) to use the CloudService for bot task operations instead of directly interacting with ECSClientService. Removed AWS-specific logic for task definitions and container names. [1] [2] [3] [4] [5]
  • Refactored ECSClientService: Modified ECSClientService (api-backend/src/aws/ecs.service.ts) to implement the ICloudService interface and adapt its methods to align with the new abstraction. [1] [2] [3]

Dependency Updates

  • Updated Dockerfile: Changed the base image in the Dockerfile from Node.js 20 to Node.js 22 for compatibility and performance improvements.
  • Added Kubernetes client dependency: Included the @kubernetes/client-node package in package.json to support OVH Kubernetes operations.

Miscellaneous Changes

  • Added OVH and Cloud modules to AppModule: Integrated the new OvhModule and CloudModule into the main application module (api-backend/src/app.module.ts) for dependency injection. [1] [2]
  • Updated .gitignore: Added kubeconfig.yml to the .gitignore file to prevent Kubernetes configuration files from being tracked.

@RajikaKeminda RajikaKeminda requested a review from Copilot June 20, 2025 09:33
@github-actions
Copy link

✅ ESLint check passed!

This comment was marked as outdated.

@github-actions
Copy link

✅ ESLint check passed!

@github-actions
Copy link

✅ ESLint check passed!

@RajikaKeminda RajikaKeminda requested a review from Copilot June 20, 2025 09:56
Copy link

Copilot AI left a 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, and CloudModule to dynamically select OVH or AWS implementations.
  • Added OVH-specific OvhService, OVHTaskProcessor, and related modules; updated configuration and .env.example.
  • Refactored BotService, CronJobService, and ECSClientService to use the new CloudService methods.

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');

@RajikaKeminda RajikaKeminda changed the title Feat/ovh Support multiple cloud providers Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants