hashicorp / damon Goto Github PK
View Code? Open in Web Editor NEWA terminal UI (TUI) for HashiCorp Nomad
License: Mozilla Public License 2.0
A terminal UI (TUI) for HashiCorp Nomad
License: Mozilla Public License 2.0
I have e79c4a3 check out and my repo is clean.
β― make build
go build -o bin/damon ./cmd/damon
go: github.com/rivo/[email protected] requires
github.com/gdamore/tcell/[email protected]: missing go.sum entry; to add it:
go mod download github.com/gdamore/tcell/v2
make: *** [build] Error 1
It would be really useful to include the commit short sha when printing version information, especially while damon is still early in development. This would help with completing bug reports but would also make it easier to understand if a rebuild and install worked.
Thanks!
It would be cool to be able to specify a highlight string/regex to quickly see log lines that I'm looking for. This is a great feature of multitail. https://www.vanheusden.com/multitail/
Workflow Name: Nightly Release
Branch: main
Run URL: https://github.com/hashicorp/damon/actions/runs/4776194691
save-state deprecation warnings: 0
set-output deprecation warnings: 1
node12 deprecation warnings: 3
Please review these deprecation warnings as soon as possible and merge in the necessary updates.
GitHub will be removing support for these commands and plan to fully disable them on 31st May 2023. At this time, any workflow that still utilizes these commands will fail. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/.
GitHub have not finalized a date for deprecating node12 yet but have indicated that this will be summer 2023. So it is advised to switch to node16 asap. See https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
If you need any help, please reach out to us in #team-rel-eng.
panic: runtime error: index out of range [507] with length 0 [recovered]
panic: runtime error: index out of range [507] with length 0
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0x1400021c1c0)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/application.go:243 +0x7c
panic(0x104d10c80, 0x1400013c4b0)
/opt/homebrew/Cellar/go/1.16/libexec/src/runtime/panic.go:965 +0x14c
github.com/rivo/tview.(*TextView).Draw(0x14000200600, 0x104d50218, 0x14000254240)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/textview.go:1017 +0xb18
github.com/rivo/tview.(*Flex).Draw(0x14000069590, 0x104d50218, 0x14000254240)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/flex.go:183 +0x2b8
github.com/rivo/tview.(*Flex).Draw(0x140000695c0, 0x104d50218, 0x14000254240)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/flex.go:183 +0x2b8
github.com/rivo/tview.(*Pages).Draw(0x14000069680, 0x104d50218, 0x14000254240)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/pages.go:277 +0xb0
github.com/rivo/tview.(*Application).draw(0x1400021c1c0, 0x0)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/application.go:597 +0xac
github.com/rivo/tview.(*Application).Draw.func1()
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/application.go:550 +0x28
github.com/rivo/tview.(*Application).Run(0x1400021c1c0, 0x0, 0x0)
/Users/james/go/pkg/mod/github.com/rivo/[email protected]/application.go:376 +0x850
main.main()
/Users/james/Developer/damon/cmd/damon/main.go:104 +0x9d8
Fresh install of damon, nomad is remote with anonymous acl write access.
If I press a key after more than a short ( < 1s?) time has passed, I get an "Unexpected response code: 500 (Permission Denied)". At this point, the only action is to press enter/escape/ctrl+c, which does nothing, and then any key press, which will then quit. If I press enter before that short time window, then I can trigger the error dialog and then press enter to pop up a level and continue to navigate despite the large error window in the center of the screen. Commenting out line 128 of watcher/watcher.go
lets me browse uninterrupted so it doesn't seem all that fatal.
It would be nice to be able to close the dialog box without quitting the application. Secondarily, the modal behavior seems to race with other ui interactions.
Running on ubuntu 20.04/tmux/kitty
Totally understand that this is early stage and I was just tooling around with it and wanted to pass along my experience. It's super cool and look forward to seeing more!
Currently, when viewing logs for an allocation that has multiple tasks, it will pick a task randomly to show the logs.
Add a selection to Damon that allows users to select a task from a task list.
It would be nice if Damon provided the list of ports that a job has allocated and their mappings on the client. :)
To increase the test coverage for Damon, add tests to the watcher
package.
Currently, a subscriber (that can be a particular view like the Job View) can subscribe to only a single topic (Jobs, Allocs, Deployments). However, there is use-cases where a view is interested in multiple topics.
Update the watcher such that a subscriber can subscribe to multiple topics and that a view is notified for all subscribed topics.
Hi,
Can some clever person help fixing the Dockerfile? :)
Andre
When selecting an allocation from the list to view logs, if the allocation has more than one task it appears to be selecting the task to show logs for at random.
$ nomad alloc status 92ffac07 | grep '^Task "'
Task "postgres" (prestart sidecar) is "running"
Task "sonarperl" is "running"
In this case, I've had both the logs for the postgres
the sonarperl
tasks be shown without any indication as to why it was selected.
I checked the projects board and didn't see anything that looked like this so I figured I'd open the issue just in case.
Let me know if I can provide any further info!
This will allow users of Damon to start/stop a job from the Jobs View.
ctrl-s
to stop the running job
ctrl-s
to start the running job
This tool is great!
I'd love quick exec access to running tasks. It would make this tool extremely useful for troubleshooting.
I am getting a seg fault after running damon for ~10 seconds. The seg fault breaks the current terminal session and breaks formatting. I have copied the error below and tried to format it to make is a bit more readable.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6f9abe]
goroutine 37 [running]:
github.com/hcjulz/damon/nomad.getTasksFromAlloc(0xc0001901e8?, 0xc000a97e60?)
/home/.../damon/nomad/alloc.go:61 +0x1be
github.com/hcjulz/damon/nomad.(*Nomad).toAllocs(0xc000220180, {0xc000ac8000, 0x43, 0xc0002749f0?})
/home/.../damon/nomad/alloc.go:87 +0x12b
github.com/hcjulz/damon/nomad.(*Nomad).Allocations(0xc000220180, 0xc0000a4f60?)
/home/.../damon/nomad/alloc.go:47 +0xc8
github.com/hcjulz/damon/watcher.(*Watcher).updateAllocations(0xc0000a6550)
/home/.../damon/watcher/watcher.go:185 +0x57
github.com/hcjulz/damon/watcher.(*Watcher).update(0x75d460?, {0x7c5971, 0xa})
/home/.../damon/watcher/watcher.go:156 +0x72
github.com/hcjulz/damon/watcher.(*Watcher).Watch(0xc0000a6550)
/home/.../damon/watcher/watcher.go:130 +0x1d7
created by main.main
/home/.../tools/damon/cmd/damon/main.go:100 +0xeb6
I compiled Damon using Go 1.19
$ go version
go version go1.19 linux/amd64
How do you draw to a terminal aware of the height of the terminal? I know with ANSI control codes you can move the cursor to print on a preceding line or clear the screen and rewrite, but I've never seen how to implement a more complex full terminal screen rendering application.
I did a skim of ./layout and ./view and didn't notice anything.
Looking at the Jobs in the Jobs View won't give a user any information about the status of the tasks: eg how many tasks are running.
Add a Summary
column to the Job Table such that the total number of tasks and the actual number of running tasks are visible (eg 1/2
= 1 out of 2 tasks are running).
The rows with jobs that don't have all tasks running should be displayed in another colour.
ctrl-s
and confirm to stop the running jobctrl-s
again to confirm to start the running job0/1
to 1/1
eventually.The current summary data in Jobs view is not very intuitive. Currently it shows, how many groups are running out of total groups in a Job. But people are really interested on whether the desired allocs are running and healthy within a job. Something similar to the below one. This is Job overview from Nomad UI dashboard.
We can show below detail in Summary.
<healthy allocs> / <running allocs> / <desired allocs>
The allocs should be the sum of allocs from each group. (Mostly each job will have one group. I still canβt find a good use case, where we run multiple groups in a Job)
I can give a PR on this change π . Let me know if this improvement make sense.
Hello, thanks for making damon
! It is a great TUI!
I came across this nil pointer dereference
bug:
$ NOMAD_ADDR=192.168.1.13:4646 damon
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x55bf74812a97]
goroutine 1 [running]:
github.com/hcjulz/damon/nomad.(*Nomad).Namespaces(0xc00017fe30?, 0x55bf7495c1c0?)
/home/h/.cache/paru/clone/damon-git/src/damon/nomad/namespaces.go:13 +0x17
main.initializeState(0x0)
/home/h/.cache/paru/clone/damon-git/src/damon/cmd/damon/main.go:116 +0xeb
main.main()
/home/h/.cache/paru/clone/damon-git/src/damon/cmd/damon/main.go:49 +0x13b
But if I use NOMAD_ADDR=http://192.168.1.13:4646 damon
then it works as expected.
I'm new to Nomad and still learning about it, so I'm not sure what are all protocols supported to connect to a remote cluster. My suggestion is to issue a message/warning missing protocol in nomad address. It should be one of http://, https://, etc://. More details in <link to docs>.
and gracefully terminate.
Also, when the port is missing we see no message about that, just that damon
can't reach Nomad:
$ NOMAD_ADDR=http://192.168.1.13 damon
2023/10/18 12:54:22 cannot initialize view. Is Nomad running?
A suggestion to add the port in the address would be nice as well.
Some info on my system:
$ damon -v
Damon v0.1.0-dev (523ef4f)
$ nomad -v
Nomad v1.6.1
$ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
Sometimes it's really helpful to have stdout and stderr in the same window. I would love to have them optionally mixed together with color-coding for each.
The allocation view so far only gives the user the ability to show logs. Other valuable information for allocations is to show task information such as the task events. This information can be valuable when debugging failing containers.
Add the ability to the allocations view to show the events using the shortcut e
.
e
to see a table displaying the events for the allocations corresponding task.First off, this project is amazing and will be a staple in my day to day for a long time!
I just built the binary and was testing it out and I left the log viewer open on an allocation for maybe 30-60 seconds while I was reading the projects README when Damon crashed with the error below.
(Note, the TUI crashing left me unable to copypasta the error and it was a bit mangled format-wise in my terminal so I had to hand type it, apologies if the formatting is a bit different)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation on violation code=0x1 addr=0x10 pc=0x73a1b8]
goroutine 242 [running]:
github.com/hcjulz/damon/watcher.(*Watcher).SubscribeToLogs.func1(0xc0004c20c0, 0xc000254190, 0xc0006285a0, 0xc0004a23c0) /workspaces/damon/watcher/logs.go:35 +0x118
created by github.com/hcjulz/damon/watcher.(*Watcher).SubscribeToLogs /workspaces/damon/watcher/logs.go:31 +0x385
Environment Information
β consul-cluster git:(master) β cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
$ nomad version
Nomad v1.1.3 (8c0c8140997329136971e66e4c2337dfcf932692)
$ nomad server members
Name Address Port Status Leader Protocol Build Datacenter Region
nomad-0.global 10.0.0.2 4648 alive true 2 1.1.3 awe-prod-1 global
nomad-1.global 10.0.0.3 4648 alive false 2 1.1.3 awe-prod-1 global
nomad-2.global 10.0.0.4 4648 alive false 2 1.1.3 awe-prod-1 global
Haven't been able to reproduce the error again since but i'll try to watch more closely when monitoring logs to try and see if I can get some more context.
Hello guys,
I started to use damon version v0.1.0-dev (8ff5085)
with is a great tool for quick debugging.
Let's say I deployed an application A in namespace NA and NB.
I noticied that when I'm in a namespace NA, I'm able to see taskgroup of namespace NB.
Anyone else noticed that?
Any fix soon?
If some-job
is selected to display the current allocations it will include all allocations of the job some
and job
.
This happens because the allocation view just applies a filter using a regexp
to display the correct allocations for a job. However, this regexp
needs to be adjusted to match only allocation with the task-group that match the selected jobID and only this jobID.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.