]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
dispatcher: save default job config to a separate file
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Tue, 12 May 2026 20:02:19 +0000 (22:02 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Tue, 12 May 2026 20:02:19 +0000 (22:02 +0200)
In order to still make it possible to reuse original config
from the queue, don't be confused by 'orig.config.yaml',
which is used in teuthology.run after joining arguments.

So we save it to 'default.config.yaml', and later can
be used like:

```
teuthology path/to/default.config.yaml path/to/targets.yaml
```

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
teuthology/dispatcher/__init__.py

index 87d31a8d39ee3120256a60a29f9e6a3f56326cde..f4eb2a699de57b72f7ddc50e6f866dded9f3fa7a 100644 (file)
@@ -137,6 +137,15 @@ def main(args):
             run_name = job_config['name']
             job_archive_path = os.path.join(
                 archive_dir, safepath.munge(run_name), str(job_id))
+            # Create job archive directory together with run directory
+            safepath.makedirs('/', job_archive_path)
+            default_config_path = os.path.join(job_archive_path,
+                                               'default.config.yaml')
+
+            # Write initial job config in job archive dir
+            with open(default_config_path, 'w') as f:
+                yaml.safe_dump(job_config, f, default_flow_style=False)
+
             job_config['archive_path'] = job_archive_path
             job_config['worker_log'] = log_file_path
 
@@ -145,8 +154,7 @@ def main(args):
             except SkipJob:
                 continue
 
-            # Create job archive directory together with run directory
-            safepath.makedirs('/', job_archive_path)
+            job_config_path = os.path.join(job_archive_path, 'init.config.yaml')
 
             # lock machines but do not reimage them
             if 'roles' in job_config:
@@ -187,7 +195,6 @@ def main(args):
                 '--archive-dir', archive_dir,
             ]
 
-            job_config_path = os.path.join(job_config['archive_path'], 'orig.config.yaml')
 
             # Write initial job config in job archive dir
             with open(job_config_path, 'w') as f: