feat: add icon set for Oracle Cloud Services. (#20)

* Add Icon set for Oracle Cloud Services. Update scripts to handle the new provider

* feat: add alibaba cloud resources

* chore: delete unused script

* bump: up to version 0.4.0

* docs: add alibaba cloud

* chore: make a publish script executable

* docs: update menus for alibaba cloud

* Code cleanup per pull request feedback

* Add Oracle cloud to website and command line to generate the classes

* Add missing module script for OCI provider

Co-authored-by: Prodesire <Prodesire@yeah.net>
Co-authored-by: MinJae Kwon <mingrammer@gmail.com>
pull/25/head
McSly 6 years ago committed by GitHub
parent 842dfd24ce
commit a2b78fae04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@
**Diagram as Code**. **Diagram as Code**.
Diagrams lets you draw the cloud system architecture **in Python code**. It was born for **prototyping** a new system architecture design without any design tools. You can also describe or visualize the existing system architecture as well. Diagrams currently supports five major providers: `AWS`, `Azure`, `GCP`, `Kubernetes` and `Alibaba Cloud`. Diagrams lets you draw the cloud system architecture **in Python code**. It was born for **prototyping** a new system architecture design without any design tools. You can also describe or visualize the existing system architecture as well. Diagrams currently supports six major providers: `AWS`, `Azure`, `GCP`, `Kubernetes`, `Alibaba Cloud` and `Oracle Cloud`.
**Diagram as Code** also allows you to **tracking** the architecture diagram changes on any **version control** system. **Diagram as Code** also allows you to **tracking** the architecture diagram changes on any **version control** system.

@ -2,23 +2,34 @@
app_root_dir="diagrams" app_root_dir="diagrams"
# NOTE: azure icon set is not latest version # NOTE: azure icon set is not latest version
providers=("aws" "azure" "gcp" "k8s" "alibabacloud") providers=("aws" "azure" "gcp" "k8s" "alibabacloud" "oci")
if ! [ -x "$(command -v round)" ]; then if ! [ -x "$(command -v round)" ]; then
echo 'round is not installed' echo 'round is not installed'
exit 1
fi fi
if ! [ -x "$(command -v inkscape)" ]; then if ! [ -x "$(command -v inkscape)" ]; then
echo 'inkscape is not installed' echo 'inkscape is not installed'
exit 1
fi
if ! [ -x "$(command -v convert)" ]; then
echo 'image magick is not installed'
exit 1
fi fi
# preprocess the resources # preprocess the resources
for pvd in "${providers[@]}"; do for pvd in "${providers[@]}"; do
# convert the svg to png for azure provider # convert the svg to png for azure provider
if [ "$pvd" = "azure" ]; then if [ "$pvd" = "azure" ]; then
echo "converting the svg to png for provider '$pvd'" echo "converting the svg to png using inkscape for provider '$pvd'"
python -m scripts.resource svg2png "$pvd" python -m scripts.resource svg2png "$pvd"
fi fi
if [ "$pvd" == "oci" ]; then
echo "converting the svg to png using image magick for provider '$pvd'"
python -m scripts.resource svg2png2 "$pvd"
fi
echo "cleaning the resource names for provider '$pvd'" echo "cleaning the resource names for provider '$pvd'"
python -m scripts.resource clean "$pvd" python -m scripts.resource clean "$pvd"
# round the all png images for aws provider # round the all png images for aws provider

@ -11,7 +11,7 @@ DIR_APP_ROOT = "diagrams"
DIR_RESOURCE = "resources" DIR_RESOURCE = "resources"
DIR_TEMPLATE = "templates" DIR_TEMPLATE = "templates"
PROVIDERS = ("base", "aws", "azure", "gcp", "k8s", "alibabacloud") PROVIDERS = ("base", "aws", "azure", "gcp", "k8s", "alibabacloud", "oci")
######################### #########################
# Resource Processing # # Resource Processing #
@ -21,6 +21,9 @@ CMD_ROUND = "round"
CMD_ROUND_OPTS = ("-w",) CMD_ROUND_OPTS = ("-w",)
CMD_SVG2PNG = "inkscape" CMD_SVG2PNG = "inkscape"
CMD_SVG2PNG_OPTS = ("-z", "-w", "256", "-h", "256", "--export-type", "png") CMD_SVG2PNG_OPTS = ("-z", "-w", "256", "-h", "256", "--export-type", "png")
CMD_SVG2PNG_IM = "convert"
CMD_SVG2PNG_IM_OPTS = ("-shave", "25%x25%", "-resize", "256x256!")
FILE_PREFIXES = { FILE_PREFIXES = {
"aws": ("amazon-", "aws-"), "aws": ("amazon-", "aws-"),
@ -28,6 +31,7 @@ FILE_PREFIXES = {
"gcp": ("cloud-",), "gcp": ("cloud-",),
"k8s": (), "k8s": (),
"alibabacloud": (), "alibabacloud": (),
"oci": ("OCI-",),
} }
######################### #########################
@ -49,7 +53,8 @@ UPPER_WORDS = {
"k8s": ( "k8s": (
"api", "cm", "ccm", "crb", "crd", "ds", "etcd", "hpa", "k8s", "ns", "psp", "pv", "pvc", "rb", "rs", "api", "cm", "ccm", "crb", "crd", "ds", "etcd", "hpa", "k8s", "ns", "psp", "pv", "pvc", "rb", "rs",
"sa", "sc", "sts", "svc", "sa", "sc", "sts", "svc",
) ),
"oci": ("oci",),
} }
TITLE_WORDS = { TITLE_WORDS = {
@ -256,5 +261,11 @@ ALIASES = {
"ObjectStorageService": "OSS", "ObjectStorageService": "OSS",
"ObjectTableStore": "OTS", "ObjectTableStore": "OTS",
} }
},
"oci": {
"compute": {
"Vm": "VirtualMachine",
"Bm": "BareMetal"
},
} }
} }

