gardenlinux / builder

Builder used to construct Garden Linux. Re-usable for other OS-projects.
Apache License 2.0
9 stars 2 forks source link

Print graph of feature dependencies #68

Closed fwilhe closed 8 months ago

fwilhe commented 8 months ago

This adds a new 'graph' command to parse_features. This command prints the text representation of a mermaid js flowchart/graph. This output can be embedded into GitHub flavoured markdown files.

I used the following command to run the script:

builder/builder/parse_features  --feature-dir gardenlinux/features/ --arch `dpkg --print-architecture` --version today --cname kvm graph

where the cname argument can be any feature.

fwilhe commented 8 months ago

Generated graphs PoC

neat 😃

---
title: Dependency Graph for Feature ali
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    ali-->cloud;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature aws
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    aws-->cloud;
    cloud-->server;
    cloud-->_boot;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature azure
---
graph TD;
    base-->_slim;
    azure-->cloud;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature base
---
graph TD;
    base-->_slim;
---
title: Dependency Graph for Feature chost
---
graph TD;
    base-->_slim;
    chost-->server;
    ssh-->firewall;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature cis
---
graph TD;
    cis-->aide;
    cis-->cisAudit;
    cis-->cisModprobe;
    cis-->cisOS;
    cis-->cisPackages;
    cis-->cisPartition;
    cis-->cisSshd;
    cis-->cisSysctl;
    cis-->firewall;
---
title: Dependency Graph for Feature cloud
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature container
---
graph TD;
    base-->_slim;
    container-->base;
---
title: Dependency Graph for Feature fedramp
---
graph TD;
    fedramp-->aide;
    fedramp-->clamav;
---
title: Dependency Graph for Feature firecracker
---
graph TD;
    base-->_slim;
    firecracker-->server;
    ssh-->firewall;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
---
title: Dependency Graph for Feature gardener
---
graph TD;
    base-->_slim;
    gardener-->server;
    gardener-->sap;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
---
title: Dependency Graph for Feature gcp
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    gcp-->cloud;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature khost
---
graph TD;
    base-->_slim;
    chost-->server;
    ssh-->firewall;
    khost-->chost;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature kvm
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    kvm-->cloud;
    kvm-->_ignite;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature metal
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
    metal-->server;
    metal-->_boot;
---
title: Dependency Graph for Feature openstack
---
graph TD;
    openstack-->cloud;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature openstackbaremetal
---
graph TD;
    openstackbaremetal-->metal;
    base-->_slim;
    ssh-->firewall;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
    metal-->server;
    metal-->_boot;
---
title: Dependency Graph for Feature sapmachine
---
graph TD;
    sapmachine-->_curl;
---
title: Dependency Graph for Feature server
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature ssh
---
graph TD;
    ssh-->firewall;
---
title: Dependency Graph for Feature vhost
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    vhost-->server;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;
---
title: Dependency Graph for Feature vmware
---
graph TD;
    base-->_slim;
    ssh-->firewall;
    cloud-->server;
    cloud-->_boot;
    vmware-->cloud;
    vmware-->_ignite;
    server-->base;
    server-->ssh;
    server-->sap;
    server-->log;
    server-->_selinux;