示例#1
0
from diagrams import Cluster, Diagram

from diagrams.gcp.analytics import PubSub
from diagrams.gcp.compute import AppEngine, Functions
from diagrams.gcp.database import Firestore

graph_attr = {"bgcolor": "transparent", "pad": "0"}

with Diagram("Message Queue",
             graph_attr=graph_attr,
             show=False,
             filename="images/message_queue"):
    with Cluster("Operational Data Hub"):
        with Cluster("Ingest"):
            publisher_1 = Functions("Function")
            publisher_2 = AppEngine("Application")

        with Cluster("Consume"):
            subscriber_1 = Functions("Function")
            subscriber_2 = Firestore("Database")
            subscriber_3 = AppEngine("Application")

        with Cluster("Core"):
            queue_1 = PubSub("Queue X")
            queue_2 = PubSub("Queue Y")
            queue_3 = PubSub("Queue Z")

    publisher_1 >> queue_1 >> [subscriber_1, subscriber_2]
    publisher_1 >> queue_3 >> subscriber_3
    publisher_2 >> queue_2 >> [subscriber_1, subscriber_3]
示例#2
0
from diagrams.gcp.analytics import PubSub
from diagrams.gcp.database import Firestore

from diagrams.onprem.client import Client
from diagrams.gcp.compute import Functions
from diagrams.generic.storage import Storage

graph_attr = {"bgcolor": "transparent", "pad": "0"}

with Diagram("CQRS models",
             graph_attr=graph_attr,
             show=False,
             filename="images/cqrs_models"):
    with Cluster("Operational Data Hub platform"):
        firestore_1_1 = Firestore("Database")

        with Cluster("API"):
            with Cluster("CQRS Model"):
                cqrs_1_1 = Storage("Query Model")
                cqrs_1_2 = Storage("Command Model")

    webshop_1 = Client("Webshop")

    firestore_1_1 >> Edge(color="orange") >> cqrs_1_1 >> Edge(color="orange") >> \
        Edge(label="Presentation updates", color="orange") >> webshop_1
    webshop_1 >> Edge(label="User changes") >> cqrs_1_2 >> firestore_1_1