@ -0,0 +1,12 @@
"""
OCI provides a set of services for Oracle Cloud provider.
"""
from diagrams import Node
class _OCI(Node):
_provider = "oci"
_icon_dir = "resources/oci"
fontcolor = "#2d3436"

@ -0,0 +1,26 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Compute(_OCI):
_type = "compute"
_icon_dir = "resources/oci/compute"
class Bm(_Compute):
_icon = "bm.png"
class Container(_Compute):
_icon = "container.png"
class Vm(_Compute):
_icon = "vm.png"
# Aliases
VirtualMachine = Vm
BareMetal = Bm

@ -0,0 +1,31 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Connectivity(_OCI):
_type = "connectivity"
_icon_dir = "resources/oci/connectivity"
class Backbone(_Connectivity):
_icon = "backbone.png"
class Customerdatacenter(_Connectivity):
_icon = "customerdatacenter.png"
class Customerpremisesequip(_Connectivity):
_icon = "customerpremisesequip.png"
class Fastconnect(_Connectivity):
_icon = "fastconnect.png"
class Vpn(_Connectivity):
_icon = "vpn.png"
# Aliases

@ -0,0 +1,15 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Database(_OCI):
_type = "database"
_icon_dir = "resources/oci/database"
class Databaseservice(_Database):
_icon = "databaseservice.png"
# Aliases

@ -0,0 +1,19 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Devops(_OCI):
_type = "devops"
_icon_dir = "resources/oci/devops"
class Apiservice(_Devops):
_icon = "apiservice.png"
class Resourcemgmt(_Devops):
_icon = "resourcemgmt.png"
# Aliases

@ -0,0 +1,27 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Edge(_OCI):
_type = "edge"
_icon_dir = "resources/oci/edge"
class Cdn(_Edge):
_icon = "cdn.png"
class Dns(_Edge):
_icon = "dns.png"
class Emaildelivery(_Edge):
_icon = "emaildelivery.png"
class Waf(_Edge):
_icon = "waf.png"
# Aliases

@ -0,0 +1,51 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Monitoring(_OCI):
_type = "monitoring"
_icon_dir = "resources/oci/monitoring"
class Alarm(_Monitoring):
_icon = "alarm.png"
class Event(_Monitoring):
_icon = "event.png"
class Healthcheck(_Monitoring):
_icon = "healthcheck.png"
class Logging(_Monitoring):
_icon = "logging.png"
class Notifications(_Monitoring):
_icon = "notifications.png"
class Queuing(_Monitoring):
_icon = "queuing.png"
class Search(_Monitoring):
_icon = "search.png"
class Streaming(_Monitoring):
_icon = "streaming.png"
class Telemetry(_Monitoring):
_icon = "telemetry.png"
class Workflow(_Monitoring):
_icon = "workflow.png"
# Aliases

@ -0,0 +1,43 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Network(_OCI):
_type = "network"
_icon_dir = "resources/oci/network"
class Drg(_Network):
_icon = "drg.png"
class Firewall(_Network):
_icon = "firewall.png"
class Internetgateway(_Network):
_icon = "internetgateway.png"
class Loadbalance(_Network):
_icon = "loadbalance.png"
class Routetable(_Network):
_icon = "routetable.png"
class Securitylists(_Network):
_icon = "securitylists.png"
class ServiceGateway(_Network):
_icon = "service-gateway.png"
class Vcloudnetwork(_Network):
_icon = "vcloudnetwork.png"
# Aliases

@ -0,0 +1,51 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Security(_OCI):
_type = "security"
_icon_dir = "resources/oci/security"
class Audit(_Security):
_icon = "audit.png"
class Compartments(_Security):
_icon = "compartments.png"
class Ddos(_Security):
_icon = "ddos.png"
class Encryption(_Security):
_icon = "encryption.png"
class Groups(_Security):
_icon = "groups.png"
class IdAccess(_Security):
_icon = "id-access.png"
class Keymgmt(_Security):
_icon = "keymgmt.png"
class Ocid(_Security):
_icon = "ocid.png"
class Policies(_Security):
_icon = "policies.png"
class Tagging(_Security):
_icon = "tagging.png"
# Aliases

@ -0,0 +1,39 @@
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OCI
class _Storage(_OCI):
_type = "storage"
_icon_dir = "resources/oci/storage"
class Backuprestore(_Storage):
_icon = "backuprestore.png"
class Blockstorage(_Storage):
_icon = "blockstorage.png"
class Buckets(_Storage):
_icon = "buckets.png"
class Datatransfer(_Storage):
_icon = "datatransfer.png"
class Filestorage(_Storage):
_icon = "filestorage.png"
class Objectstorage(_Storage):
_icon = "objectstorage.png"
class Storagegateway(_Storage):
_icon = "storagegateway.png"
# Aliases

