Skip to content

Commit

Permalink
[chore] Update README for v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robinovitch61 committed Jan 6, 2024
1 parent 0a4f6c8 commit 37c1f2b
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ mock.go
dist/
id_ed25519*
vendor
ignore.gif
**/*/my_logs.txt
59 changes: 41 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ An efficient terminal application/TUI for interacting with your [HashiCorp Nomad
- See full job or allocation specs
- Save any content to a local file

![](./img/wander.gif)
`wander` is written with tools from [Charm](https://charm.sh/).

![](./img/wander_flow.drawio.png)
[Feature requests and bug reports are welcome](https://github.com/robinovitch61/wander/issues/new/choose).

`wander` is written with tools from [Charm](https://charm.sh/).
## Demo

[Feature requests and bug reports for wander are welcome](https://github.com/robinovitch61/wander/issues/new/choose).
![](./img/wander.gif)

[Screenshots](./img/screenshots#readme)

## Flow Diagram
![](./img/wander_flow.drawio.png)

## Installation

Expand All @@ -50,17 +55,11 @@ yay -S wander-bin

# with go (https://go.dev/doc/install)
go install github.com/robinovitch61/wander@latest

# build from source
git clone git@github.com:robinovitch61/wander.git
cd wander
go build
mv ./wander /usr/local/bin # or somewhere else in your PATH

# alternatively download prebuilt release from https://github.com/robinovitch61/wander/releases
# and move the unpacked executable to somewhere in your PATH, e.g. /usr/local/bin
```

You can also download [prebuilt releases](https://github.com/robinovitch61/wander/releases) and move the unpacked
executable to somewhere in your `PATH`, e.g. `/usr/local/bin`.

## Usage

Run the app by running `wander` in a terminal. See `wander --help` and config section below for details.
Expand Down Expand Up @@ -219,6 +218,26 @@ Example yaml file showing all options (copy this into `$HOME/.wander.yaml` and u
#wander_logo_color: "#DBBD70"
```

## Exec Command

`wander` ships with an `exec` command similar to the [`nomad alloc exec`](https://developer.hashicorp.com/nomad/docs/commands/alloc/exec)
utility. Example usage:

```shell
# specify job and task, assuming single allocation
wander exec alright_stop --task redis echo "hi"

# specify allocation, assuming single task
wander exec 3dca0982 echo "hi"

# use prefixes of jobs or allocation ids
wander exec al echo "hi" # prefix of job "alright_stop"
wander exec 3d echo "hi" # prefix of alloc ID "3dca0982"

# specify flags for the exec command with --
wander exec alright_stop --task redis -- echo -n "hi"
```

## SSH App

`wander` can be served via ssh application. For example, you could host an internal ssh application for your company
Expand All @@ -232,8 +251,7 @@ Serve the ssh app with `wander serve`.

## Trying It Out

You can try `wander` out by running a local nomad cluster in dev mode
following [these instructions](https://learn.hashicorp.com/tutorials/nomad/get-started-run?in=nomad/get-started):
You can try `wander` out by running a local development nomad cluster following [these instructions](https://learn.hashicorp.com/tutorials/nomad/get-started-run?in=nomad/get-started):

```sh
# in first terminal session, start and leave nomad running in dev mode
Expand Down Expand Up @@ -261,9 +279,14 @@ In this case, you're responsible for ensuring the specified version is in sync w

## Development

The `scripts/dev.sh` script watches the source code and rebuilds the app on changes
using [entr](https://github.com/eradman/entr). Install the latest release of `nomad`.
To manually build:

```shell
git clone git@github.com:robinovitch61/wander.git
cd wander
go build # outputs ./wander executable
```

`wander` runs the built app. You must rerun it on rebuild.
The [scripts](/scripts) directory contains various development helper scripts.

If the `WANDER_DEBUG` environment variable is set to `true`, the `dev.Debug(s string)` function outputs to `wander.log`.
Binary file added img/screenshots/All_Jobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/All_Tasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/Allocation_Statistics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/Exec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/Global_Events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions img/screenshots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# All Jobs
![](./All_Jobs.png)
# Global Events
![](./Global_Events.png)
# All Tasks
![](./All_Tasks.png)
# Exec
![](./Exec.png)
# Tasks for Job
![](./Tasks_for_Job.png)
# Task Logs
![](./Task_Logs.png)
# Save Any View to Local File
![](./Save_Any_View_to_Local_File.png)
# Allocation Statistics
![](./Allocation_Statistics.png)
Binary file added img/screenshots/Save_Any_View_to_Local_File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/Task_Logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/screenshots/Tasks_for_Job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/wander.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

thisdir=${0:a:h}

ls $thisdir/../**/*.go | entr -c $thisdir/rebuild.sh
ls $thisdir/../**/*.go | entr -c $thisdir/rebuild.sh $1
15 changes: 14 additions & 1 deletion scripts/gif_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
# https://github.com/charmbracelet/vhs
# expects nomad to already be running locally
# should be run from scripts directory

