redis-benchmarks-specification 0.1.209__py3-none-any.whl → 0.1.211__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of redis-benchmarks-specification might be problematic. Click here for more details.

Files changed (121) hide show
  1. redis_benchmarks_specification/__builder__/builder.py +130 -64
  2. redis_benchmarks_specification/__cli__/args.py +13 -1
  3. redis_benchmarks_specification/__cli__/cli.py +67 -3
  4. redis_benchmarks_specification/__common__/env.py +1 -1
  5. redis_benchmarks_specification/__common__/github.py +7 -11
  6. redis_benchmarks_specification/__common__/runner.py +15 -3
  7. redis_benchmarks_specification/__common__/timeseries.py +1551 -0
  8. redis_benchmarks_specification/__compare__/compare.py +0 -1
  9. redis_benchmarks_specification/__runner__/runner.py +20 -6
  10. redis_benchmarks_specification/__self_contained_coordinator__/args.py +0 -5
  11. redis_benchmarks_specification/__self_contained_coordinator__/artifacts.py +13 -12
  12. redis_benchmarks_specification/__self_contained_coordinator__/build_info.py +5 -3
  13. redis_benchmarks_specification/__self_contained_coordinator__/docker.py +2 -2
  14. redis_benchmarks_specification/__self_contained_coordinator__/prepopulation.py +4 -1
  15. redis_benchmarks_specification/__self_contained_coordinator__/runners.py +6 -2
  16. redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py +153 -52
  17. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-1000B-values-pipeline-10.yml +1 -0
  18. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-1000B-values.yml +1 -0
  19. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-100B-values-pipeline-10.yml +1 -0
  20. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-100B-values.yml +1 -0
  21. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-10B-values-pipeline-10.yml +1 -0
  22. redis_benchmarks_specification/test-suites/memtier_benchmark-10Mkeys-load-hash-5-fields-with-10B-values.yml +1 -0
  23. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-100B-expire-use-case.yml +1 -0
  24. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-10B-expire-use-case.yml +1 -0
  25. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-1KiB-expire-use-case.yml +1 -0
  26. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-4KiB-expire-use-case.yml +1 -0
  27. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-bitmap-getbit-pipeline-10.yml +1 -0
  28. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-exists-pipeline-10.yml +1 -0
  29. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-expire-pipeline-10.yml +1 -0
  30. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-expireat-pipeline-10.yml +1 -0
  31. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-pexpire-pipeline-10.yml +1 -0
  32. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-scan-pipeline-10.yml +1 -0
  33. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-touch-pipeline-10.yml +1 -0
  34. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-generic-ttl-pipeline-10.yml +1 -0
  35. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-hash-hexists.yml +1 -0
  36. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-hash-hget-hgetall-hkeys-hvals-with-100B-values.yml +1 -0
  37. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-hash-hincrby.yml +1 -0
  38. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-hash-hmget-5-fields-with-100B-values-pipeline-10.yml +1 -0
  39. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-hash-transactions-multi-exec-pipeline-20.yml +1 -0
  40. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-list-lpop-rpop-with-100B-values.yml +1 -0
  41. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-list-lpop-rpop-with-10B-values.yml +1 -0
  42. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-list-lpop-rpop-with-1KiB-values.yml +1 -0
  43. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values-pipeline-10.yml +1 -0
  44. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-hash-5-fields-with-1000B-values.yml +1 -0
  45. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-hash-hmset-5-fields-with-1000B-values.yml +1 -0
  46. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-list-with-100B-values.yml +1 -0
  47. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-list-with-10B-values.yml +1 -0
  48. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-list-with-1KiB-values.yml +1 -0
  49. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-stream-1-fields-with-100B-values-pipeline-10.yml +1 -0
  50. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-stream-1-fields-with-100B-values.yml +1 -0
  51. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-stream-5-fields-with-100B-values-pipeline-10.yml +1 -0
  52. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-stream-5-fields-with-100B-values.yml +1 -0
  53. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-100B-values-pipeline-10.yml +1 -0
  54. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-100B-values.yml +2 -5
  55. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-10B-values-pipeline-10.yml +1 -0
  56. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-10B-values.yml +1 -0
  57. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-1KiB-values.yml +1 -0
  58. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-200KiB-values.yml +2 -5
  59. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-20KiB-values.yml +2 -5
  60. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-string-with-2MB-values.yml +2 -5
  61. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-zset-with-10-elements-double-score.yml +1 -0
  62. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-load-zset-with-10-elements-int-score.yml +1 -0
  63. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-decr.yml +1 -0
  64. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-100B-pipeline-10.yml +1 -0
  65. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-100B.yml +1 -0
  66. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-10B-pipeline-10.yml +1 -0
  67. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-10B.yml +1 -0
  68. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-1KiB-pipeline-10.yml +1 -0
  69. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-1KiB.yml +1 -0
  70. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-200KiB.yml +1 -0
  71. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-20KiB.yml +1 -0
  72. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-get-2MB.yml +1 -0
  73. redis_benchmarks_specification/test-suites/memtier_benchmark-1Mkeys-string-mget-1KiB.yml +1 -0
  74. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geodist-pipeline-10.yml +1 -0
  75. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geodist.yml +1 -0
  76. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geohash-pipeline-10.yml +1 -0
  77. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geohash.yml +1 -0
  78. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geopos-pipeline-10.yml +1 -0
  79. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geopos.yml +1 -0
  80. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat-bybox.yml +1 -0
  81. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat-pipeline-10.yml +1 -0
  82. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat.yml +1 -0
  83. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-list-10-elements-lrange-all-elements.yml +1 -0
  84. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-list-100-elements-lrange-all-elements.yml +1 -0
  85. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-list-1K-elements-lrange-all-elements.yml +1 -0
  86. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-pfadd-4KB-values-pipeline-10.yml +1 -0
  87. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-10-elements-smembers-pipeline-10.yml +1 -0
  88. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-10-elements-smembers.yml +1 -0
  89. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-10-elements-smismember.yml +1 -0
  90. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-100-elements-smembers.yml +1 -0
  91. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-100-elements-smismember.yml +1 -0
  92. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-1K-elements-smembers.yml +1 -0
  93. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-200K-elements-sadd-constant.yml +1 -0
  94. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-set-2M-elements-sadd-increasing.yml +1 -0
  95. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zincrby-1M-elements-pipeline-1.yml +1 -0
  96. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zrank-1M-elements-pipeline-1.yml +1 -0
  97. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zrem-5M-elements-pipeline-1.yml +1 -0
  98. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zrevrangebyscore-256K-elements-pipeline-1.yml +1 -0
  99. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zrevrank-1M-elements-pipeline-1.yml +1 -0
  100. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-10-elements-zrange-all-elements-long-scores.yml +1 -0
  101. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-10-elements-zrange-all-elements.yml +1 -0
  102. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-100-elements-zrange-all-elements.yml +1 -0
  103. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-100-elements-zrangebyscore-all-elements-long-scores.yml +1 -0
  104. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-100-elements-zrangebyscore-all-elements.yml +1 -0
  105. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-1K-elements-zrange-all-elements.yml +1 -0
  106. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-1M-elements-zcard-pipeline-10.yml +1 -0
  107. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-1M-elements-zrevrange-5-elements.yml +1 -0
  108. redis_benchmarks_specification/test-suites/memtier_benchmark-1key-zset-1M-elements-zscore-pipeline-10.yml +1 -0
  109. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-lua-eval-hset-expire.yml +1 -0
  110. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-lua-evalsha-hset-expire.yml +1 -0
  111. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-set-10-100-elements-sdiff.yml +1 -0
  112. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-set-10-100-elements-sinter.yml +1 -0
  113. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-set-10-100-elements-sunion.yml +1 -0
  114. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-stream-5-entries-xread-all-entries-pipeline-10.yml +1 -0
  115. redis_benchmarks_specification/test-suites/memtier_benchmark-2keys-stream-5-entries-xread-all-entries.yml +1 -0
  116. redis_benchmarks_specification/test-suites/template.txt +1 -0
  117. {redis_benchmarks_specification-0.1.209.dist-info → redis_benchmarks_specification-0.1.211.dist-info}/METADATA +12 -5
  118. {redis_benchmarks_specification-0.1.209.dist-info → redis_benchmarks_specification-0.1.211.dist-info}/RECORD +121 -120
  119. {redis_benchmarks_specification-0.1.209.dist-info → redis_benchmarks_specification-0.1.211.dist-info}/WHEEL +1 -1
  120. {redis_benchmarks_specification-0.1.209.dist-info → redis_benchmarks_specification-0.1.211.dist-info}/LICENSE +0 -0
  121. {redis_benchmarks_specification-0.1.209.dist-info → redis_benchmarks_specification-0.1.211.dist-info}/entry_points.txt +0 -0
