Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
9.61k stars 483 forks source link

Request for Adding the Functionality to Terminate Container Startup Process #360

Open Savinykh-Sergey opened 3 months ago

Savinykh-Sergey commented 3 months ago

What problem will this feature address?

This feature will address the issue that arises when there are errors in the Dockerfile, causing the container to fail to start correctly due to incorrect commands. Currently, the service does not provide the ability to stop the container startup process before it completes, which can lead to the system hanging or being unable to properly handle the error.

Describe the solution you'd like

I would like to have the ability to interrupt the container startup process if it hasn't completed yet, similar to how you can stop a running container. This could be implemented in the container management interface by adding an option to "Terminate Startup," allowing the user to manually interrupt the process.

Describe alternatives you've considered

As a temporary workaround, I manually changed the container status from "Running" to "Done" in the database, which allowed me to terminate the startup process. However, this solution is inconvenient and unintuitive for most users. A simpler and more obvious method integrated into the interface would be much more useful and user-friendly.

Additional context

No response

Siumauricio commented 3 months ago

In order to terminate the build of any type of source it is not possible to implement because internally we use queues with redis which is used with bullmq to precisely prevent the server from freezing, and they do not offer a functionality to stop or terminate the running process unless you pay for a paid version. https://github.com/taskforcesh/bullmq/issues/632

An alternative to prevent your server from freezing in case you have very limited resources is to build the image on a ci/cd and push it to a docker registry and in dokploy simply download and run the image so you don't do the heavy process of building the image.

DenisVASI9 commented 3 months ago

@Siumauricio Let's use NATS instead of Redis. When cancellation is required, we'll send a broadcast (pub/sub) to all workers and interrupt the task. I'd like to get this functionality as soon as possible and I'm ready to write the concept. Could you reach out on Telegram for a basic consultation?

Siumauricio commented 3 months ago

Send me a message on discord @DenisVASI9 https://discord.gg/GgfVjpff

verekia commented 3 weeks ago

My npm install or bun install commands very frequently get stuck and never finish for some reason. This blocks the entire deployment pipeline on Dokploy. I've been able to kill the deployment by SSH-ing into the server and running killall docker-buildx, but it would be great to be able to do that from the dashboard, and maybe have a timeout + retry option.

Siumauricio commented 3 weeks ago

Read this https://github.com/Dokploy/dokploy/issues/508#issuecomment-2383740611 @verekia

verekia commented 3 weeks ago

Thank you @Siumauricio. In my case the server that's building the image is not having any CPU/RAM problem at all, it's just that there is an issue in the way bun fetches, it gets stuck doing nothing, and the install never finishes. My server can handle building images, no problem.

Siumauricio commented 3 weeks ago

I understand @verekia , honestly I like Bun, but it has many bugs, I tried to use it in dokploy but many things didn't work for me in fact when I was creating dokploy I had this Bug https://github.com/oven-sh/bun/issues/8849 and since that moment I decided to use pnpm better

verekia commented 3 weeks ago

Sure, that's fair. But the issue still stands that if the image build process hangs for any reason. Dokploy's deployment pipeline gets stuck, and nothing else can be deployed.

Siumauricio commented 3 weeks ago

what does this command killall docker-buildx ? it kills all the running containers or just the building containers?

verekia commented 3 weeks ago

It kills the process that's building containers, not the running containers. But it's OS-dependent so it's not ideal. I tried docker buildx stop but it didn't work to stop the deployment.