with Diagram("ODH CQRS integration",
             graph_attr=graph_attr,
             show=False,
示例#3
0
    with Cluster("StreamState cluster"):
        # svc_group = [ECS("web1"), ECS("web2"), ECS("web3")]
        with Cluster("Replay"):
            kafka_storage = Storage("Kafka sink")
            spark_reload = Spark("Replay")

        with Cluster("Realtime"):
            spark_persist = Spark("No transforms")
            spark_state = Spark("Analytical Stream")

        argo = Argocd("Gitops")
        argo >> spark_state
        argo >> spark_reload
        with Cluster("Dev"):
            code = Code("Dev App")
            code >> argo
            code >> argo

        firestore = Firestore("Cache/upsert")
        spark_persist >> kafka_storage
        kafka_storage >> spark_reload
        kafka_input >> spark_state
        kafka_input >> spark_persist
        spark_state >> firestore
        spark_reload >> firestore
        spark_state >> kafka_output
        spark_reload >> kafka_output

    firestore >> Python("python sdk")
示例#4
0
from diagrams import Diagram, Cluster
from diagrams.gcp.database import Firestore
from diagrams.gcp.network import CDN, DNS, LoadBalancing
from diagrams.gcp.storage import GCS
from diagrams.gcp.compute import GKE
from diagrams.onprem.compute import Server
from diagrams.oci.network import Internetgateway

with Diagram("Gran - GCP Design", show=False):
    server = Server("Client (Nuxt.js)")

    with Cluster("Google Cloud Platform"):
        firestore = Firestore("Firebase Firestore")
        cdn = CDN("Cloud CDN")
        dns = DNS("Cloud DNS")
        lb = LoadBalancing("Cloud Load Balancing")
        gcs = GCS("Cloud Storage")
        gke = GKE("Kubernetes Engine")
        net = Internetgateway("Gateway")

        dns >> cdn >> gcs
        dns >> lb >> gke >> firestore

    server >> net
    net >> dns
示例#5
0
with Diagram("Customer support mailbox",
             graph_attr=graph_attr,
             show=False,
             filename="images/mailbox"):
    server_1 = Server("Mail server")
    webshop_1 = Client("Webshop")

    with Cluster("Operational Data Hub Platform"):
        with Cluster("Operational Data Hub"):
            with Cluster("Pub/Sub Topic"):
                pubsub_1 = PubSub("Subscription")

        with Cluster("Ingest Project"):
            schedule_1 = Scheduler("Cloud Scheduler")
            function_1 = Functions("EWS Mail Ingest")
            storage_1 = Storage("GCS Bucket")

        with Cluster("Consume Project"):
            function_2 = Functions("Consume")
            firestore_1 = Firestore("Database")
            appengine_1 = AppEngine("API")

    schedule_1 - Edge(label="Trigger", style="dotted") - function_1
    function_1 >> Edge(label="REST - GET", color="black") >> server_1
    function_1 >> Edge(label="Publish", color="orange") >> pubsub_1
    function_1 >> storage_1 << Edge(label="GET", color="orange") << function_2
    pubsub_1 >> Edge(label="Subscribe", color="orange") >> function_2 >> Edge(
        color="orange") >> firestore_1
    firestore_1 << Edge(label="GET") << appengine_1 << Edge(
        label="REST - GET", color="black") << webshop_1
示例#6
0
from diagrams import Diagram, Cluster
from diagrams.gcp.database import Firestore
from diagrams.onprem.network import Envoy
from diagrams.onprem.compute import Server
from diagrams.oci.network import Internetgateway
from diagrams.k8s.compute import Pod
from diagrams.k8s.network import Ingress, Service

with Diagram("Gran - API System - Design", show=False):
    igw = Internetgateway("Gateway")

    with Cluster("Google Cloud Platform"):
        with Cluster("Google Kubernetes Engine"):
            net = Ingress("calmato.work")
            pods = [
                Pod("user service"),
                Pod("group service"),
                Pod("todo service")
            ]

            net >> Service("svc") >> Envoy("lb") >> pods

        with Cluster("Firebase"):
            auth = Server("firebase authentication")
            firestore = Firestore("firestore")

            pods >> auth
            pods >> firestore

    igw >> net
示例#7
0
"""
from diagrams import Cluster, Diagram
from diagrams.gcp.analytics import PubSub
from diagrams.gcp.compute import Functions
from diagrams.gcp.storage import GCS
from diagrams.gcp.analytics import BigQuery
from diagrams.gcp.database import Firestore
from diagrams.gcp.devtools import Scheduler

with Diagram("Strava Leaderboard Architecture Diagram ", show=True):
    source = Functions("generate grid")

    with Cluster("Data Pipeline"):
        gird_queue = PubSub("grid queue")

        credential = Firestore("credentials store")

        store = GCS("raw JSON")

        with Cluster("Extract-Load"):
            with Cluster("scheduler"):
                scheduler = Scheduler("scheduler")
                schedule_queue = PubSub("schedule queue")

            extract_load = Functions("worker")

            staging = BigQuery("BigQuery staging dataset")

        with Cluster("Transform"):
            transform = Functions("transform worker")
            analysis = BigQuery("BigQuery analysis dataset")
示例#8
0
             graph_attr=graph_attr,
             show=False,
             filename="images/data_science"):
    webshop_1 = Client("Webshop")

    with Cluster("Operational Data Hub Platform"):
        with Cluster("Ingest Project"):
            function_1 = Functions("Ingest")

        with Cluster("Operational Data Hub"):
            with Cluster("Pub/Sub Topic X"):
                pubsub_1_1 = PubSub("Subscription XA")

            with Cluster("Pub/Sub Topic Z"):
                pubsub_2_1 = PubSub("Subscription ZA")

        with Cluster("Consume Project"):
            dataflow_1 = Dataflow("Dataflow")

            with Cluster("Analyze"):
                bigquery_1 = Bigquery("BigQuery")
                aiplatform_1 = AIPlatform("AI Platform")
                firestore_2 = Firestore("Database")
                dataflow_2 = Dataflow("Backfill/reprocess")

    pubsub_1_1 >> dataflow_1
    dataflow_1 >> [bigquery_1, aiplatform_1, firestore_2] >> dataflow_2
    bigquery_1 >> Edge(label="Results", color="orange") >> function_1 >> Edge(
        color="orange") >> pubsub_2_1
    pubsub_2_1 >> Edge(label="Results", color="orange") >> webshop_1