Skip to content

Add RAM and CPU Resource Validation Before Docker Deployment #238

Description

@dhaval-p-iqud

Description

Implement resource validation before starting Docker service deployment. The agent app installed on the remote server should validate whether enough RAM and CPU resources are available before allowing deployment.

Requirements

  • Extend the existing deployment validation flow which already checks port availability.
  • Add RAM and CPU availability checks before starting container deployment.
  • Agent app should be responsible for fetching and validating server resources since it has direct access to the remote server.

Implementation Details

  • Read resource limits from the service docker-compose template:

    • deploy.resources.limits.memory
    • deploy.resources.limits.cpus
  • Calculate the total maximum resource requirement for all services in the deployment.

Example:

  • Service A: 1GB RAM, 1 CPU
  • Service B: 2GB RAM, 0.5 CPU

Total requirement:

  • Memory: 3GB

  • CPU: 1.5

  • Agent should fetch current available:

    • RAM
    • CPU
  • Compare available resources with required resources before deployment.

Validation Flow

Control Panel API
→ WebSocket request
→ Agent App
→ Check ports
→ Validate RAM availability
→ Validate CPU availability
→ Return validation result

If validation passes:

  • Continue deployment.

If validation fails:

  • Stop deployment.
  • Return proper error message:
    • Not enough RAM available to run this service container.
    • Not enough CPU available to run this service container.

Notes

  • Integrate RAM and CPU validation into the existing port validation flow instead of creating a separate validation process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions