dia_nc_test_improved.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from diagrams import Cluster, Diagram, Edge
  2. from diagrams.azure.database import DatabaseForMariadbServers
  3. from diagrams.onprem.network import Internet
  4. from diagrams.onprem.groupware import Nextcloud
  5. from diagrams.onprem.monitoring import Grafana, Prometheus
  6. from diagrams.onprem.network import Haproxy
  7. import diagrams.generic.storage as storage_1
  8. from diagrams.azure.identity import Groups
  9. from diagrams.onprem.storage import Ceph, CephOsd
  10. from diagrams.custom import Custom
  11. mypath="/home/pbarriat/Documents/Boulot/UCL/Brevet/report/assets/"
  12. with Diagram(filename="../assets/dia_nc_test_improved", show=True, direction="TB"):
  13. out = Internet("Intranet")
  14. ldap = Groups("LDAP")
  15. with Cluster("SSL proxy + PHP Caching"):
  16. openstack_lb = Custom("", mypath+"openstack.png")
  17. lb = [Haproxy("Load Balancing")]
  18. with Cluster("Web server"):
  19. openstack_web = Custom("", mypath+"openstack.png")
  20. with Cluster("Node 1"):
  21. caching_1 = Custom("PHP Caching", mypath+"keydb.png")
  22. nc_frontend_1 = [ Nextcloud(), caching_1]
  23. with Cluster("Node 2"):
  24. caching_2 = Custom("PHP Caching", mypath+"keydb.png")
  25. nc_frontend_2 = [ Nextcloud(), caching_2]
  26. caching_1 - Edge(label="Master-Master", style="dashed") - caching_2
  27. with Cluster("Database"):
  28. openstack_db = Custom("", mypath+"openstack.png")
  29. nc_db = DatabaseForMariadbServers("Backup writer")
  30. with Cluster("Ceph Storage Cluster"):
  31. ceph_cluster = Ceph()
  32. ceph_object = CephOsd("Object Gateway")
  33. #with Cluster("Control / Monitor"):
  34. # openstack_ctrl = Custom("", mypath+"openstack.png")
  35. # ctrl = [Prometheus(), Grafana()]
  36. openstack_lb >> openstack_web << openstack_db
  37. ceph_cluster >> openstack_web << ldap
  38. #openstack_ctrl >> openstack_web
  39. out >> lb