Skip to content

Conversation

@iignatevich
Copy link
Contributor

No description provided.

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from 6b8e65f to 7b6fb7a Compare March 27, 2025 14:58
@iberdinsky-skilld iberdinsky-skilld changed the title add terminate functionality Draft: add terminate functionality Mar 27, 2025
@iberdinsky-skilld
Copy link
Contributor

iberdinsky-skilld commented Mar 31, 2025

To complete the task, I needed to update the context functionality.

Now the task status can be understood from anywhere in the application.

In addition, I added several new features that may be useful in the future.

  1. The task execution status is displayed as a throbber.
  2. Previously launched tasks are displayed as colored dots. A red dot is an error, a green dot is successfully completed.
  3. Updated the terminal button, and now it shows the number of running, errored, and completed processes.
  4. Improved error handling, and now if Docker is not running, the user will know about it.
  5. Added the ability to cancel a task.

Status and history

Image from Gyazo

Tab button improvements

Image from Gyazo

Stop process

Image from Gyazo

Updated errors display

Image from Gyazo

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from 4a25040 to 5594532 Compare April 6, 2025 16:17
@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from 5594532 to c063e58 Compare April 14, 2025 08:30
@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch 2 times, most recently from 35b36be to afe5122 Compare April 16, 2025 07:11
@davidferlay
Copy link
Contributor

davidferlay commented Apr 16, 2025

  • "go to form page" button not necessary
    image

  • in some / lot's of case, button to display action logs/terminal is not present
    image

  • in all cases, output of action executed in empty in logs/terminal
    image

  • in some case "Submit" action button is disabled and action cannot be executed
    image

Binary build with:

export WEB_BRANCH=113-add-terminate-button-for-running-actions
cd ~/Sources/web
git fetch
git checkout ${WEB_BRANCH}
make deps front-install front-build
plasmactl build --no-cache -t 500s --tag nethttpomithttp2 -vvv --tag dev \
-p github.com/launchrctl/launchr@latest \
-p github.com/launchrctl/compose@latest \
-p github.com/launchrctl/keyring@latest \
-p github.com/skilld-labs/plasmactl-bump/v2@latest \
-p github.com/skilld-labs/plasmactl-meta@latest \
-p github.com/skilld-labs/plasmactl-update@latest \
-p github.com/skilld-labs/plasmactl-dependencies@latest \
-p github.com/launchrctl/web@${WEB_BRANCH} \
-n plasmactl -o plasmactlx --build-version v0.0.0
cp plasmactlx ~/go/bin/

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from afe5122 to d45af54 Compare April 20, 2025 08:57
@iberdinsky-skilld
Copy link
Contributor

@iignatevich @davidferlay
we probably need to manage test build somehow.
when i use that command

plasmactl build --no-cache -t 500s --tag nethttpomithttp2 -vvv --tag dev \
-p github.com/launchrctl/launchr@latest \
-p github.com/launchrctl/compose@latest \
-p github.com/launchrctl/keyring@latest \
-p github.com/skilld-labs/plasmactl-bump/v2@latest \
-p github.com/skilld-labs/plasmactl-meta@latest \
-p github.com/skilld-labs/plasmactl-update@latest \
-p github.com/skilld-labs/plasmactl-dependencies@latest \
-p github.com/launchrctl/web@${WEB_BRANCH} \
-n plasmactl -o plasmactlx --build-version v0.0.0

i see that app builded with release version. and not with branch version.

 INFO  Using github release assets: https://github.com/launchrctl/web/releases/download/v0.14.1/client-assets.tar.gz

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from d45af54 to 6940334 Compare April 20, 2025 12:34
@davidferlay
Copy link
Contributor

davidferlay commented Apr 25, 2025

Second round of testing: Things look better after loading correct ui assets 👌

  • Could you make the "Stop process" button a little less scary ? 😄 Maybe we can rename it to "Cancel", what's your opinion ?

image

  • Clicking the "Stop process" button does not seem to stop the process (docker container for action with container runtime)

image

  • Processes manually terminated by user appear as "Error" in action history list. Would be great to have a grey style "Terminated" or "Canceled" state for that
    • Note: let's double check that it works for all runtime: native plugins, container, shell

