Skip to content

Commit 5e27782

Browse files
Publishing artifacts based on GH actions. Included simple one-liner to get the tool without go (#79)
1 parent 697bcba commit 5e27782

File tree

5 files changed

+148
-16
lines changed

5 files changed

+148
-16
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '19 18 * * 4'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .github/workflows/github-release-publish.yml
2+
name: Publish artifacts to github release
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
releases-matrix:
10+
name: Release Go Binary
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
goos: [linux, darwin]
15+
goarch: [amd64, arm64]
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: wangyoucao577/go-release-action@v1.28
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
goos: ${{ matrix.goos }}
22+
goarch: ${{ matrix.goarch }}
23+
binary_name: "./bin/ftsb_redisearch"
24+
sha256sum: true
25+
asset_name: ftsb_redisearch-${{ matrix.goos }}-${{ matrix.goarch }}
26+
build_command: "make ftsb_redisearch"

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
1717
config-name: release-drafter-config.yml
1818
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ fmt:
3030

3131
ftsb_redisearch: test
3232
$(GOBUILD) -o bin/$@ ./cmd/$@
33-
$(GOINSTALL) ./cmd/$@
3433

3534
get:
3635
$(GOGET) ./...
3736

3837
test: get
3938

40-
4139
release:
4240
$(GOGET) github.com/mitchellh/gox
4341
$(GOGET) github.com/tcnksm/ghr

README.md

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,44 @@ The aggregate queries are designed to be extremely costly both on computation an
4646

4747
### Installation
4848

49-
FTSB is a collection of Go programs (with some auxiliary bash and Python scripts). The easiest way to get and install the Go programs is to use go get and then issuing make:
49+
#### Download Standalone binaries ( no Golang needed )
50+
51+
If you don't have go on your machine and just want to use the produced binaries you can download the following prebuilt bins:
52+
53+
https://github.com/RediSearch/ftsb/releases/latest
54+
55+
| OS | Arch | Link |
56+
| :--- | :---: | ---: |
57+
| Linux | amd64 (64-bit X86) | [ftsb_redisearch-linux-amd64](https://github.com/RediSearch/ftsb/releases/latest/download/ftsb_redisearch-linux-amd64.tar.gz) |
58+
| Linux | arm64 (64-bit ARM) | [ftsb_redisearch-linux-arm64](https://github.com/RediSearch/ftsb/releases/latest/download/ftsb_redisearch-linux-arm64.tar.gz) |
59+
| Darwin | amd64 (64-bit X86) | [ftsb_redisearch-darwin-amd64](https://github.com/RediSearch/ftsb/releases/latest/download/ftsb_redisearch-darwin-amd64.tar.gz) |
60+
| Darwin | arm64 (64-bit ARM) | [ftsb_redisearch-darwin-arm64](https://github.com/RediSearch/ftsb/releases/latest/download/ftsb_redisearch-darwin-arm64.tar.gz) |
61+
62+
Here's how bash script to download and try it:
63+
64+
```bash
65+
wget -c https://github.com/RediSearch/ftsb/releases/latest/download/ftsb_redisearch-$(uname -mrs | awk '{ print tolower($1) }')-$(dpkg --print-architecture).tar.gz -O - | tar -xz
66+
67+
# give it a try
68+
./ftsb_redisearch --help
5069
```
70+
71+
72+
#### Installation in a Golang env
73+
74+
To install the benchmark utility with a Go Env do as follow:
75+
76+
```bash
5177
# Fetch FTSB and its dependencies
5278
go get github.com/RediSearch/ftsb
5379
cd $GOPATH/src/github.com/RediSearch/ftsb
5480

5581
# Install desired binaries. At a minimum this includes ftsb_redisearch binary:
5682
make
57-
```
5883

84+
# give it a try
85+
./bin/ftsb_redisearch --help
86+
```
5987

6088

6189

@@ -96,11 +124,16 @@ Apart from the CSV files, and not mandatory, there is a benchmark suite specific
96124
So that benchmarking results are not affected by generating data or queries on-the-fly, you are always required to feed an input file to the benchmark runner that respects the previous specification format. The overall idea is that the benchmark runner only concerns himself on executing the queries as fast as possible while enabling client runtime variations that influence performance ( and are not related to the use-case himself ) like, command pipelining ( auto pipelining based on time or number of commands ), cluster support, number of concurrent clients, rate limiting ( to find sustainable throughputs ), etc…
97125

98126
Running a benchmark is as simple as feeding an input file to the DB benchmark runner ( in this case ftsb_redisearch ):
99-
```
127+
128+
```bash
129+
100130
ftsb_redisearch --file ecommerce-inventory.redisearch.commands.BENCH.csv
101131
```
132+
133+
102134
The resulting stdout output will look similar to this:
103-
```
135+
136+
```bash
104137
$ ftsb_redisearch --file ecommerce-inventory.redisearch.commands.BENCH.csv
105138
setup writes/sec writes/sec updates/sec reads/sec cursor reads/sec deletes/sec current ops/sec total ops TX BW/sRX BW/s
106139
0 (0.000) 0 (0.000) 1571 (2.623) 288 (7.451) 0 (0.000) 0 (0.000) 1859 (3.713) 1860 3.1KB/s 1.4MB/s
@@ -122,30 +155,35 @@ Issued 9885 Commands in 5.455sec with 8 workers
122155
Overall TX Byte Rate: 3KB/sec
123156
Overall RX Byte Rate: 1.4MB/sec
124157
```
158+
159+
125160
Apart from the input file, you should also always specify the name of JSON output file to output benchmark results, in order to do more complex analysis or store the results. Here is the full list of supported options:
126-
```
127-
$ ftsb_redisearch -h
128-
Usage of ftsb_redisearch:
161+
162+
```bash
163+
$ ./ftsb_redisearch --help
164+
Usage of ./bin/ftsb_redisearch:
165+
-a string
166+
Password for Redis Auth.
129167
-cluster-mode
130168
If set to true, it will run the client in cluster mode.
169+
-continue-on-error
170+
If set to true, it will continue the benchmark and print the error message to stderr.
131171
-debug int
132172
Debug printing (choices: 0, 1, 2). (default 0)
133173
-do-benchmark
134174
Whether to write databuild. Set this flag to false to check input read speed. (default true)
135-
-file string
136-
File name to read databuild from
137175
-host string
138176
The host:port for Redis connection (default "localhost:6379")
177+
-input string
178+
File name to read databuild from
139179
-json-out-file string
140180
Name of json output file to output benchmark results. If not set, will not print to json.
141181
-max-rps uint
142182
enable limiting the rate of queries per second, 0 = no limit. By default no limit is specified and the binaries will stress the DB up to the maximum. A normal "modus operandi" would be to initially stress the system ( no limit on RPS) and afterwards that we know the limit vary with lower rps configurations.
143183
-metadata-string string
144184
Metadata string to add to json-out-file. If -json-out-file is not set, will not use this option.
145-
-pipeline-max-size int
146-
If limit is zero then no limit will be used and pipelines will only be limited by the specified time window (default 100)
147-
-pipeline-window-ms float
148-
If window is zero then implicit pipelining will be disabled (default 0.5)
185+
-pipeline int
186+
Pipeline <numreq> requests. Default 1 (no pipeline). (default 1)
149187
-reporting-period duration
150188
Period to report write stats (default 1s)
151189
-requests uint

0 commit comments

Comments
 (0)