cook: two default dishes (phyllomeos, phyllomeos-headless) + guest/experimental tiers; CI builds raw images
Manifest groups get a tier; only `default` is generated (make all TIER=..., --tier). Default: phyllomeos (GNOME + virt-manager) and phyllomeos-headless, Fedora 44, systemd-boot, CPU-agnostic hypervisor ingredient (hypervisor_type: any). guest tier: guest-server, guest-desktop. experimental: biosboot/grub, encrypted, rawhide. Generator clears stale recipes/dishes before writing. build-image.sh: --dish and --tier; deploy.sh: --tier. build-iso.yaml replaced by build-image.yaml: raw images for both editions on the fedora:host runner (TMPDIR=/var/tmp, max-parallel 1), attached with the flattened kickstarts to tagged releases. Live edition no longer built. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
35d8879bcc
commit
67316d9852
+43
-4
@@ -204,9 +204,42 @@ def validate_dish(dish_path):
|
||||
return False, str(exc)
|
||||
|
||||
|
||||
DEFAULT_TIER = 'default'
|
||||
|
||||
|
||||
def group_tier(group):
|
||||
"""Return the tier of a manifest group (groups default to 'default')."""
|
||||
return group.get('tier', DEFAULT_TIER)
|
||||
|
||||
|
||||
def select_groups(manifest, tiers):
|
||||
"""Return the manifest groups belonging to the requested tiers.
|
||||
|
||||
tiers is a collection of tier names; 'all' selects every group.
|
||||
"""
|
||||
groups = manifest.get('recipes', [])
|
||||
if 'all' in tiers:
|
||||
return groups
|
||||
return [g for g in groups if group_tier(g) in tiers]
|
||||
|
||||
|
||||
def clean_output(directory):
|
||||
"""Remove previously generated .cfg files so stale dishes never linger."""
|
||||
if not os.path.isdir(directory):
|
||||
return
|
||||
for entry in os.listdir(directory):
|
||||
if entry.endswith('.cfg'):
|
||||
os.remove(os.path.join(directory, entry))
|
||||
|
||||
|
||||
def generate(manifest_path, templates_path, recipes_dir, dishes_dir,
|
||||
ingredients_dir, do_generate=True, do_lint=True, do_validate=True):
|
||||
"""Full cooking pipeline. Returns an exit code (0 on success)."""
|
||||
ingredients_dir, do_generate=True, do_lint=True, do_validate=True,
|
||||
tiers=(DEFAULT_TIER,)):
|
||||
"""Full cooking pipeline. Returns an exit code (0 on success).
|
||||
|
||||
Only groups in the requested tiers are written; lint always covers the
|
||||
whole manifest so inactive tiers cannot rot.
|
||||
"""
|
||||
manifest = load_yaml(manifest_path)
|
||||
templates = load_yaml(templates_path)
|
||||
ingredients_root = os.path.join(os.path.dirname(os.path.abspath(manifest_path)),
|
||||
@@ -225,8 +258,10 @@ def generate(manifest_path, templates_path, recipes_dir, dishes_dir,
|
||||
if do_generate:
|
||||
os.makedirs(recipe_dir, exist_ok=True)
|
||||
os.makedirs(dish_dir, exist_ok=True)
|
||||
clean_output(recipe_dir)
|
||||
clean_output(dish_dir)
|
||||
|
||||
for group in manifest.get('recipes', []):
|
||||
for group in select_groups(manifest, tiers):
|
||||
group_name = group.get('name', 'unknown')
|
||||
for config in group.get('variants', []):
|
||||
for variant in expand_variants(config):
|
||||
@@ -315,6 +350,9 @@ def main(argv=None):
|
||||
help='output directory for flattened dishes (default: dishes)')
|
||||
parser.add_argument('--ingredients-dir', default='ingredients',
|
||||
help='ingredient fragments directory (default: ingredients)')
|
||||
parser.add_argument('--tier', action='append', metavar='TIER',
|
||||
help="manifest tier to generate: default, guest, experimental "
|
||||
"or all; repeatable (default: default)")
|
||||
parser.add_argument('--no-generate', action='store_true',
|
||||
help='do not write recipes or dishes (lint/validate only)')
|
||||
parser.add_argument('--no-lint', action='store_true',
|
||||
@@ -342,7 +380,8 @@ def main(argv=None):
|
||||
args.ingredients_dir,
|
||||
do_generate=not args.no_generate,
|
||||
do_lint=not args.no_lint,
|
||||
do_validate=not args.no_validate)
|
||||
do_validate=not args.no_validate,
|
||||
tiers=tuple(args.tier or (DEFAULT_TIER,)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user