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
Example:
- Service A: 1GB RAM, 1 CPU
- Service B: 2GB RAM, 0.5 CPU
Total requirement:
Validation Flow
Control Panel API
→ WebSocket request
→ Agent App
→ Check ports
→ Validate RAM availability
→ Validate CPU availability
→ Return validation result
If validation passes:
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.
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
Implementation Details
Read resource limits from the service docker-compose template:
deploy.resources.limits.memorydeploy.resources.limits.cpusCalculate the total maximum resource requirement for all services in the deployment.
Example:
Total requirement:
Memory: 3GB
CPU: 1.5
Agent should fetch current available:
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:
If validation fails:
Notes