rm -f /tmp/my_logs.txt
latest_tag=$(git describe --tags --abbrev=0)
tag=${1:-$latest_tag}
./rebuild.sh "$tag"
mv ~/.wander.{yaml,yaml.tmp}
vhs vhs.tape
open ../img/wander.gif
mv ~/.wander.{yaml.tmp,yaml}
rm -f my_logs.txt
open ../img/wander.gif
rm -f ../img/screenshots/README.md
# for files in ../img/screenshots/*.png sorted by modification time
for file in $(ls -t ../img/screenshots/*.png); do
filename=$(basename -- "$file")
filename="${filename%.*}"
echo "# ${filename//_/ }" >> ../img/screenshots/README.md
echo "![](./$filename.png)" >> ../img/screenshots/README.md
done
6 changes: 5 additions & 1 deletion scripts/rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
thisdir=${0:a:h}
rm -f $GOPATH/bin/wander
echo "building $(date +"%T")"
go build -o $thisdir/wander $thisdir/..
if [ $# -eq 1 ]; then
go build -ldflags "-X github.com/robinovitch61/wander/cmd.Version=$1" -o $thisdir/wander $thisdir/..
else
go build -o $thisdir/wander $thisdir/..
fi
if [ -f $thisdir/wander ]; then
mv $thisdir/wander $GOPATH/bin/wander
echo "built"
Expand Down
27 changes: 22 additions & 5 deletions scripts/vhs.tape
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,21 @@ Set Framerate 15
Hide
Type "wander"
Enter
Sleep 200ms
Sleep 500ms
Show

# All Jobs
Sleep 1s
Type@500ms "jj"
Type@500ms "k"
Sleep 101ms
Screenshot ../img/screenshots/All_Jobs.png
Sleep 1s

# All Events
Type "V"
Sleep 100ms
Screenshot ../img/screenshots/Global_Events.png
Sleep 2s
Type@300ms "j"
Enter
Expand All @@ -74,6 +78,8 @@ Sleep 1s

# All Tasks
Type "A"
Sleep 100ms
Screenshot ../img/screenshots/All_Tasks.png
Sleep 1s
Type@500ms "jj"
Type@500ms "k"
Expand All @@ -89,6 +95,8 @@ Enter
Type@150ms "ls -la"
Sleep 300ms
Enter
Sleep 100ms
Screenshot ../img/screenshots/Exec.png
Sleep 2s
Ctrl+d
Sleep 2s
Expand All @@ -101,10 +109,14 @@ Sleep 1s

# Tasks for Job
Enter
Sleep 100ms
Screenshot ../img/screenshots/Tasks_for_Job.png
Sleep 2s

# Logs for Task, Filtering
Enter
Sleep 100ms
Screenshot ../img/screenshots/Task_Logs.png
Sleep 2s
Type "/"
Sleep 1s
Expand All @@ -119,19 +131,24 @@ Escape@200ms 2

# Save Logs
Ctrl+S
Type@100ms "my_logs.txt"
Type@100ms "/tmp/my_logs.txt"
Sleep 500ms
Enter
Sleep 3s
Sleep 500ms
Screenshot ../img/screenshots/Save_Any_View_to_Local_File.png
Sleep 2.5s

# Back to Tasks for Job
Escape
Sleep 1s

# Stats for Allocation
Type "s"
Sleep 100ms
Screenshot ../img/screenshots/Allocation_Statistics.png
Sleep 2s

# Back to Tasks for Job
Escape
# Exit
Hide
Ctrl+c
Sleep 1s

0 comments on commit 37c1f2b

Please sign in to comment.