@@ -312,28 +312,7 @@ def builder_process_stream(
312
312
  if "run_image" in build_config:
313
313
  run_image = build_config["run_image"]
314
314
  if docker_air_gap:
315
- airgap_key = "docker:air-gap:{}".format(run_image)
316
- logging.info(
317
- "DOCKER AIR GAP: storing run image named: {} in redis key {}".format(
318
- run_image, airgap_key
319
- )
320
- )
321
- run_image_binary_stream = io.BytesIO()
322
- run_image_docker = docker_client.images.get(run_image)
323
- for chunk in run_image_docker.save():
324
- run_image_binary_stream.write(chunk)
325
- # 7 days expire
326
- binary_exp_secs = 24 * 60 * 60 * 7
327
- res_airgap = conn.set(
328
- airgap_key,
329
- run_image_binary_stream.getbuffer(),
330
- ex=binary_exp_secs,
331
- )
332
- logging.info(
333
- "DOCKER AIR GAP: result of set bin data to {}: {}".format(
334
- airgap_key, res_airgap
335
- )
336
- )
315
+ store_airgap_image_redis(conn, docker_client, run_image)
337
316
 
338
317
  compiler = build_config["compiler"]
339
318
  cpp_compiler = build_config["cpp_compiler"]
@@ -429,48 +408,32 @@ def builder_process_stream(
429
408
  build_duration = build_end_datetime - build_start_datetime
430
409
  build_duration_secs = build_duration.total_seconds()
431
410
 
432
- build_stream_fields = {
433
- "id": id,
434
- "git_hash": git_hash,
435
- "use_git_timestamp": str(use_git_timestamp),
436
- "build_image": build_image,
437
- "run_image": run_image,
438
- "compiler": compiler,
439
- "cpp_compiler": cpp_compiler,
440
- "os": build_os,
441
- "arch": build_arch,
442
- "build_vars": build_vars_str,
443
- "build_command": build_command,
444
- "metadata": json.dumps(build_config_metadata),
445
- "build_artifacts": ",".join(build_artifacts),
446
- "tests_regexp": tests_regexp,
447
- "tests_priority_upper_limit": tests_priority_upper_limit,
448
- "tests_priority_lower_limit": tests_priority_lower_limit,
449
- "tests_groups_regexp": tests_groups_regexp,
450
- }
451
- if pull_request is not None:
452
- build_stream_fields["pull_request"] = pull_request
453
- if git_branch is not None:
454
- build_stream_fields["git_branch"] = git_branch
455
- if git_version is not None:
456
- build_stream_fields["git_version"] = git_version
457
- if git_timestamp_ms is not None:
458
- build_stream_fields["git_timestamp_ms"] = git_timestamp_ms
459
- for artifact in build_artifacts:
460
- bin_key = "zipped:artifacts:{}:{}.zip".format(id, artifact)
461
- bin_artifact = open(
462
- "{}src/{}".format(redis_temporary_dir, artifact), "rb"
463
- ).read()
464
- bin_artifact_len = len(bytes(bin_artifact))
465
- assert bin_artifact_len > 0
466
- conn.set(bin_key, bytes(bin_artifact), ex=REDIS_BINS_EXPIRE_SECS)
467
- build_stream_fields[artifact] = bin_key
468
- build_stream_fields[
469
- "{}_len_bytes".format(artifact)
470
- ] = bin_artifact_len
471
- result = True
472
- if b"platform" in testDetails:
473
- build_stream_fields["platform"] = testDetails[b"platform"]
411
+ build_stream_fields, result = generate_benchmark_stream_request(
412
+ id,
413
+ conn,
414
+ run_image,
415
+ build_arch,
416
+ testDetails,
417
+ build_os,
418
+ build_artifacts,
419
+ build_command,
420
+ build_config_metadata,
421
+ build_image,
422
+ build_vars_str,
423
+ compiler,
424
+ cpp_compiler,
425
+ git_branch,
426
+ git_hash,
427
+ git_timestamp_ms,
428
+ git_version,
429
+ pull_request,
430
+ redis_temporary_dir,
431
+ tests_groups_regexp,
432
+ tests_priority_lower_limit,
433
+ tests_priority_upper_limit,
434
+ tests_regexp,
435
+ use_git_timestamp,
436
+ )
474
437
  if result is True:
475
438
  benchmark_stream_id = conn.xadd(
476
439
  STREAM_KEYNAME_NEW_BUILD_EVENTS, build_stream_fields
@@ -551,6 +514,109 @@ def builder_process_stream(
551
514
  return previous_id, new_builds_count, build_stream_fields_arr
552
515
 
553
516
 
517
+ def store_airgap_image_redis(conn, docker_client, run_image):
518
+ airgap_key = "docker:air-gap:{}".format(run_image)
519
+ logging.info(
520
+ "DOCKER AIR GAP: storing run image named: {} in redis key {}".format(
521
+ run_image, airgap_key
522
+ )
523
+ )
524
+ run_image_binary_stream = io.BytesIO()
525
+ run_image_docker = docker_client.images.get(run_image)
526
+ for chunk in run_image_docker.save():
527
+ run_image_binary_stream.write(chunk)
528
+ # 7 days expire
529
+ binary_exp_secs = 24 * 60 * 60 * 7
530
+ res_airgap = conn.set(
531
+ airgap_key,
532
+ run_image_binary_stream.getbuffer(),
533
+ ex=binary_exp_secs,
534
+ )
535
+ logging.info(
536
+ "DOCKER AIR GAP: result of set bin data to {}: {}".format(
537
+ airgap_key, res_airgap
538
+ )
539
+ )
540
+
541
+
542
+ def generate_benchmark_stream_request(
543
+ id,
544
+ conn,
545
+ run_image,
546
+ build_arch,
547
+ testDetails,
548
+ build_os,
549
+ build_artifacts=[],
550
+ build_command=None,
551
+ build_config_metadata=None,
552
+ build_image=None,
553
+ build_vars_str=None,
554
+ compiler=None,
555
+ cpp_compiler=None,
556
+ git_branch=None,
557
+ git_hash=None,
558
+ git_timestamp_ms=None,
559
+ git_version=None,
560
+ pull_request=None,
561
+ redis_temporary_dir=None,
562
+ tests_groups_regexp=".*",
563
+ tests_priority_lower_limit=0,
564
+ tests_priority_upper_limit=10000,
565
+ tests_regexp=".*",
566
+ use_git_timestamp=False,
567
+ ):
568
+ build_stream_fields = {
569
+ "id": id,
570
+ "use_git_timestamp": str(use_git_timestamp),
571
+ "run_image": run_image,
572
+ "os": build_os,
573
+ "arch": build_arch,
574
+ "build_artifacts": ",".join(build_artifacts),
575
+ "tests_regexp": tests_regexp,
576
+ "tests_priority_upper_limit": tests_priority_upper_limit,
577
+ "tests_priority_lower_limit": tests_priority_lower_limit,
578
+ "tests_groups_regexp": tests_groups_regexp,
579
+ }
580
+ if build_config_metadata is not None:
581
+ build_stream_fields["metadata"] = json.dumps(build_config_metadata)
582
+ if compiler is not None:
583
+ build_stream_fields["compiler"] = compiler
584
+ if cpp_compiler is not None:
585
+ build_stream_fields["cpp_compiler"] = cpp_compiler
586
+ if build_vars_str is not None:
587
+ build_stream_fields["build_vars"] = build_vars_str
588
+ if build_command is not None:
589
+ build_stream_fields["build_command"] = build_command
590
+ if build_image is not None:
591
+ build_stream_fields["build_image"] = build_image
592
+ else:
593
+ build_stream_fields["build_image"] = run_image
594
+ if git_hash is not None:
595
+ build_stream_fields["git_hash"] = git_hash
596
+ if pull_request is not None:
597
+ build_stream_fields["pull_request"] = pull_request
598
+ if git_branch is not None:
599
+ build_stream_fields["git_branch"] = git_branch
600
+ if git_version is not None:
601
+ build_stream_fields["git_version"] = git_version
602
+ if git_timestamp_ms is not None:
603
+ build_stream_fields["git_timestamp_ms"] = git_timestamp_ms
604
+ for artifact in build_artifacts:
605
+ bin_key = "zipped:artifacts:{}:{}.zip".format(id, artifact)
606
+ bin_artifact = open(
607
+ "{}src/{}".format(redis_temporary_dir, artifact), "rb"
608
+ ).read()
609
+ bin_artifact_len = len(bytes(bin_artifact))
610
+ assert bin_artifact_len > 0
611
+ conn.set(bin_key, bytes(bin_artifact), ex=REDIS_BINS_EXPIRE_SECS)
612
+ build_stream_fields[artifact] = bin_key
613
+ build_stream_fields["{}_len_bytes".format(artifact)] = bin_artifact_len
614
+ result = True
615
+ if b"platform" in testDetails:
616
+ build_stream_fields["platform"] = testDetails[b"platform"]
617
+ return build_stream_fields, result
618
+
619
+
554
620
  def build_spec_image_prefetch(builders_folder, different_build_specs):
555
621
  logging.info("checking build spec requirements")
556
622
  already_checked_images = []
@@ -21,6 +21,7 @@ START_TIME_NOW_UTC, _, _ = get_start_time_vars()
21
21
  START_TIME_LAST_YEAR_UTC = START_TIME_NOW_UTC - datetime.timedelta(days=90)
22
22
  CLI_TOOL_STATS = "stats"
23
23
  CLI_TOOL_TRIGGER = "trigger"
24
+ CLI_TOOL_DOCKERHUB = "dockerhub"
24
25
  PERFORMANCE_GH_TOKEN = os.getenv("PERFORMANCE_GH_TOKEN", None)
25
26
 
26
27
 
@@ -109,7 +110,7 @@ def spec_cli_args(parser):
109
110
  type=str,
110
111
  default=CLI_TOOL_TRIGGER,
111
112
  help="subtool to use. One of '{}' ".format(
112
- ",".join([CLI_TOOL_STATS, CLI_TOOL_TRIGGER])
113
+ ",".join([CLI_TOOL_STATS, CLI_TOOL_TRIGGER, CLI_TOOL_DOCKERHUB])
113
114
  ),
114
115
  )
115
116
  parser.add_argument("--gh_token", type=str, default=GH_TOKEN)
@@ -129,7 +130,18 @@ def spec_cli_args(parser):
129
130
  parser.add_argument("--redis_repo", type=str, default=None)
130
131
  parser.add_argument("--gh_org", type=str, default="redis")
131
132
  parser.add_argument("--gh_repo", type=str, default="redis")
133
+ parser.add_argument("--server_name", type=str, default=None)
134
+ parser.add_argument("--run_image", type=str, default="redis")
135
+ parser.add_argument("--build_arch", type=str, default="amd64")
136
+ parser.add_argument("--id", type=str, default="dockerhub")
137
+ parser.add_argument("--mnt_point", type=str, default="")
132
138
  parser.add_argument("--trigger-unstable-commits", type=bool, default=True)
139
+ parser.add_argument(
140
+ "--docker-dont-air-gap",
141
+ default=False,
142
+ action="store_true",
143
+ help="Dont store the docker images in redis keys.",
144
+ )
133
145
  parser.add_argument(
134
146
  "--use-tags",
135
147
  default=False,
@@ -12,14 +12,18 @@ import shutil
12
12
  import subprocess
13
13
  import sys
14
14
  import tempfile
15
+
16
+ import docker
15
17
  import git
16
18
  import packaging
17
19
  import redis
18
20
  from packaging import version
19
21
  import time
20
- from github import Github
21
-
22
22
 
23
+ from redis_benchmarks_specification.__builder__.builder import (
24
+ generate_benchmark_stream_request,
25
+ store_airgap_image_redis,
26
+ )
23
27
  from redis_benchmarks_specification.__common__.github import (
24
28
  update_comment_if_needed,
25
29
  create_new_pr_comment,
@@ -39,6 +43,7 @@ from redis_benchmarks_specification.__common__.env import (
39
43
  REDIS_BINS_EXPIRE_SECS,
40
44
  STREAM_KEYNAME_GH_EVENTS_COMMIT,
41
45
  STREAM_GH_EVENTS_COMMIT_BUILDERS_CG,
46
+ STREAM_KEYNAME_NEW_BUILD_EVENTS,
42
47
  )
43
48
  from redis_benchmarks_specification.__common__.package import (
44
49
  get_version_string,
@@ -53,6 +58,59 @@ logging.basicConfig(
53
58
  )
54
59
 
55
60
 
61
+ def trigger_tests_dockerhub_cli_command_logic(args, project_name, project_version):
62
+ logging.info(
63
+ "Using: {project_name} {project_version}".format(
64
+ project_name=project_name, project_version=project_version
65
+ )
66
+ )
67
+ logging.info(
68
+ "Checking connection to redis with user: {}, host: {}, port: {}".format(
69
+ args.redis_user,
70
+ args.redis_host,
71
+ args.redis_port,
72
+ )
73
+ )
74
+ conn = redis.StrictRedis(
75
+ host=args.redis_host,
76
+ port=args.redis_port,
77
+ password=args.redis_pass,
78
+ username=args.redis_user,
79
+ decode_responses=False,
80
+ )
81
+ conn.ping()
82
+ testDetails = {}
83
+ build_stream_fields, result = generate_benchmark_stream_request(
84
+ args.id,
85
+ conn,
86
+ args.run_image,
87
+ args.build_arch,
88
+ testDetails,
89
+ "n/a",
90
+ )
91
+ build_stream_fields["github_repo"] = args.gh_repo
92
+ build_stream_fields["github_org"] = args.gh_org
93
+ build_stream_fields["restore_build_artifacts"] = "False"
94
+ server_name = args.gh_repo
95
+ if args.server_name is not None:
96
+ server_name = args.server_name
97
+ build_stream_fields["server_name"] = server_name
98
+ build_stream_fields["mnt_point"] = args.mnt_point
99
+ if args.docker_dont_air_gap is False:
100
+ docker_client = docker.from_env()
101
+ store_airgap_image_redis(conn, docker_client, args.run_image)
102
+
103
+ if result is True:
104
+ benchmark_stream_id = conn.xadd(
105
+ STREAM_KEYNAME_NEW_BUILD_EVENTS, build_stream_fields
106
+ )
107
+ logging.info(
108
+ "sucessfully requested a new run {}. Stream id: {}".format(
109
+ build_stream_fields, benchmark_stream_id
110
+ )
111
+ )
112
+
113
+
56
114
  def main():
57
115
  _, _, project_version = populate_with_poetry_data()
58
116
  project_name = "redis-benchmarks-spec-cli"
@@ -66,6 +124,8 @@ def main():
66
124
  trigger_tests_cli_command_logic(args, project_name, project_version)
67
125
  if args.tool == "stats":
68
126
  generate_stats_cli_command_logic(args, project_name, project_version)
127
+ if args.tool == "dockerhub":
128
+ trigger_tests_dockerhub_cli_command_logic(args, project_name, project_version)
69
129
 
70
130
 
71
131
  def get_commits_by_branch(args, repo):
@@ -349,7 +409,11 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
349
409
  if result is True:
350
410
  stream_id = "n/a"
351
411
  if args.dry_run is False:
352
- (result, reply_fields, error_msg,) = request_build_from_commit_info(
412
+ (
413
+ result,
414
+ reply_fields,
415
+ error_msg,
416
+ ) = request_build_from_commit_info(
353
417
  conn,
354
418
  commit_dict,
355
419
  {},
@@ -45,7 +45,7 @@ GH_REDIS_SERVER_USER = os.getenv("GH_REDIS_SERVER_USER", None)
45
45
 
46
46
  # DB used to authenticate ( read-only/non-dangerous access only )
47
47
  REDIS_AUTH_SERVER_HOST = os.getenv("REDIS_AUTH_SERVER_HOST", "localhost")
48
- REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6380"))
48
+ REDIS_AUTH_SERVER_PORT = int(os.getenv("REDIS_AUTH_SERVER_PORT", "6379"))
49
49
  REDIS_HEALTH_CHECK_INTERVAL = int(os.getenv("REDIS_HEALTH_CHECK_INTERVAL", "15"))
50
50
  REDIS_SOCKET_TIMEOUT = int(os.getenv("REDIS_SOCKET_TIMEOUT", "300"))
51
51
  REDIS_BINS_EXPIRE_SECS = int(
@@ -24,9 +24,7 @@ def generate_build_started_pr_comment(
24
24
  tests_priority_upper_limit,
25
25
  tests_regexp,
26
26
  ):
27
- comment_body = (
28
- f"### CE Performance Automation : step 1 of 2 (build) STARTING...\n\n"
29
- )
27
+ comment_body = "### CE Performance Automation : step 1 of 2 (build) STARTING...\n\n"
30
28
  comment_body += (
31
29
  "This comment was automatically generated given a benchmark was triggered.\n"
32
30
  )
@@ -38,7 +36,7 @@ def generate_build_started_pr_comment(
38
36
  comment_body += f" - git branch: {git_branch}\n"
39
37
  comment_body += f" - commit date and time: {commit_datetime}\n"
40
38
  comment_body += f" - commit summary: {commit_summary}\n"
41
- comment_body += f" - test filters:\n"
39
+ comment_body += " - test filters:\n"
42
40
  comment_body += (
43
41
  f" - command priority lower limit: {tests_priority_lower_limit}\n"
44
42
  )
@@ -64,7 +62,7 @@ def generate_build_finished_pr_comment(
64
62
  build_duration_seconds,
65
63
  ):
66
64
  build_duration_seconds = int(build_duration_seconds)
67
- comment_body = f"### CE Performance Automation : step 1 of 2 (build) DONE.\n\n"
65
+ comment_body = "### CE Performance Automation : step 1 of 2 (build) DONE.\n\n"
68
66
  comment_body += (
69
67
  "This comment was automatically generated given a benchmark was triggered.\n"
70
68
  )
@@ -76,7 +74,7 @@ def generate_build_finished_pr_comment(
76
74
  comment_body += f" - git branch: {git_branch}\n"
77
75
  comment_body += f" - commit date and time: {commit_datetime}\n"
78
76
  comment_body += f" - commit summary: {commit_summary}\n"
79
- comment_body += f" - test filters:\n"
77
+ comment_body += " - test filters:\n"
80
78
  comment_body += (
81
79
  f" - command priority lower limit: {tests_priority_lower_limit}\n"
82
80
  )
@@ -197,12 +195,10 @@ def update_comment_if_needed(
197
195
  )
198
196
  )
199
197
  if user_input.lower() == "y" or auto_approve:
200
- print("Updating comment {}".format(regression_comment.html_url))
201
- regression_comment.edit(comment_body)
202
198
  html_url = regression_comment.html_url
203
- print(
204
- "Updated comment. Access it via {}".format(regression_comment.html_url)
205
- )
199
+ print("Updating comment {}".format(html_url))
200
+ regression_comment.edit(comment_body)
201
+ print("Updated comment. Access it via {}".format(html_url))
206
202
 
207
203
 
208
204
  def check_benchmark_build_comment(comments):
@@ -6,9 +6,12 @@ import re
6
6
 
7
7
  import redis
8
8
  from redisbench_admin.run.metrics import collect_redis_metrics
9
- from redisbench_admin.run.redistimeseries import timeseries_test_sucess_flow
10
9
  from redisbench_admin.run_remote.run_remote import export_redis_metrics
11
10
 
11
+ from redis_benchmarks_specification.__common__.timeseries import (
12
+ timeseries_test_sucess_flow,
13
+ )
14
+
12
15
 
13
16
  def execute_init_commands(benchmark_config, r, dbconfig_keyname="dbconfig"):
14
17
  cmds = None
@@ -144,8 +147,11 @@ def exporter_datasink_common(
144
147
  tf_triggering_env,
145
148
  topology_spec_name,
146
149
  default_metrics=None,
150
+ git_hash=None,
147
151
  ):
148
- logging.info("Using datapoint_time_ms: {}".format(datapoint_time_ms))
152
+ logging.info(
153
+ f"Using datapoint_time_ms: {datapoint_time_ms}. git_has={git_hash}, git_branch={git_branch}, git_version={git_version}"
154
+ )
149
155
  timeseries_test_sucess_flow(
150
156
  datasink_push_results_redistimeseries,
151
157
  git_version,
@@ -167,9 +173,15 @@ def exporter_datasink_common(
167
173
  metadata,
168
174
  build_variant_name,
169
175
  running_platform,
176
+ None,
177
+ git_hash,
170
178
  )
171
179
  logging.info("Collecting memory metrics")
172
- (_, _, overall_end_time_metrics,) = collect_redis_metrics(
180
+ (
181
+ _,
182
+ _,
183
+ overall_end_time_metrics,
184
+ ) = collect_redis_metrics(
173
185
  redis_conns,
174
186
  ["memory"],
175
187
  {