dojo icon indicating copy to clipboard operation
dojo copied to clipboard

Handle Ctrl+C when images are being pulled when dojo action is: run

Open xmik opened this issue 5 years ago • 2 comments

This PR fixes #1. For the driver: docker - a SIGINT is sent to the current process group. For the driver: docker-compose - Dojo will first explicitly invoke the pull action.

Besides, this PR also fixes a minor bug which happened on handling signals for the driver: docker-compose when a default container was not created. Dojo used to panic then, now it will proceed with cleaning.

xmik avatar Jan 04 '20 13:01 xmik

The change in the run action for docker-compose driver is that now Dojo first explicitly invokes the pull action and then it invokes the run action.

I don't think this is acceptable solution. It should not pull images before each run. The cases where it might have bad consequences are:

  • when there is docker image tag such as :latest
  • or when there are local docker images referred in the configuration, such as my-local-dojo or my-not-yet-released-server:0.0.1.

Then pull would either get something that developer does not want on their workstation yet, or completely fail in the later case when pulling my-not-yet-released-server:0.0.1.

We should keep the default docker behavior for runs - pull only when image is missing locally.

Rather than calling pull explicitly, I think you should handle the signals to simply interrupt the docker-compose run that is executed.

tomzo avatar Jan 04 '20 13:01 tomzo

Good points, I will rethink the implementation for the docker-compose driver.

xmik avatar Jan 04 '20 13:01 xmik