Skip to content

feat: Add RAM and CPU resource validation for container deployments#240

Open
dhaval-p-iqud wants to merge 4 commits into
mainfrom
feature/dp/vram-checker
Open

feat: Add RAM and CPU resource validation for container deployments#240
dhaval-p-iqud wants to merge 4 commits into
mainfrom
feature/dp/vram-checker

Conversation

@dhaval-p-iqud

Copy link
Copy Markdown
Collaborator

📝 What does this change do?

  • Updated the deployment validation flow to support resource-based checks before starting container deployments.

Changes:

  • Replaced the existing port-only validation flow with a complete resource validation approach.
  • Added validation for:
    • RAM availability
    • CPU availability
    • Port availability
  • Integrated resource checks into the existing deployment validation flow.
  • Removed the separate PortAvailabilityService and moved validation logic into ResourceAvailabilityService.
  • Updated methods and endpoints naming to match the new resource validation approach.
  • Improved error handling for insufficient resources during deployment.
  • Added utility service updates and resolved linting issues.
  • Updated UI components and API calls according to the new validation flow.
  • Added container redirect link support with a copy button for improved usability.

🔗 Related Issue / Task


🧪 How was this tested?

  • [✅] Manually tested

Steps to Test:

  1. Create a deployment request for a service with valid resource requirements and verify that:
    • Port validation passes.
    • RAM validation passes.
    • CPU validation passes.
    • Deployment starts successfully.
  2. Update the service resource limits in the docker-compose template to require more RAM than available on the remote server and verify that:
    • Deployment is blocked.
    • Proper RAM insufficient error message is displayed.
  3. Update the service resource limits to require more CPU than available on the remote server and verify that:
    • Deployment is blocked.
    • Proper CPU insufficient error message is displayed.
  4. Try deploying a service with an already occupied port and verify that:
    • Port validation fails.
    • Deployment is blocked with the port conflict error.
  5. Verify that the agent app correctly sends resource availability validation results through WebSocket and the control panel handles success/failure responses correctly.
  6. Verify container redirect link and copy button functionality after successful deployment.

📸 Screenshots (if UI changes)

image image image image

✅ Checklist

  • [✅] Code is self-reviewed
  • [✅] Follows project conventions
  • [✅] No unnecessary logs / debug code

…or deployments

- Updated the deployment validation process to check for RAM, CPU, and port availability before deployment.
- Removed the PortAvailabilityService and integrated resource checks into the ResourceAvailabilityService.
- Renamed relevant methods and endpoints to reflect the new validation approach.
- Enhanced error handling for insufficient resources during deployment.
- Updated UI components and API calls to align with the new validation logic.
- Added copy button and link for the container to redirect into new tab
@dhaval-p-iqud dhaval-p-iqud self-assigned this Jun 25, 2026
@dhaval-p-iqud dhaval-p-iqud added the enhancement New feature or request label Jun 25, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Deploying console with  Cloudflare Pages  Cloudflare Pages

Latest commit: e2d68bf
Status: ✅  Deploy successful!
Preview URL: https://e2848ae3.core-6vy.pages.dev
Branch Preview URL: https://feature-dp-vram-checker.core-6vy.pages.dev

View logs

- Improved error handling in various services, including ContainerService, DeployTemplateExecutor, and ResourceAvailabilityService, to provide clearer error messages and logging.
- Updated terminal service methods to handle errors gracefully and log relevant information.
- Refactored health controller to log errors during health checks.
- Enhanced SocketClientService to utilize shared error messages for consistency.
- Improved resource validation checks to ensure robust error reporting during deployment processes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RAM and CPU Resource Validation Before Docker Deployment

1 participant