Skip to content

Commit

Permalink
Merge pull request #93 from Jsoconno/hotfix-flow-attributes-not-set
Browse files Browse the repository at this point in the history
Flow Attribute Hotfix
  • Loading branch information
jsoconno authored Jan 27, 2021
2 parents 80328ac + 9f84621 commit e8aa6d6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
7 changes: 2 additions & 5 deletions architectures/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,8 @@ def __init__(self, objs: list[Union[Cluster, Node]], **attrs: Any) -> None:
if self._graph is None:
raise EnvironmentError("The object is not part of a Graph")

# Set edge attributes based on the theme using copy to ensure the objects are independent
self.edge_attrs = self._graph.theme.edge_attrs.copy()

# Override any attributes directly passed from the object
self.edge_attrs.update(attrs)
# Set edge attributes based on attributes directly passed from the object
self.edge_attrs = attrs

# Make sure there is more than one node
if self.obj_count > 1:
Expand Down
38 changes: 38 additions & 0 deletions examples/jenkins-server-on-azure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from architectures.core import Graph, Cluster, Group, Node, Edge, Flow
from architectures.themes import Default, LightMode

from architectures.providers.azure.general import Computer
from architectures.providers.azure.compute import VirtualMachineWindows
from architectures.providers.azure.storage import ManagedDiskStandardHdd, StorageAccountBlob
from architectures.providers.azure.security import KeyVault
from architectures.providers.azure.networking import NetworkSecurityGroupClassic, VirtualNetwork, VirtualSubnet
from architectures.providers.azure.management import AzureMonitor
from architectures.providers.azure.deployment import AzureRepo
from architectures.providers.azure.identity import AzureActiveDirectory

with Graph("Jenkins Server on Azure", theme=LightMode()):
with Cluster("Virtual Network") as virtual_network_cluster:
with Cluster("Subnet") as subnet_cluster:
NetworkSecurityGroupClassic("NSG", width=".7")
with Cluster("Scaled Agents") as scaled_agents_cluster:
vm1 = VirtualMachineWindows("Build VM")
vm2 = VirtualMachineWindows("Build VM")
vm3 = VirtualMachineWindows("Build VM")
agent_pool = [vm1, vm2, vm3]
with Group():
jenkins_server = VirtualMachineWindows("Jenkins Server")
computer = Computer()
active_directory = AzureActiveDirectory()
source_control = AzureRepo()
managed_discs = ManagedDiskStandardHdd()
monitor = AzureMonitor()
key_vault = KeyVault()
blob_storage = StorageAccountBlob()


Flow([computer, jenkins_server, [active_directory, managed_discs, scaled_agents_cluster, monitor]])
Edge(vm3, [key_vault, blob_storage], ltail=scaled_agents_cluster.name)
Edge(source_control, jenkins_server)
Flow([vm1, vm2, vm3], style="invis")


15 changes: 0 additions & 15 deletions examples/testing.py

This file was deleted.

0 comments on commit e8aa6d6

Please sign in to comment.