Skip to content

Commit

Permalink
Merge pull request #15 from Jsoconno/feature-readme
Browse files Browse the repository at this point in the history
Feature readme
  • Loading branch information
jsoconno authored Jan 6, 2021
2 parents 014989d + 3286bb6 commit cebceb2
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 41 deletions.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# architectures
Architecture as code tools.
# Architectures

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
![python version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-blue?logo=python)
[![todos](https://badgen.net/https/api.tickgit.com/badgen/github.com/mingrammer/diagrams?label=todos)](https://www.tickgit.com/browse?repo=github.com/jsoconno/architectures)

![default provider](https://img.shields.io/badge/provider-Default-orange?color=C70039)
![azure provider](https://img.shields.io/badge/provider-Azure-orange?logo=microsoft-azure&color=007FFF)

<a href="https://www.buymeacoffee.com/jsoconno" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

## Introduction
In a galaxy far, far away where everything is managed as code...

Including applications, infrastructure, processes, configurations, governance, and more...

Architecture diagrams were left behind requiring architects to search for files and identify the correct versions of documents stored on local servers across the organization...

Architectures was designed to help technical teams work better together to build architecture as code and overcome the evil visio diagrams grip on the universe...

Only you can usher in an age of renewed hope. Let's hope all is not lost...
## Design Goals
The overarching goal of this project is to alow for the development of architecture as code that can be stored in version control allowing teams to better collaborate and leverage standard coding practices such as pull requests, code reviews, approvals, etc to maintain architecture diagrams.

Architectures has been design goal is to be simple, powerful, extendable and scalable so that anyone in the technology organization can contribute to diagram development. It is also an attempt to eliminate the toil associated with diagram creation and support a wide variety of cloud and on-premise providers.

## Dependencies
Python version 3.6.x or later must be installed.

The graphviz library is also required. To install with Python, simply run the following command in the terminal:
```
pip install graphviz
```

## Supported Objects
There are several types of supported objects in the architectures library. These objects primarily fall into three categories:
### Containers
- **Graphs** allow users to create a base canvas to create their diagram on
- **Clusters** allow users to group **Nodes** into bounded container
- **Groups** allow users to logically group **Nodes** with no bounding container
### Components
- **Nodes** allow users to create an object that represents a service
### Connections
- **Edges** allow users to draw a line between a pair or list of **Nodes**, **Clusters**, or **Groups**
- **Flows** allow users to create a linear flow through a list of **Nodes**, **Clusters**, or **Groups**

The component objects are extended with subclasses that allow for the creation of standard service components from various providers such as Azure, GCP, and AWS.

## Examples
Coming Soon
4 changes: 2 additions & 2 deletions architectures/providers/azure/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class AzureLighthouseProjection(_Management):
_icon = "azure-lighthouse-projection.png"


class Role(Custom)(_Management):
class RoleCustom(_Management):
_icon = "role-(custom).png"


Expand Down Expand Up @@ -151,7 +151,7 @@ class AzureWorkbook(_Management):
_icon = "azure-workbook.png"


class Role(Azuread)(_Management):
class RoleAzuread(_Management):
_icon = "role-(azuread).png"


Expand Down
File renamed without changes
File renamed without changes
Binary file modified my-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions tests/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from architectures.core import Graph, Cluster, Group, Node, Edge, Flow
from architectures.themes import Default, Clean

from architectures.providers.azure.compute import VirtualMachine

theme = Clean(graph_attr_overrides={"rankdir": "LR", "nodesep":"2", "margin":"30"}, edge_attr_overrides={"minlen":"2"})

with Graph("my-architecture", theme=theme):
with Cluster("Cluster A") as cluster_a:
a = VirtualMachine("A")
b = VirtualMachine("B")
c = VirtualMachine("C")

with Cluster("Cluster B") as cluster_b:
d = VirtualMachine("D")
e = VirtualMachine("E")
f = VirtualMachine("F")

with Cluster("Cluster C") as cluster_c:
g = VirtualMachine("G")

Flow([a, e, cluster_c, cluster_b, b, e, g, f])
46 changes: 21 additions & 25 deletions tests/modern-data-warehouse.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
from architectures.core import Graph, Cluster, Group, Node, Edge
from architectures.core import Graph, Cluster, Group, Node, Edge, Flow
from architectures.themes import Default, Clean

from architectures.providers.azure.data import DataFactory, DataLake, AzureDatabricks, AnalysisService, AzureSynapseAnalytics
from architectures.providers.azure.ai import PowerBi

theme = Clean(graph_attr_overrides={"ranksep": "2"}, cluster_attr_overrides={"bgcolor": "whitesmoke"}, node_attr_overrides={"color": "whitesmoke"})
theme = Clean(graph_attr_overrides={"rankdir": "LR", "nodesep":"3"}, edge_attr_overrides={"minlen": "2"})

with Graph("my architecture", theme=theme, show=True):
with Group() as inputs:
unstructured_data = Node("Logs Files and Media (Unstructured)")
structured_data = Node("Business and Custom Apps (Structured)")

with Cluster("Ingest") as ingest:
data_factory = DataFactory("Azure Data Factory")
unstructured_data = Node("Logs Files and Media (Unstructured)")
structured_data = Node("Business and Custom Apps (Structured)")

with Cluster("Store") as store:
data_lake = DataLake("Data Lake")
with Group():
with Cluster("Ingest") as ingest:
data_factory = DataFactory("Azure Data Factory")

with Cluster("Store") as store:
data_lake = DataLake("Data Lake")

with Cluster("Prep and train") as train:
databricks = AzureDatabricks("Azure Databricks")

with Group():
with Cluster("Model") as model:
analysis_services = AnalysisService("Azure Analysis Services")
synapse_analytics = AzureSynapseAnalytics("Azure Synapse Analytics")

with Cluster("Serve") as serve:
power_bi = PowerBi("Power BI")

Edge([unstructured_data, structured_data], ingest)
Edge(ingest, store)
Edge(store, train)
Edge(store, model)
Edge(analysis_services, serve)
Edge(train, serve)
Edge(synapse_analytics, train, dir="both")
Edge(synapse_analytics, analysis_services, style="invis")
with Cluster("Model") as model:
analysis_services = AnalysisService("Azure Analysis Services")
synapse_analytics = AzureSynapseAnalytics("Azure Synapse Analytics")

with Cluster("Serve") as serve:
power_bi = PowerBi("Power BI")

Edge([unstructured_data, structured_data], data_factory)
Flow([data_factory, data_lake, databricks, power_bi])
Flow([data_lake, synapse_analytics, analysis_services, power_bi])
Edge(databricks, synapse_analytics, dir="both")
35 changes: 23 additions & 12 deletions tests/simple-test.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
from architectures.core import Graph, Cluster, Group, Node, Edge, Flow
from architectures.themes import Default, Clean

theme = Default(graph_attr_overrides={"splines": "ortho"})
from architectures.providers.azure.compute import VirtualMachine
from architectures.providers.azure.networking import ApplicationGateway
from architectures.providers.azure.generic import Azure
from architectures.providers.azure.management import Subscription

theme = Clean(graph_attr_overrides={"splines": "ortho"})

with Graph("my architecture", theme=theme, show=True):
with Cluster("Cluster A") as cluster_a:
a = Node("A")
b = Node("B")
c = Node("C")
with Cluster ("Cluster B") as cluster_b:
d = Node("D")
e = Node("E")
f = Node("F")
with Cluster("Cluster C") as cluster_c:
g = Node("G")
with Cluster("Azure") as azure:
azure = Azure("", width=".5", height=".5")
with Cluster("Subscription") as subscription:
subscription = Subscription("", width=".5", height=".5")
with Cluster("Resource Group") as resource_group:
pass
with Cluster("Virtual Network") as virtual_network_1:
pass
with Cluster("Build Subnet") as build_subnet:
with Group():
vm1 = VirtualMachine("Build Machine")
vm2 = VirtualMachine("Build Machine")
vm3 = VirtualMachine("Build Machine")

Flow([a, c, cluster_b, cluster_a, g, f, b], color="goldenrod")
with Cluster("Virtual Network 2") as virtual_network_2:
pass
with Cluster("Admin Subnet") as admin_subnet:
app_gateway = ApplicationGateway("test")

0 comments on commit cebceb2

Please sign in to comment.