-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Keith
committed
Mar 19, 2023
1 parent
2a60ad5
commit 8c2b9ec
Showing
818 changed files
with
145,568 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# startree-cli | ||
|
||
|
||
This is a naive CLI implementation for StarTree using the swagger.json file from the Apache Pinot server | ||
|
||
## Installation Instructions | ||
To use, copy releases/startree-arm64 to /usr/local/bin and then `chmod +x /usr/local/bin/startree-arm64` | ||
You will likely want to run `ln -s /usr/local/bin/startree-arm64 /usr/local/bin/startree` to make it easier to run | ||
|
||
To avoid having to manually set the hostname and auth token each time, create the following directory `mkdir -p /Users/$USER/.config/startree` then copy the config from `releases/config.yaml` to that new directory | ||
|
||
Edit the config.yaml and replace $HOSTNAME with the hostname of your cluster (something like pinot.startree.cloud, do not include https://) and replace ${TOKEN} with your API token. Note that this field is encapsulated and requires the auth type prepended, so it should look something like: | ||
`Authorization: 'Basic OIFDGsjfe24234sdfdfsdv...='` | ||
|
||
## Usage instructions | ||
|
||
This "should" work identically to the swagger UI that's hosted in the cluster. All functions include any help text that was included in the original swagger.json. | ||
|
||
If something isn't working as expected, the `--debug` flag is useful to see what is actually going on. | ||
|
||
### Enable Shell Completion on Mac | ||
|
||
To enable shell completion on mac, first you will need to enable Shell Completion in zsh. Run the following command once: | ||
|
||
`echo "autoload -U compinit; compinit" >> ~/.zshrc` | ||
|
||
After that, you can run the following command to enable shell completion for the current session. | ||
|
||
`source <(startree completion zsh)` | ||
|
||
If you would like to add this permanently to the system, you can do the following: | ||
``` | ||
mkdir -p ${fpath[1]} | ||
chown $USER ${fpath[1]} | ||
sudo startree completion zsh > "${fpath[1]}/_startree" | ||
``` | ||
|
||
## Building / Development | ||
|
||
This CLI was built using the swagger build tools from https://goswagger.io/generate/cli.html | ||
|
||
To install swagger, you can download the appropriate binary from https://github.com/go-swagger/go-swagger/releases/ and copy it to `/usr/local/bin` | ||
|
||
Make sure your clone of this repo is in your $GOPATH, `cd src`, and then run the following commands: | ||
``` | ||
go mod tidy | ||
swagger generate cli -f swagger.json --cli-app-name startree | ||
go build -o cmd/startree/main.go | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Authorization: 'Basic ${TOKEN}' | ||
hostname: $HOSTNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
startree-arm64 |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.