image

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from 6940334 to 539c21f Compare April 30, 2025 06:49
@iberdinsky-skilld
Copy link
Contributor

Could you make the "Stop process" button a little less scary ? 😄 Maybe we can rename it to "Cancel", what's your opinion ?

I removed icon. and set it as cancel

Processes manually terminated by user appear as "Error" in action history list. Would be great to have a grey style "Terminated" or "Canceled" state for that Note: let's double check that it works for all runtime: native plugins, container, shell

We have statuses displayed https://github.com/launchrctl/web/blob/main/server/openapi.yaml#L300
Should we add new one. @iignatevich please check

@iberdinsky-skilld iberdinsky-skilld force-pushed the 113-add-terminate-button-for-running-actions branch from 539c21f to fd26f27 Compare April 30, 2025 07:13
@davidferlay
Copy link
Contributor

Thanks!

Let's change style of cancel button to something more neutral / grey / black / transparent
image

then backend remaining:

  • Make sure button actualy stops running action
  • Make it appear not as "Error" but "Canceled" in history

date
pwd
whoami
env
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here could be secrets, please care

@iberdinsky-skilld
Copy link
Contributor

Image from Gyazo

@davidferlay
Copy link
Contributor

New round of test: executing local fs actions like platform:nodes and platform:nodes make process to panic:

➜ plasmactlx web --ui-assets=/home/dferlay/Sources/web/client/dist --foreground --keyring-passphrase-file /tmp/kp
 INFO  You can reach the web server at this URL: http://localhost:8080
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9f9161]

goroutine 132 [running]:
github.com/launchrctl/launchr/pkg/action.(*RuntimeWithLogger).Log(...)
	github.com/launchrctl/[email protected]/pkg/action/runtime.go:80
github.com/launchrctl/launchr/pkg/action.(*runtimeContainer).Execute(0xc000155c20, {0x1632288?, 0xc0002c4a50?}, 0xc000155b80)
	github.com/launchrctl/[email protected]/pkg/action/runtime.container.go:189 +0x341
github.com/launchrctl/launchr/pkg/action.(*Action).Execute(0xc000155b80, {0x1632288, 0xc0002c4a50})
	github.com/launchrctl/[email protected]/pkg/action/action.go:340 +0xeb
github.com/launchrctl/launchr/pkg/action.(*runManagerMap).RunBackground.func1()
	github.com/launchrctl/[email protected]/pkg/action/manager.go:386 +0x71
created by github.com/launchrctl/launchr/pkg/action.(*runManagerMap).RunBackground in goroutine 60
	github.com/launchrctl/[email protected]/pkg/action/manager.go:384 +0x1ba

as well as nothing appearing in webUI except an undefined error

image

@davidferlay
Copy link
Contributor

Was missing to build with branch add_cancelled_status_to_action_run_info from launchr, all good now 👍

Although it looks like canceling process does not actually stop running docker container

image

Gonna try to check if issue also present for plugin/shell runtime

@davidferlay
Copy link
Contributor

Looks like issue is also present with runtime shell:
image

And runtime plugin:
image

@iignatevich
Copy link
Contributor Author

i'm not sure we can achieve action interrupt to work in the same way as terminal in current state of web
it's basically written as web server and runs new background actions as goroutines, which are async functions. Only way to stop it - via context cancel (gracefully)
they are not separated by process which we can kill (only shell i think), so probably we should stick with it right now and tweak actions/runtimes to work as we need.

other things, terminal related will be investigated in 'interactivity' issue.
and it could lead to rewriting web to behave like term completely.

@davidferlay
Copy link
Contributor

Roger that, let's merge as is and revisit later when the need arrise

@iignatevich iignatevich force-pushed the 113-add-terminate-button-for-running-actions branch from 227ceca to 2dcf1e2 Compare May 12, 2025 14:43
@iignatevich iignatevich force-pushed the 113-add-terminate-button-for-running-actions branch from 2dcf1e2 to abbe68a Compare May 12, 2025 14:48
@davidferlay davidferlay merged commit c342513 into main May 12, 2025
@lexbritvin lexbritvin deleted the 113-add-terminate-button-for-running-actions branch May 30, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants