[PR #766] [MERGED] Add option to make run command detachable #780

Closed
opened 2025-10-31 15:21:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/766
Author: @bpbradley
Created: 8/25/2025
Status: Merged
Merged: 8/25/2025
Merged by: @mbecker20

Base: 1.19.2Head: run-stack-detached


📝 Commits (1)

  • 7ef39b2 Add option to make run command detachable

📊 Changes

7 files changed (+23 additions, -0 deletions)

View changed files

📝 bin/core/src/api/execute/stack.rs (+1 -0)
📝 bin/periphery/src/api/compose.rs (+4 -0)
📝 client/core/rs/src/api/execute/stack.rs (+3 -0)
📝 client/core/ts/src/types.ts (+2 -0)
📝 client/periphery/rs/src/api/compose.rs (+3 -0)
📝 frontend/public/client/types.d.ts (+2 -0)
📝 frontend/src/components/resources/procedure/config.tsx (+8 -0)

📄 Description

I missed this use case in original testing, but it may occasionally be necessary to run the command in a detached state, in the event of a long running command or one where periphery may be disconnected during run.

The only downside of running detached, which is why I didn't originally include it, is that you don't have access to the logs. For this reason, it defaults to disabled (previous behavior). And if you need the logs, you can get them and follow them in the same way by the process ID returned by the run command, which is printed to stdout.

So for example in an Action,

const update = (await komodo.execute_and_poll("RunStackService", {
stack: ...
service: ...
detach: true
....
})) as Types.Update;

const pid = update.logs.find(log => log.stage === "Compose Run").stdout;

And then you would be able to create a terminal on that server, and execute in terminal something like docker logs -f {pid} to stream the logs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/766 **Author:** [@bpbradley](https://github.com/bpbradley) **Created:** 8/25/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@mbecker20](https://github.com/mbecker20) **Base:** `1.19.2` ← **Head:** `run-stack-detached` --- ### 📝 Commits (1) - [`7ef39b2`](https://github.com/moghtech/komodo/commit/7ef39b2d1d82348cc97b297df2ef25415c1abf1c) Add option to make run command detachable ### 📊 Changes **7 files changed** (+23 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `bin/core/src/api/execute/stack.rs` (+1 -0) 📝 `bin/periphery/src/api/compose.rs` (+4 -0) 📝 `client/core/rs/src/api/execute/stack.rs` (+3 -0) 📝 `client/core/ts/src/types.ts` (+2 -0) 📝 `client/periphery/rs/src/api/compose.rs` (+3 -0) 📝 `frontend/public/client/types.d.ts` (+2 -0) 📝 `frontend/src/components/resources/procedure/config.tsx` (+8 -0) </details> ### 📄 Description I missed this use case in original testing, but it may occasionally be necessary to run the command in a detached state, in the event of a long running command or one where periphery may be disconnected during run. The only downside of running detached, which is why I didn't originally include it, is that you don't have access to the logs. For this reason, it defaults to disabled (previous behavior). And if you need the logs, you can get them and follow them in the same way by the process ID returned by the run command, which is printed to stdout. So for example in an Action, ```ts const update = (await komodo.execute_and_poll("RunStackService", { stack: ... service: ... detach: true .... })) as Types.Update; const pid = update.logs.find(log => log.stage === "Compose Run").stdout; ``` And then you would be able to create a terminal on that server, and execute in terminal something like `docker logs -f {pid}` to stream the logs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-10-31 15:21:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#780