difftreelog
ci more realworld benchmarks
in: master
12 files changed
flake.nixdiffbeforeafterboth--- a/flake.nix
+++ b/flake.nix
@@ -218,6 +218,9 @@
in
{
legacyPackages = {
+ fetchJrq = pkgs.callPackage ./nix/fetch-jrq.nix {
+ inherit (self'.packages) jrsonnet;
+ };
release = optionalAttrs pkgs.stdenv.hostPlatform.isLinux (
{
jrsonnet-linux-glibc = self'.packages.jrsonnet;
@@ -254,6 +257,7 @@
);
benchmarks = optionalAttrs (system == "x86_64-linux" || system == "aarch64-linux") {
default = pkgs.callPackage ./nix/benchmarks.nix {
+ inherit (config.legacyPackages) fetchJrq;
inherit (config.legacyPackages.jsonnetImpls)
go-jsonnet
sjsonnet
@@ -268,6 +272,7 @@
];
};
quick = pkgs.callPackage ./nix/benchmarks.nix {
+ inherit (config.legacyPackages) fetchJrq;
inherit (config.legacyPackages.jsonnetImpls)
go-jsonnet
sjsonnet
@@ -283,6 +288,7 @@
];
};
against-release = pkgs.callPackage ./nix/benchmarks.nix {
+ inherit (config.legacyPackages) fetchJrq;
inherit (config.legacyPackages.jsonnetImpls)
go-jsonnet
sjsonnet
@@ -305,6 +311,7 @@
];
};
quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {
+ inherit (config.legacyPackages) fetchJrq;
inherit (config.legacyPackages.jsonnetImpls)
go-jsonnet
sjsonnet
nix/benchmarks.nixdiffbeforeafterboth1{1{2 lib,2 lib,3 runCommand,3 runCommand,4 jsonnet-bundler,5 cacert,6 stdenv,4 stdenv,7 fetchFromGitHub,5 fetchFromGitHub,6 fetchJrq,8 go-jsonnet,7 go-jsonnet,9 sjsonnet,8 sjsonnet,10 cpp-jsonnet,9 cpp-jsonnet,23 rev = "bc305df3fe587960f7635f0185571500e5988475";22 rev = "bc305df3fe587960f7635f0185571500e5988475";24 hash = "sha256-4EKB1b2o4/qtYQ+nqbbs621OJrtjApsAWEBcw5EjrYc=";23 hash = "sha256-4EKB1b2o4/qtYQ+nqbbs621OJrtjApsAWEBcw5EjrYc=";25 };24 };26 kubePrometheusBench =25 realworldVendor = fetchJrq {27 let28 src = fetchFromGitHub {29 owner = "prometheus-operator";26 name = "realworld-vendor";30 repo = "kube-prometheus";27 lockfile = ../tests/realworld/jsonnetfile.lock.json;31 rev = "d3889807798d1697ea0691f10caf1b6a1997a8bd";32 hash = "sha256-TeYWHzoZAmDp2PzT7EH8XRUcvb3tR8Qfxel7o2QBvIM=";28 vendorHash = "sha256-6tXi6bRw77YKB17PhSpJnVYQcsGOvB8sgjKIrFtrwfc=";33 };29 };34 in30 realworldBench = runCommand "realworld-bench" { } ''35 runCommand "kube-prometheus-vendor"31 mkdir -p $out36 {32 cp ${../tests/realworld}/*.jsonnet ${../tests/realworld}/*.libsonnet $out/37 outputHash = "sha256-AGc0dHlD/Ld7I5b1+gOotzJkYrn+bB1VjISdD5NITtw=";33 cp -r ${realworldVendor} $out/vendor38 outputHashMode = "recursive";34 '';39 buildInputs = [ cacert ];40 }41 ''42 mkdir -p $out43 cp -r ${src}/* $out/44 cd $out45 chmod u+w jsonnetfile.lock.json46 mkdir vendor47 ${jsonnet-bundler}/bin/jb install48 '';493550 # Removes outsiders from the output36 # Removes outsiders from the output51 # Useful when comparing performance of different jrsonnet releases37 # Useful when comparing performance of different jrsonnet releases77 skipScala ? "",63 skipScala ? "",78 skipCpp ? "",64 skipCpp ? "",79 skipGo ? "",65 skipGo ? "",80 vendor ? "",66 jpaths ? [ ],81 }:67 }:68 let69 jpathArgs = concatMapStrings (p: " -J ${p}") jpaths;70 in82 ''71 ''83 echo >> $out72 echo >> $out84 echo "=== ${name}" >> $out73 echo "=== ${name}" >> $out85 echo >> $out74 echo >> $out86 ${optionalString (skipRustAlternative != "") ''75 ${optionalString (skipRustAlternative != "") ''87 echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out76 echo "> Note: No results for Rust (alternative), ${skipRustAlternative}" >> $out88 echo >> $out77 echo >> $out89 ''}78 ''}90 ${optionalString (skipGo != "") ''79 ${optionalString (skipGo != "") ''91 echo "> Note: No results for Go, ${skipGo}" >> $out80 echo "> Note: No results for Go, ${skipGo}" >> $out92 echo >> $out81 echo >> $out93 ''}82 ''}94 ${optionalString (skipScala != "") ''83 ${optionalString (skipScala != "") ''95 echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out84 echo "> Note: No results for Scala (native)/Scala (GraalVM), ${skipScala}" >> $out96 echo >> $out85 echo >> $out97 ''}86 ''}98 ${optionalString (skipCpp != "") ''87 ${optionalString (skipCpp != "") ''99 echo "> Note: No results for C++, ${skipCpp}" >> $out88 echo "> Note: No results for C++, ${skipCpp}" >> $out100 echo >> $out89 echo >> $out101 ''}90 ''}102 ${optionalString (!omitSource) ''91 ${optionalString (!omitSource) ''103 echo ".Source" >> $out92 echo ".Source" >> $out104 echo "[%collapsible]" >> $out93 echo "[%collapsible]" >> $out105 echo "====" >> $out94 echo "====" >> $out106 echo "[source,jsonnet]" >> $out95 echo "[source,jsonnet]" >> $out107 echo "----" >> $out96 echo "----" >> $out108 ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}97 ${optionalString pathIsGenerator "echo \"// Generator source\" >> $out"}109 cat ${path} >> $out98 cat ${path} >> $out110 echo >> $out99 echo >> $out111 echo "----" >> $out100 echo "----" >> $out112 echo "====" >> $out101 echo "====" >> $out113 echo >> $out102 echo >> $out114 ''}103 ''}115 path=${path}104 path=${path}116 ${optionalString pathIsGenerator ''105 ${optionalString pathIsGenerator ''117 go-jsonnet $path > generated.jsonnet106 go-jsonnet $path > generated.jsonnet118 path=generated.jsonnet107 path=generated.jsonnet119 ''}108 ''}120 hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \109 hyperfine -N -w4 -m20 --output=pipe --style=basic --export-asciidoc result.adoc \121 ${110 ${122 concatStringsSep " " (111 concatStringsSep " " (123 forEach jrsonnetVariants (112 forEach jrsonnetVariants (124 variant:113 variant:125 "\"${variant.drv}/bin/jrsonnet $path${optionalString (vendor != "") " -J${vendor}"}\" -n \"Rust${114 "\"${variant.drv}/bin/jrsonnet $path${jpathArgs}\" -n \"Rust${126 if variant.name != "" then " (${variant.name})" else ""115 if variant.name != "" then " (${variant.name})" else ""127 }\""116 }\""128 )117 )129 )118 )130 } \119 } \131 ${120 ${132 optionalString (skipRustAlternative == "")121 optionalString (skipRustAlternative == "")133 "\"rsjsonnet $path${122 "\"rsjsonnet $path${jpathArgs}\" -n \"Rust (alternative, rsjsonnet)\""134 optionalString (vendor != "") " -J ${vendor}"135 }\" -n \"Rust (alternative, rsjsonnet)\""123 } \136 } \124 ${137 ${125 optionalString (skipGo == "")138 optionalString (skipGo == "")126 "\"go-jsonnet $path${jpathArgs}\" -n \"Go\""139 "\"go-jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Go\""127 } \140 } \128 ${141 ${129 optionalString (skipScala == "")142 optionalString (skipScala == "")130 "\"sjsonnet-native $path${jpathArgs}\" -n \"Scala (native)\""143 "\"sjsonnet-native $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (native)\""131 } \144 } \132 ${145 ${133 # My aarch64-linux machine can't run graalvm image:146 # My aarch64-linux machine can't run graalvm image:134 # The current machine does not support all of the following CPU features that are required by the image: [FP, ASIMD, CRC32, LSE].147 # The current machine does not support all of the following CPU features that are required by the image: [FP, ASIMD, CRC32, LSE].135 optionalString (skipScala == "" && stdenv.hostPlatform.system != "aarch64-linux")148 optionalString (skipScala == "" && stdenv.hostPlatform.system != "aarch64-linux")136 "\"sjsonnet-graalvm $path${jpathArgs}\" -n \"Scala (GraalVM)\""149 "\"sjsonnet-graalvm $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"Scala (GraalVM)\""137 } \150 } \138 ${optionalString (skipCpp == "")151 ${optionalString (skipCpp == "")139 "\"jsonnet $path${jpathArgs}\" -n \"C++\""152 "\"jsonnet $path${optionalString (vendor != "") " -J ${vendor}"}\" -n \"C++\""140 }153 }141 cat result.adoc >> $out154 cat result.adoc >> $out142 '';155 '';156 in143 in157 ''144 ''158 set -oux145 set -oux159 ulimit -s unlimited146 ulimit -s unlimited160147161 temp=$(mktemp -d)148 temp=$(mktemp -d)162 cd $temp149 cd $temp163150164 touch $out151 touch $out165 ${optionalString (true) ''152 ${optionalString (true) ''166 cat ${./benchmarks.adoc} >> $out153 cat ${./benchmarks.adoc} >> $out167 echo >> $out154 echo >> $out168155169 echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out156 echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | cut -d: -f2 | xargs), $(grep -c '^processor' /proc/cpuinfo) threads" >> $out170 echo >> $out157 echo >> $out171158172 echo ".Tested versions" >> $out159 echo ".Tested versions" >> $out173 echo "[%collapsible]" >> $out160 echo "[%collapsible]" >> $out174 echo "====" >> $out161 echo "====" >> $out175 echo "* Go: $(go-jsonnet --version)" >> $out162 echo "* Go: $(go-jsonnet --version)" >> $out176 echo "* C++: $(jsonnet --version)" >> $out163 echo "* C++: $(jsonnet --version)" >> $out177 echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out164 echo "* Scala (native/GraalVM): $(sjsonnet-native 2>&1 | grep -oP 'Sjsonnet \S+')" >> $out178 echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out165 echo "* Rust (alternative): rsjsonnet ${rsjsonnet.version} (${rsjsonnet.src.rev})" >> $out179 ${concatStringsSep "\n" (166 ${concatStringsSep "\n" (180 forEach jrsonnetVariants (167 forEach jrsonnetVariants (181 variant:168 variant:182 "echo \"* Rust${169 "echo \"* Rust${183 if variant.name != "" then " (${variant.name})" else ""170 if variant.name != "" then " (${variant.name})" else ""184 }: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"171 }: $(${variant.drv}/bin/jrsonnet --version 2>&1)\" >> $out"185 )172 )186 )}173 )}187 echo "====" >> $out174 echo "====" >> $out188 echo >> $out175 echo >> $out189 ''}176 ''}190 echo "== Real world" >> $out177 echo "== Real world" >> $out191 ${mkBench {178 ${mkBench {192 name = "Graalvm CI";179 name = "Graalvm CI";193 path = "${graalvmBench}/ci.jsonnet";180 path = "${graalvmBench}/ci.jsonnet";194 omitSource = true;181 omitSource = true;195 skipCpp = "takes longer than a hour";182 skipCpp = "takes longer than a hour";196 skipGo = skipSlow;183 skipGo = skipSlow;197 }}184 }}198 ${mkBench {185 ${mkBench {199 name = "Kube-prometheus manifests";186 name = "Loki manifests";187 path = "${realworldBench}/entry-loki.jsonnet";188 jpaths = [ "${realworldBench}/vendor" ];189 skipCpp = "too slow, takes hours, skews results";190 skipGo = skipSlow;191 }}192 ${mkBench {193 name = "Mimir manifests";200 vendor = "${kubePrometheusBench}/vendor";194 path = "${realworldBench}/entry-mimir.jsonnet";195 jpaths = [ "${realworldBench}/vendor" ];196 skipCpp = "too slow, takes hours, skews results";197 skipGo = skipSlow;198 }}199 ${mkBench {200 name = "Tempo manifests";201 path = "${realworldBench}/entry-tempo.jsonnet";202 jpaths = [ "${realworldBench}/vendor" ];201 path = "${kubePrometheusBench}/example.jsonnet";203 skipCpp = "too slow, takes hours, skews results";204 skipGo = skipSlow;205 }}206 ${mkBench {207 name = "GitLab runbooks dashboards";208 path = "${realworldBench}/entry-gitlab-runbooks.jsonnet";202 omitSource = true;209 jpaths = [210 "${realworldBench}/vendor"211 "${realworldBench}/vendor/runbooks/libsonnet"212 "${realworldBench}/vendor/runbooks/dashboards"213 "${realworldBench}/vendor/runbooks/services"214 "${realworldBench}/vendor/runbooks/metrics-catalog"215 ];203 skipCpp = "too slow, takes hours, skews results";216 skipCpp = "too slow, takes hours, skews results";204 skipGo = skipSlow;217 skipGo = skipSlow;205 }}218 }}206219207 echo >> $out220 echo >> $out208 echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out221 echo "== Benchmarks from C++ jsonnet (/perf_tests)" >> $out209 ${mkBench {222 ${mkBench {210 name = "Large string join";223 name = "Large string join";211 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";224 path = "${jsonnetBench}/perf_tests/large_string_join.jsonnet";212 }}225 }}213 ${mkBench {226 ${mkBench {214 name = "Large string template";227 name = "Large string template";215 omitSource = true;228 omitSource = true;216 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";229 path = "${jsonnetBench}/perf_tests/large_string_template.jsonnet";217 skipGo = "fails with os stack size exhausion";230 skipGo = "fails with os stack size exhausion";218 skipCpp = "too slow, takes hours, skews results";231 skipCpp = "too slow, takes hours, skews results";219 }}232 }}220 ${mkBench {233 ${mkBench {221 name = "Realistic 1";234 name = "Realistic 1";222 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";235 path = "${jsonnetBench}/perf_tests/realistic1.jsonnet";223 skipGo = skipSlow;236 skipGo = skipSlow;224 skipCpp = "too slow, takes hours, skews results";237 skipCpp = "too slow, takes hours, skews results";225 }}238 }}226 ${mkBench {239 ${mkBench {227 name = "Realistic 2";240 name = "Realistic 2";228 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";241 path = "${jsonnetBench}/perf_tests/realistic2.jsonnet";229 skipGo = skipSlow;242 skipGo = skipSlow;230 skipCpp = "too slow, takes hours, skews results";243 skipCpp = "too slow, takes hours, skews results";231 }}244 }}232245233 echo >> $out246 echo >> $out234 echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out247 echo "== Benchmarks from C++ jsonnet (/benchmarks)" >> $out235 ${mkBench {248 ${mkBench {236 name = "Tail call";249 name = "Tail call";237 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";250 path = "${jsonnetBench}/benchmarks/bench.01.jsonnet";238 }}251 }}239 ${mkBench {252 ${mkBench {240 name = "Inheritance recursion";253 name = "Inheritance recursion";241 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";254 path = "${jsonnetBench}/benchmarks/bench.02.jsonnet";242 skipCpp = skipSlow;255 skipCpp = skipSlow;243 skipGo = skipSlow;256 skipGo = skipSlow;244 }}257 }}245 ${mkBench {258 ${mkBench {246 name = "Simple recursive call";259 name = "Simple recursive call";247 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";260 path = "${jsonnetBench}/benchmarks/bench.03.jsonnet";248 skipGo = skipSlow;261 skipGo = skipSlow;249 }}262 }}250 ${mkBench {263 ${mkBench {251 name = "Foldl string concat";264 name = "Foldl string concat";252 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";265 path = "${jsonnetBench}/benchmarks/bench.04.jsonnet";253 skipCpp = skipSlow;266 skipCpp = skipSlow;254 }}267 }}255 ${mkBench {268 ${mkBench {256 name = "Array sorts";269 name = "Array sorts";257 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";270 path = "${jsonnetBench}/benchmarks/bench.06.jsonnet";258 skipCpp = skipSlow;271 skipCpp = skipSlow;259 }}272 }}260 ${mkBench {273 ${mkBench {261 name = "Lazy array";274 name = "Lazy array";262 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";275 path = "${jsonnetBench}/benchmarks/bench.07.jsonnet";263 skipGo = skipSlow;276 skipGo = skipSlow;264 }}277 }}265 ${mkBench {278 ${mkBench {266 name = "Inheritance function recursion";279 name = "Inheritance function recursion";267 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";280 path = "${jsonnetBench}/benchmarks/bench.08.jsonnet";268 skipCpp = skipSlow;281 skipCpp = skipSlow;269 }}282 }}270 ${mkBench {283 ${mkBench {271 name = "String strips";284 name = "String strips";272 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";285 path = "${jsonnetBench}/benchmarks/bench.09.jsonnet";273 skipCpp = "too slow, takes hours, skews results";286 skipCpp = "too slow, takes hours, skews results";274 }}287 }}275 ${mkBench {288 ${mkBench {276 name = "Big object";289 name = "Big object";277 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";290 path = "${jsonnetBench}/benchmarks/gen_big_object.jsonnet";278 pathIsGenerator = true;291 pathIsGenerator = true;279 }}292 }}280293281 echo >> $out294 echo >> $out282 echo "== Benchmarks from Go jsonnet (builtins)" >> $out295 echo "== Benchmarks from Go jsonnet (builtins)" >> $out283 ${mkBench {296 ${mkBench {284 name = "std.base64";297 name = "std.base64";285 path = "${goJsonnetBench}/base64.jsonnet";298 path = "${goJsonnetBench}/base64.jsonnet";286 skipRustAlternative = skipSlow;299 skipRustAlternative = skipSlow;287 skipCpp = "too slow, takes hours, skews results";300 skipCpp = "too slow, takes hours, skews results";288 }}301 }}289 ${mkBench {302 ${mkBench {290 name = "std.base64Decode";303 name = "std.base64Decode";291 path = "${goJsonnetBench}/base64Decode.jsonnet";304 path = "${goJsonnetBench}/base64Decode.jsonnet";292 skipRustAlternative = skipSlow;305 skipRustAlternative = skipSlow;293 skipCpp = skipSlow;306 skipCpp = skipSlow;294 }}307 }}295 ${mkBench {308 ${mkBench {296 name = "std.base64DecodeBytes";309 name = "std.base64DecodeBytes";297 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";310 path = "${goJsonnetBench}/base64DecodeBytes.jsonnet";298 skipRustAlternative = skipSlow;311 skipRustAlternative = skipSlow;299 skipCpp = skipSlow;312 skipCpp = skipSlow;300 skipGo = skipSlow;313 skipGo = skipSlow;301 }}314 }}302 ${mkBench {315 ${mkBench {303 name = "std.base64 (byte array)";316 name = "std.base64 (byte array)";304 path = "${goJsonnetBench}/base64_byte_array.jsonnet";317 path = "${goJsonnetBench}/base64_byte_array.jsonnet";305 skipRustAlternative = skipSlow;318 skipRustAlternative = skipSlow;306 skipCpp = skipSlow;319 skipCpp = skipSlow;307 skipGo = skipSlow;320 skipGo = skipSlow;308 }}321 }}309 ${mkBench {322 ${mkBench {310 name = "std.foldl";323 name = "std.foldl";311 path = "${goJsonnetBench}/foldl.jsonnet";324 path = "${goJsonnetBench}/foldl.jsonnet";312 }}325 }}313 ${mkBench {326 ${mkBench {314 name = "std.manifestJsonEx";327 name = "std.manifestJsonEx";315 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";328 path = "${goJsonnetBench}/manifestJsonEx.jsonnet";316 skipCpp = skipSlow;329 skipCpp = skipSlow;317 }}330 }}318 ${mkBench {331 ${mkBench {319 name = "std.manifestTomlEx";332 name = "std.manifestTomlEx";320 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";333 path = "${goJsonnetBench}/manifestTomlEx.jsonnet";321 skipCpp = skipSlow;334 skipCpp = skipSlow;322 }}335 }}323 ${mkBench {336 ${mkBench {324 name = "std.parseInt";337 name = "std.parseInt";325 path = "${goJsonnetBench}/parseInt.jsonnet";338 path = "${goJsonnetBench}/parseInt.jsonnet";326 skipCpp = skipSlow;339 skipCpp = skipSlow;327 }}340 }}328 ${mkBench {341 ${mkBench {329 name = "std.reverse";342 name = "std.reverse";330 path = "${goJsonnetBench}/reverse.jsonnet";343 path = "${goJsonnetBench}/reverse.jsonnet";331 skipCpp = skipSlow;344 skipCpp = skipSlow;332 skipGo = skipSlow;345 skipGo = skipSlow;333 }}346 }}334 ${mkBench {347 ${mkBench {335 name = "std.substr";348 name = "std.substr";336 path = "${goJsonnetBench}/substr.jsonnet";349 path = "${goJsonnetBench}/substr.jsonnet";337 }}350 }}338 ${mkBench {351 ${mkBench {339 name = "Comparsion for array";352 name = "Comparsion for array";340 path = "${goJsonnetBench}/comparison.jsonnet";353 path = "${goJsonnetBench}/comparison.jsonnet";341 skipCpp = "too slow, takes hours, skews results";354 skipCpp = "too slow, takes hours, skews results";342 }}355 }}343 ${mkBench {356 ${mkBench {344 name = "Comparsion for primitives";357 name = "Comparsion for primitives";345 path = "${goJsonnetBench}/comparison2.jsonnet";358 path = "${goJsonnetBench}/comparison2.jsonnet";346 skipRustAlternative = skipSlow;359 skipRustAlternative = skipSlow;347 skipCpp = "can't run: uses up to 192GB of RAM";360 skipCpp = "can't run: uses up to 192GB of RAM";348 skipGo = skipSlow;361 skipGo = skipSlow;349 }}362 }}350 '';363 '';351}364}352365nix/fetch-jrq.nixdiffbeforeafterboth--- /dev/null
+++ b/nix/fetch-jrq.nix
@@ -0,0 +1,49 @@
+{
+ lib,
+ stdenvNoCC,
+ cacert,
+ jrsonnet,
+}:
+{
+ lockfile,
+ vendorHash,
+ name ? "jrq-vendor",
+}:
+stdenvNoCC.mkDerivation (finalAttrs: {
+ inherit name;
+
+ outputHashMode = "recursive";
+ outputHashAlgo = "sha256";
+ outputHash = vendorHash;
+
+ nativeBuildInputs = [
+ jrsonnet
+ cacert
+ ];
+
+ dontUnpack = true;
+ dontConfigure = true;
+ dontInstall = true;
+ dontFixup = true;
+
+ SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
+ GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
+
+ buildPhase = ''
+ runHook preBuild
+
+ export HOME=$TMPDIR
+
+ install -m644 ${lockfile} jsonnetfile.json
+ install -m644 ${lockfile} jsonnetfile.lock.json
+
+ mkdir -p "$out"
+ jrb --jsonnetpkg-home "$out" install
+
+ runHook postBuild
+ '';
+
+ passthru = {
+ inherit lockfile vendorHash;
+ };
+})
tests/realworld/.gitignorediffbeforeafterboth--- /dev/null
+++ b/tests/realworld/.gitignore
@@ -0,0 +1 @@
+/vendor
tests/realworld/entry-gitlab-runbooks.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/entry-gitlab-runbooks.jsonnet
@@ -0,0 +1 @@
+import 'api/main.dashboard.jsonnet'
tests/realworld/entry-graalvm.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/entry-graalvm.jsonnet
@@ -0,0 +1,42 @@
+local common = import 'ci/ci_common/common.jsonnet';
+local graal_common = import 'graal-common.json';
+
+local compiler = import 'compiler/ci/ci.jsonnet';
+local wasm = import 'wasm/ci/ci.jsonnet';
+local espresso = import 'espresso/ci/ci.jsonnet';
+local regex = import 'regex/ci/ci.jsonnet';
+local sdk = import 'sdk/ci/ci.jsonnet';
+local substratevm = import 'substratevm/ci/ci.jsonnet';
+local sulong = import 'sulong/ci/ci.jsonnet';
+local tools = import 'tools/ci/ci.jsonnet';
+local truffle = import 'truffle/ci/ci.jsonnet';
+local javadoc = import 'ci_includes/publish-javadoc.jsonnet';
+local visualizer = import 'visualizer/ci/ci.jsonnet';
+local web_image = import 'web-image/ci/ci.jsonnet';
+
+{
+ ci_resources:: (import 'ci/ci_common/ci-resources.libsonnet'),
+ overlay: graal_common.ci.overlay,
+ specVersion: '7',
+ tierConfig: {
+ tier1: 'gate',
+ tier2: 'gate',
+ tier3: 'gate',
+ tier4: 'post-merge',
+ },
+ builds: [common.add_excludes_guard(common.with_style_component(b)) for b in (
+ common.with_components(compiler.builds, ['compiler']) +
+ common.with_components(wasm.builds, ['wasm']) +
+ common.with_components(espresso.builds, ['espresso']) +
+ common.with_components(regex.builds, ['regex']) +
+ common.with_components(sdk.builds, ['sdk']) +
+ common.with_components(substratevm.builds, ['svm']) +
+ common.with_components(sulong.builds, ['sulong']) +
+ common.with_components(tools.builds, ['tools']) +
+ common.with_components(truffle.builds, ['truffle']) +
+ common.with_components(javadoc.builds, ['javadoc']) +
+ common.with_components(visualizer.builds, ['visualizer']) +
+ common.with_components(web_image.builds, ['webimage'])
+ )],
+ assert (import 'ci/ci_common/run-spec-demo.jsonnet').check(),
+}
tests/realworld/entry-loki.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/entry-loki.jsonnet
@@ -0,0 +1,30 @@
+local loki = import 'loki/loki.libsonnet';
+
+loki {
+ _config+:: {
+ namespace: 'loki',
+ cluster: 'loki-bench',
+ storage_backend: 's3',
+ s3_address: 's3.example.com',
+ s3_bucket_name: 'loki-bench',
+ s3_access_key: 'AKIA',
+ s3_secret_access_key: 'SECRET',
+ boltdb_shipper_shared_store: 's3',
+
+ using_boltdb_shipper: false,
+ using_tsdb_shipper: true,
+ use_index_gateway: true,
+
+ loki+: {
+ schema_config+: {
+ configs: [{
+ from: '2024-01-01',
+ store: 'tsdb',
+ object_store: 's3',
+ schema: 'v13',
+ index: { prefix: 'loki_index_', period: '24h' },
+ }],
+ },
+ },
+ },
+}
tests/realworld/entry-mimir.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/entry-mimir.jsonnet
@@ -0,0 +1,14 @@
+local mimir = import 'mimir/mimir.libsonnet';
+
+mimir {
+ _config+:: {
+ namespace: 'mimir',
+ cluster: 'mimir-bench',
+ external_url: 'http://mimir.example.com',
+
+ storage_backend: 'gcs',
+ blocks_storage_bucket_name: 'mimir-blocks',
+ ruler_storage_bucket_name: 'mimir-ruler',
+ alertmanager_storage_bucket_name: 'mimir-alertmanager',
+ },
+}
tests/realworld/entry-tempo.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/entry-tempo.jsonnet
@@ -0,0 +1,36 @@
+local tempo = import 'microservices/tempo.libsonnet';
+
+tempo {
+ _images+:: {
+ tempo: 'grafana/tempo:latest',
+ tempo_vulture: 'grafana/tempo-vulture:latest',
+ tempo_query: 'grafana/tempo-query:latest',
+ },
+
+ _config+:: {
+ namespace: 'tracing',
+ distributor+: {
+ receivers: {
+ otlp: { protocols: { grpc: { endpoint: '0.0.0.0:4317' } } },
+ },
+ },
+ metrics_generator+: {
+ pvc_size: '10Gi',
+ pvc_storage_class: 'fast',
+ ephemeral_storage_request_size: '10Gi',
+ ephemeral_storage_limit_size: '11Gi',
+ },
+ live_store+: {
+ pvc_size: '10Gi',
+ pvc_storage_class: 'fast',
+ },
+ backend_scheduler+: {
+ pvc_size: '200Mi',
+ pvc_storage_class: 'fast',
+ },
+ backend: 'gcs',
+ bucket: 'tempo-bench',
+ kafka_address: 'kafka:9092',
+ kafka_topic: 'tempo',
+ },
+}
tests/realworld/jsonnetfile.jsondiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/jsonnetfile.json
@@ -0,0 +1,52 @@
+{
+ "version": 1,
+ "dependencies": [
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus-operator/kube-prometheus"
+ }
+ }
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/oracle/graal"
+ }
+ }
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/loki",
+ "subdir": "production/ksonnet/loki"
+ }
+ }
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/mimir",
+ "subdir": "operations/mimir"
+ }
+ }
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/tempo",
+ "subdir": "operations/jsonnet/microservices"
+ }
+ }
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://gitlab.com/gitlab-com/runbooks"
+ }
+ },
+ "version": "c4082c94065b1b6a521eed59ed624478131cd9c0"
+ }
+ ],
+ "legacyImports": true
+}
tests/realworld/jsonnetfile.lock.jsondiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/jsonnetfile.lock.json
@@ -0,0 +1,341 @@
+{
+ "version": 1,
+ "dependencies": [
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus-operator/kube-prometheus"
+ }
+ },
+ "version": "392c6c5e8e83c9a0f76355d4b0837dccf76ad7ea"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "mixin-utils"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/brancz/kubernetes-grafana",
+ "subdir": "grafana"
+ }
+ },
+ "version": "5698c8940b6dadca3f42107b7839557bc041761f"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/grafonnet-lib.git",
+ "subdir": "grafonnet"
+ }
+ },
+ "version": "a1d61cce1da59c71409b99b5c7568511fec661ea"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/grafana",
+ "subdir": "grafana-mixin"
+ }
+ },
+ "version": "278a9c4cb758a546229e2b408def7e3dcb5f4ec0",
+ "name": "grafana-mixin"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/etcd-io/etcd",
+ "subdir": "contrib/mixin"
+ }
+ },
+ "version": "0cbc031e7f224102bd1ec42a81f659a2b8c3350c"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/grafonnet.git",
+ "subdir": "gen/grafonnet-v10.0.0"
+ }
+ },
+ "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/jsonnet-libs/docsonnet.git",
+ "subdir": "doc-util"
+ }
+ },
+ "version": "bf6f08ae02a51c48bdcec4629b1c1a5a62c6f803"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/jsonnet-libs/xtd.git"
+ }
+ },
+ "version": "4d7f8cb24d613430799f9d56809cc6964f35cea9"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus-operator/prometheus-operator",
+ "subdir": "jsonnet/prometheus-operator"
+ }
+ },
+ "version": "288f0ae3f4ef14e3c75078cbd7dfe1857c3fb066"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus-operator/prometheus-operator",
+ "subdir": "jsonnet/mixin"
+ }
+ },
+ "version": "288f0ae3f4ef14e3c75078cbd7dfe1857c3fb066",
+ "name": "prometheus-operator-mixin"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/kubernetes-monitoring/kubernetes-mixin"
+ }
+ },
+ "version": "acd544dbd02ebce1e000abe006df6d2e4ac1438e"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/grafonnet.git",
+ "subdir": "gen/grafonnet-latest"
+ }
+ },
+ "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/grafonnet.git",
+ "subdir": "gen/grafonnet-v11.4.0"
+ }
+ },
+ "version": "7380c9c64fb973f34c3ec46265621a2b0dee0058"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/kubernetes/kube-state-metrics",
+ "subdir": "jsonnet/kube-state-metrics"
+ }
+ },
+ "version": "cd5430fd1834f43ffd093e3e22c2af1a625dbe2e"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/kubernetes/kube-state-metrics",
+ "subdir": "jsonnet/kube-state-metrics-mixin"
+ }
+ },
+ "version": "cd5430fd1834f43ffd093e3e22c2af1a625dbe2e"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus/node_exporter",
+ "subdir": "docs/node-mixin"
+ }
+ },
+ "version": "d6d0e710bb7daf07a2743fde060f0d5f32c565f3"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus/prometheus",
+ "subdir": "documentation/prometheus-mixin"
+ }
+ },
+ "version": "91c184a899b8e8237cdd08876fba54aa5f9feb6c",
+ "name": "prometheus"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/prometheus/alertmanager",
+ "subdir": "doc/alertmanager-mixin"
+ }
+ },
+ "version": "c85e06d3cd4ba24d003454ee11834404224d7763",
+ "name": "alertmanager"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/pyrra-dev/pyrra.git",
+ "subdir": "jsonnet/controller-gen"
+ }
+ },
+ "version": "25bac00a6c478211326eed4aa46583d1b9466ca8",
+ "name": "pyrra"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/thanos-io/thanos",
+ "subdir": "mixin"
+ }
+ },
+ "version": "cdca5483752e1635d249fbb1271978262775dc1b",
+ "name": "thanos-mixin"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "grafana-builder"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/oracle/graal"
+ }
+ },
+ "version": "d24e4efdac60ee798d7a795cf015f084556c912e"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/loki",
+ "subdir": "production/ksonnet/loki"
+ }
+ },
+ "version": "fe7f43b7f36d8f90931a3bfd35fadc83e1c23d5f"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "consul"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "jaeger-agent-mixin"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "ksonnet-util"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "memcached"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/mimir",
+ "subdir": "operations/mimir"
+ }
+ },
+ "version": "39dd4ffb859d0abb3951d406495bc4bd422600dd"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/rollout-operator.git",
+ "subdir": "operations/rollout-operator"
+ }
+ },
+ "version": "2afe062893496f0554b4764bbe1638f8019832fb"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/jsonnet-libs/keda-libsonnet.git",
+ "subdir": "2.15"
+ }
+ },
+ "version": "dbc8cf1a9847f123d8325378111155fb135983ab",
+ "name": "keda-libsonnet"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/tempo",
+ "subdir": "operations/jsonnet/microservices"
+ }
+ },
+ "version": "f6124c0dea954763dbaa461dcc7b8a89bc8d2635"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
+ "subdir": "1.32"
+ }
+ },
+ "version": "55380470fb7979e6ce0c4316cb9c27a266caf298"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/jsonnet-libs/vertical-pod-autoscaler-libsonnet.git",
+ "subdir": "1.0.0"
+ }
+ },
+ "version": "5d16cd466d12489e6ffba5b17813a0203016e68d"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://gitlab.com/gitlab-com/runbooks"
+ }
+ },
+ "version": "c4082c94065b1b6a521eed59ed624478131cd9c0"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/grafana/jsonnet-libs.git",
+ "subdir": "memcached-mixin"
+ }
+ },
+ "version": "3b8056670048416f5fb660dc039e473eb20a40b2"
+ },
+ {
+ "source": {
+ "git": {
+ "remote": "https://github.com/yugui/jsonnetunit.git",
+ "subdir": "jsonnetunit"
+ }
+ },
+ "version": "6927c58cae7624a00f368b977ccc477d4f74071f"
+ }
+ ],
+ "legacyImports": true
+}
tests/realworld/k.libsonnetdiffbeforeafterboth--- /dev/null
+++ b/tests/realworld/k.libsonnet
@@ -0,0 +1 @@
+import '1.32/main.libsonnet'