@ -49,6 +49,12 @@ from diagrams.gcp.ml import AutoML
from diagrams.k8s.compute import Pod, StatefulSet from diagrams.k8s.compute import Pod, StatefulSet
from diagrams.k8s.network import Service from diagrams.k8s.network import Service
from diagrams.k8s.storage import PV, PVC, StorageClass from diagrams.k8s.storage import PV, PVC, StorageClass
...
# oracle resources
from diagrams.oci.compute import VirtualMachine, Container
from diagrams.oci.network import Firewall
from diagrams.oci.storage import Filestorage, Storagegateway
``` ```
You can find all available nodes list in [Here](https://diagrams.mingrammer.com/docs/nodes/aws). You can find all available nodes list in [Here](https://diagrams.mingrammer.com/docs/nodes/aws).

@ -0,0 +1,83 @@
---
id: oci
title: OCI
---
Node classes list of oci provider.
## oci.compute
- **diagrams.oci.compute.Bm**, **BareMetal** (alias)
- **diagrams.oci.compute.Container**
- **diagrams.oci.compute.Vm**, **VirtualMachine** (alias)
## oci.connectivity
- **diagrams.oci.connectivity.Backbone**
- **diagrams.oci.connectivity.Customerdatacenter**
- **diagrams.oci.connectivity.Customerpremisesequip**
- **diagrams.oci.connectivity.Fastconnect**
- **diagrams.oci.connectivity.Vpn**
## oci.database
- **diagrams.oci.database.Databaseservice**
## oci.devops
- **diagrams.oci.devops.Apiservice**
- **diagrams.oci.devops.Resourcemgmt**
## oci.edge
- **diagrams.oci.edge.Cdn**
- **diagrams.oci.edge.Dns**
- **diagrams.oci.edge.Emaildelivery**
- **diagrams.oci.edge.Waf**
## oci.monitoring
- **diagrams.oci.monitoring.Alarm**
- **diagrams.oci.monitoring.Event**
- **diagrams.oci.monitoring.Healthcheck**
- **diagrams.oci.monitoring.Logging**
- **diagrams.oci.monitoring.Notifications**
- **diagrams.oci.monitoring.Queuing**
- **diagrams.oci.monitoring.Search**
- **diagrams.oci.monitoring.Streaming**
- **diagrams.oci.monitoring.Telemetry**
- **diagrams.oci.monitoring.Workflow**
## oci.network
- **diagrams.oci.network.Drg**
- **diagrams.oci.network.Firewall**
- **diagrams.oci.network.Internetgateway**
- **diagrams.oci.network.Loadbalance**
- **diagrams.oci.network.Routetable**
- **diagrams.oci.network.Securitylists**
- **diagrams.oci.network.ServiceGateway**
- **diagrams.oci.network.Vcloudnetwork**
## oci.security
- **diagrams.oci.security.Audit**
- **diagrams.oci.security.Compartments**
- **diagrams.oci.security.Ddos**
- **diagrams.oci.security.Encryption**
- **diagrams.oci.security.Groups**
- **diagrams.oci.security.IdAccess**
- **diagrams.oci.security.Keymgmt**
- **diagrams.oci.security.Ocid**
- **diagrams.oci.security.Policies**
- **diagrams.oci.security.Tagging**
## oci.storage
- **diagrams.oci.storage.Backuprestore**
- **diagrams.oci.storage.Blockstorage**
- **diagrams.oci.storage.Buckets**
- **diagrams.oci.storage.Datatransfer**
- **diagrams.oci.storage.Filestorage**
- **diagrams.oci.storage.Objectstorage**
- **diagrams.oci.storage.Storagegateway**

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

@ -7,7 +7,7 @@ from jinja2 import Environment, FileSystemLoader, Template
import config as cfg import config as cfg
from . import app_root_dir, doc_root_dir, resource_dir, template_dir from . import app_root_dir, doc_root_dir, resource_dir, template_dir
_usage = "Usage: generate.py <aws|gcp|azure|alibabacloud>" _usage = "Usage: generate.py <aws|gcp|azure|k8s|alibabacloud|oci>"
def load_tmpl(tmpl: str) -> Template: def load_tmpl(tmpl: str) -> Template:

@ -65,12 +65,24 @@ def cleaner_alibabacloud(f):
return f.lower() return f.lower()
def cleaner_oci(f):
f = f.replace("_", "-")
f = f.replace("-grey", "")
for p in cfg.FILE_PREFIXES["oci"]:
if f.startswith(p):
f = f[len(p) :]
break
return f.lower()
cleaners = { cleaners = {
"aws": cleaner_aws, "aws": cleaner_aws,
"azure": cleaner_azure, "azure": cleaner_azure,
"gcp": cleaner_gcp, "gcp": cleaner_gcp,
"k8s": cleaner_k8s, "k8s": cleaner_k8s,
"alibabacloud": cleaner_alibabacloud, "alibabacloud": cleaner_alibabacloud,
"oci": cleaner_oci,
} }
@ -114,11 +126,26 @@ def svg2png(pvd: str) -> None:
[_convert(root, path) for path in svgs] [_convert(root, path) for path in svgs]
def svg2png2(pvd: str) -> None:
"""Convert the svg into png using image magick"""
def _convert(base: str, path: str):
path_src = os.path.join(base, path)
path_dest = path_src.replace(".svg", ".png")
subprocess.call([cfg.CMD_SVG2PNG_IM, *cfg.CMD_SVG2PNG_IM_OPTS, path_src, path_dest])
subprocess.call(['rm', path_src])
for root, _, files in os.walk(resource_dir(pvd)):
svgs = filter(lambda f: f.endswith(".svg"), files)
[_convert(root, path) for path in svgs]
# fmt: off # fmt: off
commands = { commands = {
"clean": clean_png, "clean": clean_png,
"round": round_png, "round": round_png,
"svg2png": svg2png, "svg2png": svg2png,
"svg2png2": svg2png2,
} }
# fmt: on # fmt: on

@ -34,6 +34,9 @@
}, },
"nodes/k8s": { "nodes/k8s": {
"title": "K8S" "title": "K8S"
},
"nodes/oci": {
"title": "Oracle Cloud"
} }
}, },
"links": { "links": {

@ -106,7 +106,7 @@ class Index extends React.Component {
`Diagram as Code` allows you to **tracking** the architecture diagram changes on any **version control** system. `Diagram as Code` allows you to **tracking** the architecture diagram changes on any **version control** system.
</MarkdownBlock> </MarkdownBlock>
<MarkdownBlock> <MarkdownBlock>
Diagrams currently supports four major providers: `AWS`, `Azure`, `GCP`, `Kubernetes` and `Alibaba Cloud`. Diagrams currently supports four major providers: `AWS`, `Azure`, `GCP`, `Kubernetes`, `Alibaba Cloud` and `Oracle Cloud`.
</MarkdownBlock> </MarkdownBlock>
</div> </div>
); );

Loading…
Cancel
Save