Skip to content

Commit

Permalink
Merge pull request #418 from yetanalytics/bench_builder
Browse files Browse the repository at this point in the history
Bench builder
  • Loading branch information
cliffcaseyyet authored Jul 18, 2024
2 parents d84c01a + 620ffd7 commit 5c5739f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

build_jre:
needs: get_modules
uses: yetanalytics/runtimer/.github/workflows/runtimer.yml@0.1.2-java-11-temurin
uses: yetanalytics/runtimer/.github/workflows/runtimer.yml@0.1.3-java-11-temurin
with:
java-version: '11'
java-distribution: 'temurin'
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Download macOS-latest Artifact
uses: actions/download-artifact@v3
with:
name: macos-11-jre
name: macos-12-jre

- name: Download windows-latest Artifact
uses: actions/download-artifact@v3
Expand All @@ -65,8 +65,8 @@ jobs:
mkdir -p target/bundle/runtimes
unzip ubuntu-20.04-jre.zip -d target/bundle/runtimes
mv target/bundle/runtimes/ubuntu-20.04 target/bundle/runtimes/linux
unzip macos-11-jre.zip -d target/bundle/runtimes
mv target/bundle/runtimes/macos-11 target/bundle/runtimes/macos
unzip macos-12-jre.zip -d target/bundle/runtimes
mv target/bundle/runtimes/macos-12 target/bundle/runtimes/macos
unzip windows-2022-jre.zip -d target/bundle/runtimes
mv target/bundle/runtimes/windows-2022 target/bundle/runtimes/windows
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ clean-non-dl:
target/bundle/lrsql.jar: resources/public/admin
clojure -X:build uber

target/bundle/bench.jar:
clojure -X:build uber-bench

# Copy build scripts

target/bundle/bin:
Expand All @@ -149,6 +152,10 @@ target/bundle/bin:
target/bundle/doc:
clojure -X:doc

target/bundle/bench:
mkdir -p target/bundle/bench
cp -r dev-resources/default/. target/bundle/bench

# Copy LICENSE and NOTICE

target/bundle/LICENSE:
Expand Down Expand Up @@ -205,9 +212,9 @@ target/bundle/admin: resources/public/admin
BUNDLE_RUNTIMES ?= true

ifeq ($(BUNDLE_RUNTIMES),true)
target/bundle: target/bundle/config target/bundle/doc target/bundle/bin target/bundle/lrsql.jar target/bundle/admin target/bundle/lrsql.exe target/bundle/lrsql_pg.exe target/bundle/LICENSE target/bundle/NOTICE target/bundle/customization target/bundle/runtimes
target/bundle: target/bundle/config target/bundle/doc target/bundle/bin target/bundle/lrsql.jar target/bundle/admin target/bundle/lrsql.exe target/bundle/lrsql_pg.exe target/bundle/LICENSE target/bundle/NOTICE target/bundle/customization target/bundle/bench.jar target/bundle/bench target/bundle/runtimes
else
target/bundle: target/bundle/config target/bundle/doc target/bundle/bin target/bundle/lrsql.jar target/bundle/admin target/bundle/lrsql.exe target/bundle/lrsql_pg.exe target/bundle/LICENSE target/bundle/NOTICE target/bundle/customization
target/bundle: target/bundle/config target/bundle/doc target/bundle/bin target/bundle/lrsql.jar target/bundle/admin target/bundle/lrsql.exe target/bundle/lrsql_pg.exe target/bundle/LICENSE target/bundle/NOTICE target/bundle/customization target/bundle/bench.jar target/bundle/bench
endif

bundle: target/bundle
Expand Down
10 changes: 10 additions & 0 deletions doc/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,14 @@ After the bench has run, you should see results that look something like this:
| {"verb" "https://w3id.org/xapi/video/verbs/seeked"} | 20 | 3 | 33 | 18 | 604 |
```

#### 6. Compiled Benchmark Utility

A version of the benchmark utility is included with the release distribution bundle. The arguments are the same, running it is just slightly different:

```
java -cp bench.jar lrsql.bench [arguments]
```

Sample insert and query inputs can be found in the distribution at `bench/`

[<- Back to Index](index.md)
3 changes: 2 additions & 1 deletion src/bench/lrsql/bench.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
[babashka.curl :as curl]
[com.yetanalytics.datasim.sim :as sim]
[com.yetanalytics.datasim.input :as sim-input]
[lrsql.util :as u]))
[lrsql.util :as u])
(:gen-class))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Defs
Expand Down
29 changes: 29 additions & 0 deletions src/build/lrsql/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,32 @@
{:basis basis
:class-dir class-dir
:uber-file uberjar-file})))

;; Alternate Jar for just bencher
(def src-dirs-bench
["src/bench"])

(def uberjar-file-bench
"target/bundle/bench.jar")

(defn- create-basis-bench []
(b/create-basis
{:project "deps.edn"
:aliases [:bench]}))

(defn uber-bench
"Create Benchmark uberjar."
[_]
(let [basis (create-basis-bench)]
(b/copy-dir
{:src-dirs src-dirs-bench
:target-dir class-dir
:ignores ignored-file-regexes})
(b/compile-clj
{:basis basis
:src-dirs src-dirs-bench
:class-dir class-dir})
(b/uber
{:basis basis
:class-dir class-dir
:uber-file uberjar-file-bench})))

0 comments on commit 5c5739f

Please sign in to comment.