<U>Legend</U> <BR ALIGN="LEFT" /><BR/> <FONT color="gray">●</FONT> automated <BR ALIGN="LEFT" /> <FONT color="green">●</FONT> proxy <BR ALIGN="LEFT" /> >""" with Diagram("Homelab", show=False, outformat="png"): Node( label=legend_text, width="4", shape="plaintext", ) workstation = Ansible("homelab.git") with Cluster("Service Node"): ingress = Traefik("ingress") middleware = [Firewall("OAuth middlware")] ingress >> Edge(style="dashed") >> middleware ( ingress >> Edge(color="green") >> [ Server("adguard"), Server("espial"), Server("miniflux"), PostgreSQL("miniflux_db"), Server("firefly"), PostgreSQL("firefly_db"), Server("healthchecks"), Server("n8n"),
with Cluster("Pi Cluster", direction="TB"): docker = Docker() with Cluster("Pi 1", direction="TB") as pi1: controller = Docker("Docker Swarm Manager") glusterfs1 = Glusterfs("glusterfs") with Cluster("Pi 2", direction="TB") as pi2: agent = Docker("Docker Swarm Node") glusterfs2 = Glusterfs("glusterfs") with Cluster("Containers"): with Cluster("External"): cloudflared = Custom("cloudflared", icons["cloudflareCloud"]["icon"]) traefik = Traefik("traefik") with Cluster("Internal"): visualizer = Custom("visualizer", icons["visualizer"]["icon"]) gitea = Gitea("Gitea") allaboutsecurity = Custom("allaboutsecurity.xyz", icons["ghost"]["icon"]) ghost = Custom("Ghost", icons["ghost"]["icon"]) vscode = Custom("VSCode Server", icons["vscode"]["icon"]) firefly = Custom("Firefly III", icons["firefly"]["icon"]) fireflycsv = Custom("Firefly CSV", icons["firefly"]["icon"]) gaps = Custom("Gaps", icons["gaps"]["icon"]) grafana = Grafana("Grafana") homeassistant = Custom("Home Assistant", icons["homeassistant"]["icon"])
from diagrams import Cluster, Diagram from diagrams.aws.storage import SimpleStorageServiceS3Bucket from diagrams.k8s.group import NS from diagrams.k8s.compute import Pod from diagrams.k8s.storage import Vol from diagrams.onprem.network import Traefik from diagrams.onprem.vcs import Github from diagrams.k8s.network import Ing, SVC with Diagram("pet2cattle", show=False): ingress_controller = Traefik("ingress controller") git_repo = Github("posts") s3_bucket = SimpleStorageServiceS3Bucket("S3 bucket") with Cluster("pet2cattle namespace"): pet2cattle_blog = Pod("blog") pet2cattle_blog - [Vol("temporal data")] s3_bucket >> pet2cattle_blog pet2cattle_static = Pod("static content") pet2cattle_s3sync = Pod("s3sync") git_repo >> pet2cattle_s3sync pet2cattle_s3sync >> s3_bucket blog_ingress = Ing("blog content") static_ingress = Ing("static content") svc_blog = SVC("blog")
api << rc with Diagram("OpenFlow with Traefik"): with Cluster("Backend"): b = [Mongodb("MongoDB"), Rabbitmq("RabbitMQ")] with Cluster("Remote Clients"): rc = [Custom("OpenRPA", "./my_resources/open_rpa128.png"), Custom("PowerShell", "./my_resources/PowerShell_5.0_icon.png"), Custom("NodeRED", "./my_resources/node-red-icon.png")] with Cluster("Frontend + API"): api = EC2("WEB-API") cn = Custom("NodeRED", "./my_resources/node-red-icon.png") t = Traefik("Traefik") b << api cn << t api << t t << rc with Diagram("OpenFlow with Monitoring"): with Cluster("Backend"): b = [Mongodb("MongoDB"), Rabbitmq("RabbitMQ")] with Cluster("Remote Clients"): rc = [Custom("OpenRPA", "./my_resources/open_rpa128.png"), Custom("PowerShell", "./my_resources/PowerShell_5.0_icon.png"), Custom("NodeRED", "./my_resources/node-red-icon.png")]
from diagrams import Diagram from diagrams.custom import Custom from diagrams.onprem.ci import Droneci from diagrams.onprem.network import Traefik from diagrams.onprem.vcs import Github from diagrams.programming.framework import Angular with Diagram("Web Pipeline", show=False): angular = Angular("Web app") drone = Droneci("Drone") watchtower = Custom("WatchTower", "./logos/watchtower.png") github = Github("Github") dockerhub = Custom("", "./logos/dockerhub.png") traefik = Traefik("Traefik reverse proxy") traefik >> angular >> github >> drone >> dockerhub >> watchtower >> traefik
def ArchitectureDiagrams(prod_short, project_context, orch_name): script_path = os.path.dirname(os.path.realpath(__file__)) file_path = script_path + \ '/../modules/administration-guide/images/architecture/' + project_context + '-' prod_icon = script_path + '/' + project_context + '-icon.png' graph_attr = { "bgcolor": "white", "layout": "dot", "overlap": "false", # "splines": "curved" } filename = file_path + 'architecture-with-che-server-engine' with Diagram(filename=filename, show=False, direction="TB", outformat="png", edge_attr={"constraint": "false"}, graph_attr=graph_attr): devfile = Git('Devfile v1') dashboard = Custom('User dashboard', prod_icon) che_host = Custom(prod_short + ' server', prod_icon) with Cluster(orch_name + ' API'): workspace = Compute('User workspace') devfile >> dashboard >> che_host >> workspace filename = file_path + 'interacting-with-devworkspace' with Diagram(filename=filename, show=False, direction="LR", outformat="png", graph_attr=graph_attr): devfile = Git('Devfile v2') dashboard = Custom('User dashboard', prod_icon) with Cluster(orch_name + ' API'): devworkspace_operator = Compute('DevWorkspace') workspace = Compute('User workspace') devfile >> dashboard >> devworkspace_operator >> workspace filename = file_path + 'deployments-interacting-with-devworkspace' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_dashboard = Custom('User dashboard', icon_path=prod_icon) che_gateway = Traefik('Gateway') devfile_registries = SimpleStorageService('Devfile registries') che_host = Custom(prod_short + ' server', icon_path=prod_icon) git = Git('Git provider') postgres = PostgreSQL('PostgreSQL') plugin_registry = SimpleStorageService('Plug-in registry') kubernetes_api = APIServer(orch_name + ' API') user = User('User browser') user >> che_gateway che_gateway >> [ che_dashboard, devfile_registries, che_host, plugin_registry, kubernetes_api ] che_host >> [postgres, git] filename = file_path + 'gateway-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): user = User('User') che_gateway = Traefik('Gateway') che_dashboard = Custom('User dashboard', icon_path=prod_icon) devfile_registries = SimpleStorageService('Devfile registry') che_host = Custom(prod_short + ' server', icon_path=prod_icon) plugin_registry = SimpleStorageService('Plug-in registry') user_workspace = Compute('User workspaces') user >> che_gateway >> [ che_dashboard, che_host, devfile_registries, plugin_registry, user_workspace ] filename = file_path + 'dashboard-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_dashboard = Custom('User dashboard', icon_path=prod_icon) devfile_registry = SimpleStorageService('Devfile registries') che_host = Custom(prod_short + ' server', icon_path=prod_icon) plugin_registry = SimpleStorageService('Plug-in registry') crd_workspace = APIServer(orch_name + ' API') che_dashboard >> che_host, che_dashboard >> [devfile_registry, plugin_registry] che_dashboard >> crd_workspace filename = file_path + 'server-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_host = Custom(prod_short + ' server', icon_path=prod_icon) postgres = PostgreSQL('PostgreSQL') git_provider = Git('Git provider') crd_workspace = APIServer('API') che_dashboard = Custom('User dashboard', icon_path=prod_icon) che_dashboard >> che_host che_host >> [git_provider] che_host >> crd_workspace che_host >> postgres filename = file_path + 'postgresql-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_host = Custom(prod_short + ' server', icon_path=prod_icon) postgres = PostgreSQL('PostgreSQL') che_host >> postgres filename = file_path + 'devfile-registry-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_dashboard = Custom('User dashboard', icon_path=prod_icon) devfile_registry = SimpleStorageService('Devfile registries') che_dashboard >> devfile_registry filename = file_path + 'plugin-registry-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_dashboard = Custom('User dashboard', icon_path=prod_icon) plugin_registry = SimpleStorageService('Plug-in registry') che_dashboard >> plugin_registry filename = file_path + 'user-workspaces-interactions' with Diagram(filename=filename, show=False, direction="TB", outformat="png", graph_attr=graph_attr): che_gateway = Traefik('Gateway') git = Git('Git provider') container_registries = SimpleStorageService('Container registries') artifact_management = SimpleStorageService('Dependency provider') user = User('User') user_workspace = Compute('User workspaces') user >> che_gateway >> user_workspace user_workspace >> [git, container_registries, artifact_management]
from diagrams.onprem.network import Traefik from diagrams.programming.language import Python with Diagram("Simplified Orchestra Architecture Diagram", show=False): dns = Route53("Wildcard DNS\n*.bioc.cancerdatasci.org") lb = LoadBalancing("Load Balancer") pg = Postgresql("AWS Aurora PostgreSQL") users = Users("Workshop\nParticipants") web = Client("Standard Web Browser") with Cluster("Kubernetes Cluster"): app = Python("Orchestra") master = Master("Kubernetes Master\nRunning on GKE") k8api = API("Kubernetes Control API") s = [] w = [] ing = Traefik("Router & Proxy") ing >> app app >> pg app >> k8api k8api >> master pg >> app prom = Prometheus("Prometheus\nMonitoring") graf = Grafana("Grafana\nVisualization") ing >> graf graf >> prom for i in range(0, 5): with Cluster(f"Workshop {i+1}"): s.append(Service(f"Service")) w.append(Pod(f"Rstudio")) s[i] >> w[i] ing >> s[i]