Skip to content

Commit

Permalink
feature(dependabot): scan docker based loaders for updates
Browse files Browse the repository at this point in the history
since dependabot is expecting very specific format of yaml files
it can find and update:
* name starts with `values_`
* docker image need to be under `image` key

since we use same dockerhub repo for most of the loader images
and dependabot only handle update of one of them, we had to split
it to multiple files that would be scan seperatly.
`sct_config` would collect all of those back into the configuration
in the same structure it was until this change

(cherry picked from commit 5002022)
  • Loading branch information
actions-user authored and fruch committed Nov 27, 2024
1 parent 89fcc85 commit d2ae6cd
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 12 deletions.
40 changes: 40 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"

allow:
- dependency-name: "scylla-driver"
dependency-type: "direct"

reviewers:
- "scylladb/qa-maintainers"
assignees:
- "scylladb/qa-maintainers"

- package-ecosystem: "docker"
directories:
- "/defaults/docker_images/alternator-dns"
- "/defaults/docker_images/cassandra-stress"
- "/defaults/docker_images/cdc-stresser"
- "/defaults/docker_images/cql-stress-cassandra-stress"
- "/defaults/docker_images/gemini"
- "/defaults/docker_images/harry"
- "/defaults/docker_images/kcl"
- "/defaults/docker_images/latte"
- "/defaults/docker_images/nosqlbench"
- "/defaults/docker_images/ndbench"
- "/defaults/docker_images/scylla-bench"
- "/defaults/docker_images/ycsb"

schedule:
interval: "daily"
time: "03:00"

reviewers:
- "scylladb/qa-maintainers"
assignees:
- "scylladb/qa-maintainers"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alternator-dns:
image: 'scylladb/hydra-loaders:alternator-dns-0.1'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cassandra-stress:
image: 'scylladb/cassandra-stress:3.13.0'
2 changes: 2 additions & 0 deletions defaults/docker_images/cdc-stresser/values_cdc-stresser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cdc-stresser:
image: 'scylladb/hydra-loaders:cdc-stresser-20210630'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cql-stress-cassandra-stress:
image: 'docker.io/scylladb/hydra-loaders:cql-stress-cassandra-stress-20240718'
2 changes: 2 additions & 0 deletions defaults/docker_images/gemini/values_gemini.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gemini:
image: 'scylladb/hydra-loaders:gemini-v1.8.6'
2 changes: 2 additions & 0 deletions defaults/docker_images/harry/values_harry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
harry:
image: 'scylladb/hydra-loaders:cassandra-harry-jdk11-20220816'
2 changes: 2 additions & 0 deletions defaults/docker_images/kcl/values_kcl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
kcl:
image: 'scylladb/hydra-loaders:kcl-jdk8-20210526-ShardSyncStrategyType-PERIODIC'
2 changes: 2 additions & 0 deletions defaults/docker_images/latte/values_latte.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
latte:
image: 'scylladb/hydra-loaders:latte-0.28.1-scylladb'
2 changes: 2 additions & 0 deletions defaults/docker_images/ndbench/values_ndbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ndbench:
image: 'scylladb/hydra-loaders:ndbench-jdk8-20210720'
2 changes: 2 additions & 0 deletions defaults/docker_images/nosqlbench/values_nosqlbench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nosqlbench:
image: 'scylladb/hydra-loaders:nosqlbench-5.21.2'
2 changes: 2 additions & 0 deletions defaults/docker_images/scylla-bench/values_scylla-bench.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scylla-bench:
image: 'scylladb/hydra-loaders:scylla-bench-v0.1.24'
2 changes: 2 additions & 0 deletions defaults/docker_images/ycsb/values_ycsb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ycsb:
image: 'scylladb/hydra-loaders:ycsb-jdk8-20220918'
15 changes: 3 additions & 12 deletions defaults/test_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,9 @@ aws_fallback_to_next_availability_zone: false

enable_argus: true

stress_image:
ndbench: 'scylladb/hydra-loaders:ndbench-jdk8-20210720'
ycsb: 'scylladb/hydra-loaders:ycsb-jdk8-20220918'
nosqlbench: 'scylladb/hydra-loaders:nosqlbench-4.15.49'
cassandra-stress: 'scylladb/cassandra-stress:3.13.0'
scylla-bench: 'scylladb/hydra-loaders:scylla-bench-v0.1.24'
gemini: 'scylladb/hydra-loaders:gemini-v1.8.6'
alternator-dns: 'scylladb/hydra-loaders:alternator-dns-0.1'
cdc-stresser: 'scylladb/hydra-loaders:cdc-stresser-20210630'
kcl: 'scylladb/hydra-loaders:kcl-jdk8-20210526-ShardSyncStrategyType-PERIODIC'
harry: 'scylladb/hydra-loaders:cassandra-harry-jdk11-20220816'
latte: 'scylladb/hydra-loaders:latte-0.28.1-scylladb'
# the default stress tools are now defined a separate file for each /default/docker_image/[tool]/values_[tool].yaml
# cause limitation dependabot have related to us putting all of them in same dockerhub repository
stress_image: {}

service_level_shares: [1000]

Expand Down
14 changes: 14 additions & 0 deletions sdcm/sct_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,9 @@ def __init__(self):
backend_config_files += self.defaults_config_files[str(backend)]
self.multi_region_params = self.per_provider_multi_region_params.get(str(backend), [])

# load docker images defaults
self.load_docker_images_defaults()

# 1) load the default backend config files
files = anyconfig.load(list(backend_config_files))
anyconfig.merge(self, files)
Expand Down Expand Up @@ -1910,6 +1913,17 @@ def __init__(self):
if cluster_backend not in ("aws",):
raise ValueError(f"use_dns_names is not supported for {cluster_backend} backend")

def load_docker_images_defaults(self):
docker_images_dir = pathlib.Path(sct_abs_path('defaults/docker_images'))
if docker_images_dir.is_dir():
yaml_files = []
for root, _, files in os.walk(docker_images_dir):
yaml_files.extend([os.path.join(root, f) for f in files if f.endswith('.yaml')])
if yaml_files:
docker_images_defaults = anyconfig.load(yaml_files)
stress_image = {key: value.get('image') for key, value in docker_images_defaults.items()}
anyconfig.merge(self, dict(stress_image=stress_image))

def log_config(self):
self.log.info(self.dump_config())

Expand Down

0 comments on commit d2ae6cd

Please sign in to comment.