You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is a problem with the implementation of the stack management buttons.
This means, that in the current implementation in the frontend/src/pages/Compose.vue file
the decision when to show which buttons is not correct.
In the file the following function determines whether a stack is active:
active() {
return this.status === RUNNING ;
},
and then in the template a code like this determines whether to show the button or not:
This button is shown if we are not in edit mode and the stack is active. So the stack is in a running state
However in the backend the way that the program decides about whether a stack is in which state, is this:
static statusConvert(status : string) : number {
if (status.startsWith("created")) {
return CREATED_STACK;
} else if (status.includes("exited")) {
// If one of the service is exited, we consider the stack is exited
return EXITED;
} else if (status.startsWith("running")) {
// If there is no exited services, there should be only running services
return RUNNING;
} else {
return UNKNOWN;
}
}
So if there is an exited container in the compose file (in the stack) then the status of the stack is EXITED.
Here I would like to point out, that a stack can be still in a "running state" even if one of the containers has exited. For example, as there are programming patterns, there are container patterns, like sidecar container, init container, etc. In the case of the init container it will run, for example initialise some database or files, then exit, and other service containers will start after the initialisation. However in the current version of dockge, when the init container runs and it exists then dockge will set the status of the stack EXITED, and not show some important buttons to manage the stack. Dockge will assume, that the stack is in its initial state
The other direction is that the visibility of the stack management buttons is changed. This would solve issues like Closes #694 #724, since there is no need for a force delete button, since in the case of an error the following command can be used with the appropriate visible button:
docker-compose down
An example compose file for the above problem is the following:
I have created a pull-request to show one solution for this problem. (#908)
Even though I understand that you may dissmiss the pull-request, but please do not dissmiss the concept, since the current implementation is problematic and not in aligmnent with use of docker-compose commands.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently there is a problem with the implementation of the stack management buttons.
This means, that in the current implementation in the frontend/src/pages/Compose.vue file
the decision when to show which buttons is not correct.
In the file the following function determines whether a stack is active:
and then in the template a code like this determines whether to show the button or not:
This button is shown if we are not in edit mode and the stack is active. So the stack is in a running state
However in the backend the way that the program decides about whether a stack is in which state, is this:
So if there is an exited container in the compose file (in the stack) then the status of the stack is EXITED.
Here I would like to point out, that a stack can be still in a "running state" even if one of the containers has exited. For example, as there are programming patterns, there are container patterns, like sidecar container, init container, etc. In the case of the init container it will run, for example initialise some database or files, then exit, and other service containers will start after the initialisation. However in the current version of dockge, when the init container runs and it exists then dockge will set the status of the stack EXITED, and not show some important buttons to manage the stack. Dockge will assume, that the stack is in its initial state
I can see two directions:
An example compose file for the above problem is the following:
I have created a pull-request to show one solution for this problem. (#908)
Even though I understand that you may dissmiss the pull-request, but please do not dissmiss the concept, since the current implementation is problematic and not in aligmnent with use of docker-compose commands.
All reactions