From 4348efacceed39f13d254eb0e709713e578ee6ed Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 24 Jul 2023 23:46:23 +0000 Subject: [PATCH] Replace blockdiag with graphviz The python blockdiag module is unmaintained and will likely be removed from distros.[1] This patch replaces blockdiag with graphviz diagrams. [1] https://github.com/blockdiag/blockdiag/pull/171 Change-Id: I3a902c60b59071b466e1bf1ec6bda205e58b378c (cherry picked from commit beb79ac98cf31f9c819fd73c512839dc22d39f4f) --- bindep.txt | 2 + doc/requirements.txt | 1 - doc/source/admin/ha.rst | 205 +++++++++++++++++++++++++--------------- doc/source/conf.py | 4 +- 4 files changed, 130 insertions(+), 82 deletions(-) create mode 100644 bindep.txt diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 000000000..d6b959584 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,2 @@ +# Docs package dependencies +graphviz [doc] diff --git a/doc/requirements.txt b/doc/requirements.txt index bd423eb40..78a1f06cc 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,7 +3,6 @@ # process, which may cause wedges in the gate later. sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-httpdomain>=1.3.0 # BSD -sphinxcontrib-blockdiag>=1.5.4 # BSD reno>=3.1.0 # Apache-2.0 os-api-ref>=1.4.0 # Apache-2.0 openstackdocstheme>=2.2.0 # Apache-2.0 diff --git a/doc/source/admin/ha.rst b/doc/source/admin/ha.rst index 90793aa4a..3549fa696 100644 --- a/doc/source/admin/ha.rst +++ b/doc/source/admin/ha.rst @@ -18,20 +18,24 @@ Needs Access to: * AMQP -.. blockdiag:: +.. graphviz:: - blockdiag { - - loadbalancer [label="L7 Load Balancer", stacked]; - amqp_servers [label="AMQP Servers", stacked] - group api_servers { - label = "API Servers"; - api_server_1 [label="API Server 1"]; - api_server_2 [label="API Server 2"]; - api_server_3 [label="API Server 3"]; - } - loadbalancer -> api_server_1, api_server_2, api_server_3; - api_server_1, api_server_2, api_server_3 -> amqp_servers; + digraph APIHA { + rankdir=LR + {"L7 Load Balancers" [shape=box] + "API Server 1" [shape=box] + "API Server 2" [shape=box] + "API Server 3" [shape=box] + "AMQP Servers" [shape=box] + } + subgraph "API Servers" { + cluster=true; + label="API Servers"; + "API Server 1"; + "API Server 2"; + "API Server 3"; + } + "L7 Load Balancers" -> {"API Server 1" "API Server 2" "API Server 3"} -> "AMQP Servers"; } Notes @@ -67,20 +71,29 @@ Needs Access to: * AMQP * Database -.. blockdiag:: +.. graphviz:: - blockdiag { - - amqp_servers [label="AMQP Servers", stacked] - db_servers [label="Database Servers", stacked, shape=flowchart.database] - group designate_central_servers { - label = "designate-central Servers"; - designate_central_server_1 [label="designate-central Server 1", width=256]; - designate_central_server_2 [label="designate-central Server 2", width=256]; - designate_central_server_3 [label="designate-central Server 3", width=256]; - } - amqp_servers <-> designate_central_server_1, designate_central_server_2, designate_central_server_3; - designate_central_server_1, designate_central_server_2, designate_central_server_3 -> db_servers; + digraph CENTRALHA { + rankdir=LR + {"AMQP Servers" [shape=box] + "designate-central Server 1" [shape=box] + "designate-central Server 2" [shape=box] + "designate-central Server 3" [shape=box] + "Database Servers" [shape=cylinder] + } + subgraph "designate-central Servers" { + cluster=true; + label="designate-central Servers"; + "designate-central Server 1"; + "designate-central Server 2"; + "designate-central Server 3"; + } + "AMQP Servers" -> "designate-central Server 1" [dir=both]; + "AMQP Servers" -> "designate-central Server 2" [dir=both]; + "AMQP Servers" -> "designate-central Server 3" [dir=both]; + "designate-central Server 1" -> "Database Servers"; + "designate-central Server 2" -> "Database Servers"; + "designate-central Server 3" -> "Database Servers"; } Notes @@ -99,22 +112,33 @@ Needs Access to: * Database * DNS Servers -.. blockdiag:: +.. graphviz:: - blockdiag { - - amqp_servers [label="AMQP Servers", stacked] - dns_servers [label="DNS Servers", stacked, shape="cloud"] - db_servers [label="Database Servers", stacked, shape=flowchart.database] - group designate_mdns_servers { - label = "designate-mdns Servers"; - designate_mdns_server_1 [label="designate-mdns Server 1", width=256]; - designate_mdns_server_2 [label="designate-mdns Server 2", width=256]; - designate_mdns_server_3 [label="designate-mdns Server 3", width=256]; - } - amqp_servers <-> designate_mdns_server_1, designate_mdns_server_2, designate_mdns_server_3; - designate_mdns_server_1, designate_mdns_server_2, designate_mdns_server_3 <- db_servers; - designate_mdns_server_1, designate_mdns_server_2, designate_mdns_server_3 -> dns_servers; + digraph MDNSHA { + rankdir=LR + {"AMQP Servers" [shape=box] + "designate-mdns Server 1" [shape=box] + "designate-mdns Server 2" [shape=box] + "designate-mdns Server 3" [shape=box] + "DNS Servers" [shape=egg] + "Database Servers" [shape=cylinder] + } + subgraph "designate-mdns Servers" { + cluster=true; + label="designate-mdns Servers"; + "designate-mdns Server 1"; + "designate-mdns Server 2"; + "designate-mdns Server 3"; + } + "AMQP Servers" -> "designate-mdns Server 1" [dir=both]; + "AMQP Servers" -> "designate-mdns Server 2" [dir=both]; + "AMQP Servers" -> "designate-mdns Server 3" [dir=both]; + "designate-mdns Server 1" -> "Database Servers" [dir=back]; + "designate-mdns Server 2" -> "Database Servers" [dir=back]; + "designate-mdns Server 3" -> "Database Servers" [dir=back]; + "designate-mdns Server 1" -> "DNS Servers" + "designate-mdns Server 2" -> "DNS Servers" + "designate-mdns Server 3" -> "DNS Servers" } Notes @@ -132,20 +156,29 @@ Needs Access to: * AMQP * DNS Servers -.. blockdiag:: +.. graphviz:: - blockdiag { - - amqp_servers [label="AMQP Servers", stacked] - dns_servers [label="DNS Servers", stacked, shape="cloud"] - group designate_worker_servers { - label = "designate-worker Servers"; - designate_worker_server_1 [label="designate-worker Server 1", width=256]; - designate_worker_server_2 [label="designate-worker Server 2", width=256]; - designate_worker_server_3 [label="designate-worker Server 3", width=256]; - } - amqp_servers <-> designate_worker_server_1, designate_worker_server_2, designate_worker_server_3; - designate_worker_server_1, designate_worker_server_2, designate_worker_server_3 -> dns_servers; + digraph WORKERSHA { + rankdir=LR + {"AMQP Servers" [shape=box] + "designate-worker Server 1" [shape=box] + "designate-worker Server 2" [shape=box] + "designate-worker Server 3" [shape=box] + "DNS Servers" [shape=egg] + } + subgraph "designate-worker Servers" { + cluster=true; + label="designate-worker Servers"; + "designate-worker Server 1"; + "designate-worker Server 2"; + "designate-worker Server 3"; + } + "AMQP Servers" -> "designate-worker Server 1" [dir=both]; + "AMQP Servers" -> "designate-worker Server 2" [dir=both]; + "AMQP Servers" -> "designate-worker Server 3" [dir=both]; + "designate-worker Server 1" -> "DNS Servers" + "designate-worker Server 2" -> "DNS Servers" + "designate-worker Server 3" -> "DNS Servers" } Notes @@ -163,20 +196,29 @@ Needs Access to: * AMQP * DLM -.. blockdiag:: +.. graphviz:: - blockdiag { - - amqp_servers [label="AMQP Servers", stacked] - dlm_servers [label="DLM Servers", stacked] - group designate_producer_servers { - label = "designate-producer Servers"; - designate_producer_server_1 [label="designate-producer Server 1", width=256]; - designate_producer_server_2 [label="designate-producer Server 2", width=256]; - designate_producer_server_3 [label="designate-producer Server 3", width=256]; - } - amqp_servers <-> designate_producer_server_1, designate_producer_server_2, designate_producer_server_3; - designate_producer_server_1, designate_producer_server_2, designate_producer_server_3 -> dlm_servers; + digraph PRODUCERSHA { + rankdir=LR + {"AMQP Servers" [shape=box] + "designate-producer Server 1" [shape=box] + "designate-producer Server 2" [shape=box] + "designate-producer Server 3" [shape=box] + "DLM Servers" [shape=octagon] + } + subgraph "designate-producer Servers" { + cluster=true; + label="designate-producer Servers"; + "designate-producer Server 1"; + "designate-producer Server 2"; + "designate-producer Server 3"; + } + "AMQP Servers" -> "designate-producer Server 1" [dir=both]; + "AMQP Servers" -> "designate-producer Server 2" [dir=both]; + "AMQP Servers" -> "designate-producer Server 3" [dir=both]; + "designate-producer Server 1" -> "DLM Servers" + "designate-producer Server 2" -> "DLM Servers" + "designate-producer Server 3" -> "DLM Servers" } Notes @@ -205,18 +247,25 @@ Needs Access to: * AMQP -.. blockdiag:: +.. graphviz:: - blockdiag { - - amqp_servers [label="AMQP Servers", stacked] - group designate_sink_servers { - label = "designate-sink Servers"; - designate_sink_server_1 [label="designate-sink Server 1", width=256]; - designate_sink_server_2 [label="designate-sink Server 2", width=256]; - designate_sink_server_3 [label="designate-sink Server 3", width=256]; - } - amqp_servers <-> designate_sink_server_1, designate_sink_server_2, designate_sink_server_3; + digraph SINKSHA { + rankdir=LR + {"AMQP Servers" [shape=box] + "designate-sink Server 1" [shape=box] + "designate-sink Server 2" [shape=box] + "designate-sink Server 3" [shape=box] + } + subgraph "designate-sink Servers" { + cluster=true; + label="designate-sink Servers"; + "designate-sink Server 1"; + "designate-sink Server 2"; + "designate-sink Server 3"; + } + "AMQP Servers" -> "designate-sink Server 1" [dir=both]; + "AMQP Servers" -> "designate-sink Server 2" [dir=both]; + "AMQP Servers" -> "designate-sink Server 3" [dir=both]; } Notes diff --git a/doc/source/conf.py b/doc/source/conf.py index 112340e5e..78be6e3b2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -32,8 +32,8 @@ sys.path.insert(0, os.path.abspath('./')) # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', + 'sphinx.ext.graphviz', 'sphinxcontrib.httpdomain', - 'sphinxcontrib.blockdiag', 'ext.support_matrix', 'ext.custom_css', 'openstackdocstheme', @@ -54,8 +54,6 @@ sample_config_basename = '_static/designate' policy_generator_config_file = '../../etc/designate/designate-policy-generator.conf' sample_policy_basename = '_static/designate' -blockdiag_antialias = True -blockdiag_html_image_format = "SVG" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']