Skip to content

Commit

Permalink
Merge branch '537' into terraform-provider
Browse files Browse the repository at this point in the history
* 537: (33 commits)
  feat(provider): update OCI icons (mingrammer#537)
  docs: add IBM provider
  bump: up to version 0.20.0
  feat(provider): added diagrams for IBM Provider (mingrammer#525)
  fix(readme): link to the GitPitch Cloud Diagram Markdown Widget (mingrammer#504)
  feat(node): update Azure icons (mingrammer#448) (mingrammer#494)
  feat(node): add Onprem Gitea (mingrammer#478)
  docs(all): update to main replica (mingrammer#477)
  docs(readme): fix typo (mingrammer#496)
  docs(readme): fix GitPitch website link
  feat(dev/docker): update to use latest stable python 3 (mingrammer#476)
  fix: wrong type check and indentations
  chore(deps-dev): bump pylint from 2.4.4 to 2.7.0 (mingrammer#470)
  docs(node): fix wrong class names
  bump: up to version 0.19.1
  fix: wrong aliases and order
  bump: up to version 0.19.0
  docs(edges): update edges example code
  chore(deps): bump jinja2 from 2.11.1 to 2.11.3 (mingrammer#456)
  docs: add contributors badge
  ...
  • Loading branch information
haad committed May 12, 2022
2 parents 725ea85 + 22a7e63 commit 1413729
Show file tree
Hide file tree
Showing 826 changed files with 2,835 additions and 435 deletions.
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@
![python version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-blue?logo=python)
![Run tests](https://github.com/mingrammer/diagrams/workflows/Run%20tests/badge.svg?branch=master)
[![todos](https://badgen.net/https/api.tickgit.com/badgen/github.com/mingrammer/diagrams?label=todos)](https://www.tickgit.com/browse?repo=github.com/mingrammer/diagrams)

![on premise provider](https://img.shields.io/badge/provider-OnPremise-orange?color=5f87bf)
![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900)
![azure provider](https://img.shields.io/badge/provider-Azure-orange?logo=microsoft-azure&color=0089d6)
![gcp provider](https://img.shields.io/badge/provider-GCP-orange?logo=google-cloud&color=4285f4)
![kubernetes provider](https://img.shields.io/badge/provider-Kubernetes-orange?logo=kubernetes&color=326ce5)
![alibaba cloud provider](https://img.shields.io/badge/provider-AlibabaCloud-orange)
![oracle cloud provider](https://img.shields.io/badge/provider-OracleCloud-orange?logo=oracle&color=f80000)
![openstack provider](https://img.shields.io/badge/provider-OpenStack-orange?logo=openstack&color=da1a32)
![firebase provider](https://img.shields.io/badge/provider-Firebase-orange?logo=firebase&color=FFCA28)
![outscale provider](https://img.shields.io/badge/provider-OutScale-orange?color=5f87bf)
![elastic provider](https://img.shields.io/badge/provider-Elastic-orange?logo=elastic&color=005571)
![generic provider](https://img.shields.io/badge/provider-Generic-orange?color=5f87bf)
![programming provider](https://img.shields.io/badge/provider-Programming-orange?color=5f87bf)
![saas provider](https://img.shields.io/badge/provider-SaaS-orange?color=5f87bf)
![contributors](https://img.shields.io/github/contributors/mingrammer/diagrams)

<a href="https://www.buymeacoffee.com/mingrammer" 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>

Expand All @@ -33,6 +19,24 @@ Diagrams lets you draw the cloud system architecture **in Python code**. It was

> NOTE: It does not control any actual cloud resources nor does it generate cloud formation or terraform code. It is just for drawing the cloud system architecture diagrams.
## Providers

![aws provider](https://img.shields.io/badge/AWS-orange?logo=amazon-aws&color=ff9900)
![azure provider](https://img.shields.io/badge/Azure-orange?logo=microsoft-azure&color=0089d6)
![gcp provider](https://img.shields.io/badge/GCP-orange?logo=google-cloud&color=4285f4)
![ibm provider](https://img.shields.io/badge/IBM-orange?logo=ibm&color=052FAD)
![kubernetes provider](https://img.shields.io/badge/Kubernetes-orange?logo=kubernetes&color=326ce5)
![alibaba cloud provider](https://img.shields.io/badge/AlibabaCloud-orange)
![oracle cloud provider](https://img.shields.io/badge/OracleCloud-orange?logo=oracle&color=f80000)
![openstack provider](https://img.shields.io/badge/OpenStack-orange?logo=openstack&color=da1a32)
![firebase provider](https://img.shields.io/badge/Firebase-orange?logo=firebase&color=FFCA28)
![elastic provider](https://img.shields.io/badge/Elastic-orange?logo=elastic&color=005571)
![outscale provider](https://img.shields.io/badge/OutScale-orange?color=5f87bf)
![on premise provider](https://img.shields.io/badge/OnPremise-orange?color=5f87bf)
![generic provider](https://img.shields.io/badge/Generic-orange?color=5f87bf)
![programming provider](https://img.shields.io/badge/Programming-orange?color=5f87bf)
![saas provider](https://img.shields.io/badge/SaaS-orange?color=5f87bf)

## Getting Started

It requires **Python 3.6** or higher, check your Python version first.
Expand Down Expand Up @@ -70,11 +74,9 @@ To contribute to diagram, check out [contribution guidelines](CONTRIBUTING.md).
## Who uses it?

[![GitPitch](https://gitpitch.com/gpimg/logo.png)](https://gitpitch.com/)

[GitPitch](https://gitpitch.com/) is the perfect slide deck solution for Tech Conferences, Training, Developer Advocates, and Educators. Diagrams is now available as a dedicated [Cloud Diagram Markdown Widget](https://docs.gitpitch.com/#/diagrams/cloud-architecture) so you can use Diagrams directly on any slide for conferences, meetups, and training.
[GitPitch](https://gitpitch.github.io/gitpitch) is the perfect slide deck solution for Tech Conferences, Training, Developer Advocates, and Educators. Diagrams is now available as a dedicated [Cloud Diagram Markdown Widget](https://gitpitch.github.io/gitpitch/#/diagrams/cloud-architecture) so you can use Diagrams directly on any slide for conferences, meetups, and training.

[Cloudiscovery](https://github.com/Cloud-Architects/cloudiscovery) helps you to analyze resources in your cloud (AWS/GCP/Azure/Alibaba/IBM) account. It allows you to create a diagram of analyzed cloud resource map based on this Diagrams library, so you can draw the your existing cloud infrastructure with Cloudicovery.
[Cloudiscovery](https://github.com/Cloud-Architects/cloudiscovery) helps you to analyze resources in your cloud (AWS/GCP/Azure/Alibaba/IBM) account. It allows you to create a diagram of analyzed cloud resource map based on this Diagrams library, so you can draw your existing cloud infrastructure with Cloudiscovery.

[Airflow Diagrams](https://github.com/feluelle/airflow-diagrams) is an Airflow plugin that aims to easily visualise your Airflow DAGs on service level from providers like AWS, GCP, Azure, etc. via diagrams.

Expand Down
12 changes: 7 additions & 5 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e
app_root_dir="diagrams"

# NOTE: azure icon set is not latest version
providers=("onprem" "aws" "azure" "gcp" "firebase" "k8s" "alibabacloud" "oci" \
"programming" "saas" "elastic" "generic" "openstack" "outscale" \
"terraform")
providers=("onprem" "aws" "azure" "gcp" "ibm" "firebase" "k8s" "alibabacloud" "oci" "programming" "saas" "elastic" "generic" "openstack" "outscale" "terraform")

if ! [ -x "$(command -v round)" ]; then
echo 'round is not installed'
Expand All @@ -31,11 +29,11 @@ fi
# preprocess the resources
for pvd in "${providers[@]}"; do
# convert the svg to png for azure provider
if [ "$pvd" = "onprem" ] || [ "$pvd" = "azure" ]; then
if [ "$pvd" = "onprem" ] || [ "$pvd" = "azure" ] || [ "$pvd" == "oci" ]; then
echo "converting the svg to png using inkscape for provider '$pvd'"
python -m scripts.resource svg2png "$pvd"
fi
if [ "$pvd" == "oci" ]; then
if [ "$pvd" = "ibm" ]; then
echo "converting the svg to png using image magick for provider '$pvd'"
python -m scripts.resource svg2png2 "$pvd"
fi
Expand All @@ -54,6 +52,10 @@ for pvd in "${providers[@]}"; do
python -m scripts.generate "$pvd"
done

# Generate doc for custom module
echo "generating the docs for custom"
python -m scripts.generate "custom"

# run black
echo "linting the all the diagram modules"
black "$app_root_dir"/**/*.py
28 changes: 23 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
DIR_TEMPLATE = "templates"

PROVIDERS = (
"base", "onprem", "aws", "azure", "gcp", "firebase", "k8s", "alibabacloud", "oci", "programming", "saas", "elastic",
"base", "onprem", "aws", "azure", "gcp", "ibm", "firebase", "k8s", "alibabacloud", "oci", "programming", "saas", "elastic",
"generic", "openstack", "outscale", "terraform")

#########################
Expand All @@ -32,6 +32,7 @@
"azure": ("Azure-",),
"gcp": ("Cloud-",),
"firebase": ("Cloud-",),
"ibm": (),
"k8s": (),
"alibabacloud": (),
"oci": ("OCI-icon-",),
Expand Down Expand Up @@ -71,6 +72,7 @@
"outscale": ("osc",),
"openstack": ("rpm", "loci", "nfv", "ec2api"),
"pve": ("pve"),
"ibm": ("ibm"),
}

TITLE_WORDS = {
Expand All @@ -86,13 +88,19 @@
"openstack": {
"openstack": "OpenStack"
},
"ibm": {
"ibm": "IBMCloud"
},
}

KEEP_LOWER = ("terraform")

# TODO: check if the classname exists
ALIASES = {
"onprem": {
"analytics": {
"Powerbi": "PowerBI"
},
"ci": {
"Circleci": "CircleCI",
"Concourseci": "ConcourseCI",
Expand Down Expand Up @@ -163,6 +171,7 @@
},
"compute": {
"ApplicationAutoScaling": "AutoScaling",
"EC2Ami": "AMI",
"EC2ContainerRegistry": "ECR",
"ElasticBeanstalk": "EB",
"ElasticContainerService": "ECS",
Expand Down Expand Up @@ -215,6 +224,9 @@
"network": {
"CloudFront": "CF",
"ElasticLoadBalancing": "ELB",
"ElbApplicationLoadBalancer": "ALB",
"ElbClassicLoadBalancer": "CLB",
"ElbNetworkLoadBalancer": "NLB",
"GlobalAccelerator": "GAX",
},
"security": {
Expand Down Expand Up @@ -242,6 +254,7 @@
"compute": {
"ContainerRegistries": "ACR",
"KubernetesServices": "AKS",
"VMScaleSet": "VMSS"
},
},
"gcp": {
Expand Down Expand Up @@ -388,13 +401,16 @@
"OKEWhite": "ContainerEngineWhite",
},
"database": {
"AutonomousDatabase": "ADB",
"AutonomousDatabaseWhite": "ADBWhite",
"Databaseservice": "DBService",
"DatabaseserviceWhite": "DBServiceWhite",
"Autonomous": "ADB",
"AutonomousWhite": "ADBWhite",
"DatabaseService": "DBService",
"DatabaseServiceWhite": "DBServiceWhite",
}
},
"programming": {
"framework": {
"Fastapi": "FastAPI"
},
"language": {
"Javascript": "JavaScript",
"Nodejs": "NodeJS",
Expand All @@ -405,6 +421,7 @@
"saas": {
"logging": {
"Datadog": "DataDog",
"Newrelic": "NewRelic"
}
},
"elastic": {
Expand All @@ -415,6 +432,7 @@
"outscale": {
"Osc": "OSC",
},
"ibm": {},
"generic": {},
"openstack": {
"user": {
Expand Down
11 changes: 7 additions & 4 deletions diagrams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(
"""
self.name = name
if not name and not filename:
filename = "diagrams_image"
filename = "diagrams_image"
elif not filename:
filename = "_".join(self.name.split()).lower()
self.filename = filename
Expand Down Expand Up @@ -211,7 +211,10 @@ class Cluster:
# Cluster direction does not work now. Graphviz couldn't render
# correctly for a subgraph that has a different rank direction.
def __init__(
self, label: str = "cluster", direction: str = "LR", graph_attr: dict = {},
self,
label: str = "cluster",
direction: str = "LR",
graph_attr: dict = {},
):
"""Cluster represents a cluster context.
Expand Down Expand Up @@ -403,8 +406,8 @@ def connect(self, node: "Node", edge: "Edge"):
"""
if not isinstance(node, Node):
ValueError(f"{node} is not a valid Node")
if not isinstance(node, Edge):
ValueError(f"{node} is not a valid Edge")
if not isinstance(edge, Edge):
ValueError(f"{edge} is not a valid Edge")
# An edge must be added on the global diagrams, not a cluster.
self._diagram.connect(self, node, edge)
return node
Expand Down
20 changes: 20 additions & 0 deletions diagrams/aws/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Cloudsearch(_Analytics):
_icon = "cloudsearch.png"


class DataLakeResource(_Analytics):
_icon = "data-lake-resource.png"


class DataPipeline(_Analytics):
_icon = "data-pipeline.png"

Expand All @@ -36,6 +40,22 @@ class EMRCluster(_Analytics):
_icon = "emr-cluster.png"


class EMREngineMaprM3(_Analytics):
_icon = "emr-engine-mapr-m3.png"


class EMREngineMaprM5(_Analytics):
_icon = "emr-engine-mapr-m5.png"


class EMREngineMaprM7(_Analytics):
_icon = "emr-engine-mapr-m7.png"


class EMREngine(_Analytics):
_icon = "emr-engine.png"


class EMRHdfsCluster(_Analytics):
_icon = "emr-hdfs-cluster.png"

Expand Down
4 changes: 4 additions & 0 deletions diagrams/aws/ar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class _Ar(_AWS):
_icon_dir = "resources/aws/ar"


class ArVr(_Ar):
_icon = "ar-vr.png"


class Sumerian(_Ar):
_icon = "sumerian.png"

Expand Down
8 changes: 8 additions & 0 deletions diagrams/aws/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ class _Blockchain(_AWS):
_icon_dir = "resources/aws/blockchain"


class BlockchainResource(_Blockchain):
_icon = "blockchain-resource.png"


class Blockchain(_Blockchain):
_icon = "blockchain.png"


class ManagedBlockchain(_Blockchain):
_icon = "managed-blockchain.png"

Expand Down
4 changes: 4 additions & 0 deletions diagrams/aws/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class AlexaForBusiness(_Business):
_icon = "alexa-for-business.png"


class BusinessApplications(_Business):
_icon = "business-applications.png"


class Chime(_Business):
_icon = "chime.png"

Expand Down
Loading

0 comments on commit 1413729

Please sign in to comment.