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
  • Loading branch information
actions-user authored and soyacz committed Nov 22, 2024
1 parent 51856ad commit 5002022
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,27 @@ updates:
- "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'
16 changes: 3 additions & 13 deletions defaults/test_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,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-5.21.2'
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'
cql-stress-cassandra-stress: 'docker.io/scylladb/hydra-loaders:cql-stress-cassandra-stress-20240718'
# 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 @@ -1797,6 +1797,9 @@ def __init__(self): # noqa: PLR0912, PLR0914, PLR0915
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 @@ -2103,6 +2106,17 @@ def __init__(self): # noqa: PLR0912, PLR0914, PLR0915
assert len(zero_nodes_num) == len(
data_nodes_num), "Config of zero token nodes is not equal config of data nodes for multi dc"

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 5002022

Please sign in to comment.