From 57536b9c7999cbfe5dd9e8a935ade3ccdac31b66 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Wed, 17 Jul 2024 15:51:57 -0400 Subject: [PATCH 1/3] uberjar for benchmarker compile --- Makefile | 11 +++++++++-- src/bench/lrsql/bench.clj | 3 ++- src/build/lrsql/build.clj | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1d1ae2f14..5309c2512 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -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: @@ -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 diff --git a/src/bench/lrsql/bench.clj b/src/bench/lrsql/bench.clj index e7b615712..fa1eeb995 100644 --- a/src/bench/lrsql/bench.clj +++ b/src/bench/lrsql/bench.clj @@ -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 diff --git a/src/build/lrsql/build.clj b/src/build/lrsql/build.clj index b616de6b4..1bfc6ce72 100644 --- a/src/build/lrsql/build.clj +++ b/src/build/lrsql/build.clj @@ -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}))) \ No newline at end of file From 135978218bf97840802d98e40750d2ef02c5ba9f Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Wed, 17 Jul 2024 15:58:12 -0400 Subject: [PATCH 2/3] cleanup --- doc/dev.md | 10 ++++++++++ src/build/lrsql/build.clj | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/dev.md b/doc/dev.md index dbfa747e3..ff4049fb3 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -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) diff --git a/src/build/lrsql/build.clj b/src/build/lrsql/build.clj index 1bfc6ce72..1517cfe18 100644 --- a/src/build/lrsql/build.clj +++ b/src/build/lrsql/build.clj @@ -77,4 +77,4 @@ (b/uber {:basis basis :class-dir class-dir - :uber-file uberjar-file-bench}))) \ No newline at end of file + :uber-file uberjar-file-bench}))) From 620ffd7d2fa91d68c880a587a8658e7da8983de6 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Thu, 18 Jul 2024 11:35:46 -0400 Subject: [PATCH 3/3] runtimer update --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab17e857d..08653e6be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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' @@ -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 @@ -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