diff --git a/README.md b/README.md index 9359b84..7cb4da5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **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. diff --git a/autogen.sh b/autogen.sh index 048ea87..41b79e0 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,23 +2,34 @@ app_root_dir="diagrams" # 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 echo 'round is not installed' + exit 1 fi if ! [ -x "$(command -v inkscape)" ]; then echo 'inkscape is not installed' + exit 1 +fi + +if ! [ -x "$(command -v convert)" ]; then + echo 'image magick is not installed' + exit 1 fi # preprocess the resources for pvd in "${providers[@]}"; do # convert the svg to png for azure provider 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" 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'" python -m scripts.resource clean "$pvd" # round the all png images for aws provider diff --git a/config.py b/config.py index 5474442..6c7296f 100644 --- a/config.py +++ b/config.py @@ -11,7 +11,7 @@ DIR_APP_ROOT = "diagrams" DIR_RESOURCE = "resources" DIR_TEMPLATE = "templates" -PROVIDERS = ("base", "aws", "azure", "gcp", "k8s", "alibabacloud") +PROVIDERS = ("base", "aws", "azure", "gcp", "k8s", "alibabacloud", "oci") ######################### # Resource Processing # @@ -21,6 +21,9 @@ CMD_ROUND = "round" CMD_ROUND_OPTS = ("-w",) CMD_SVG2PNG = "inkscape" 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 = { "aws": ("amazon-", "aws-"), @@ -28,6 +31,7 @@ FILE_PREFIXES = { "gcp": ("cloud-",), "k8s": (), "alibabacloud": (), + "oci": ("OCI-",), } ######################### @@ -49,7 +53,8 @@ UPPER_WORDS = { "k8s": ( "api", "cm", "ccm", "crb", "crd", "ds", "etcd", "hpa", "k8s", "ns", "psp", "pv", "pvc", "rb", "rs", "sa", "sc", "sts", "svc", - ) + ), + "oci": ("oci",), } TITLE_WORDS = { @@ -256,5 +261,11 @@ ALIASES = { "ObjectStorageService": "OSS", "ObjectTableStore": "OTS", } + }, + "oci": { + "compute": { + "Vm": "VirtualMachine", + "Bm": "BareMetal" + }, } } diff --git a/diagrams/oci/__init__.py b/diagrams/oci/__init__.py new file mode 100644 index 0000000..c1fc149 --- /dev/null +++ b/diagrams/oci/__init__.py @@ -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" \ No newline at end of file diff --git a/diagrams/oci/compute.py b/diagrams/oci/compute.py new file mode 100644 index 0000000..fb5101d --- /dev/null +++ b/diagrams/oci/compute.py @@ -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 diff --git a/diagrams/oci/connectivity.py b/diagrams/oci/connectivity.py new file mode 100644 index 0000000..1670243 --- /dev/null +++ b/diagrams/oci/connectivity.py @@ -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 diff --git a/diagrams/oci/database.py b/diagrams/oci/database.py new file mode 100644 index 0000000..c50ff04 --- /dev/null +++ b/diagrams/oci/database.py @@ -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 diff --git a/diagrams/oci/devops.py b/diagrams/oci/devops.py new file mode 100644 index 0000000..196662f --- /dev/null +++ b/diagrams/oci/devops.py @@ -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 diff --git a/diagrams/oci/edge.py b/diagrams/oci/edge.py new file mode 100644 index 0000000..872538a --- /dev/null +++ b/diagrams/oci/edge.py @@ -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 diff --git a/diagrams/oci/monitoring.py b/diagrams/oci/monitoring.py new file mode 100644 index 0000000..5331de3 --- /dev/null +++ b/diagrams/oci/monitoring.py @@ -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 diff --git a/diagrams/oci/network.py b/diagrams/oci/network.py new file mode 100644 index 0000000..bf81c80 --- /dev/null +++ b/diagrams/oci/network.py @@ -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 diff --git a/diagrams/oci/security.py b/diagrams/oci/security.py new file mode 100644 index 0000000..2e3a655 --- /dev/null +++ b/diagrams/oci/security.py @@ -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 diff --git a/diagrams/oci/storage.py b/diagrams/oci/storage.py new file mode 100644 index 0000000..d768c0a --- /dev/null +++ b/diagrams/oci/storage.py @@ -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 diff --git a/docs/guides/node.md b/docs/guides/node.md index d096765..3bd1182 100644 --- a/docs/guides/node.md +++ b/docs/guides/node.md @@ -49,6 +49,12 @@ from diagrams.gcp.ml import AutoML from diagrams.k8s.compute import Pod, StatefulSet from diagrams.k8s.network import Service 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). diff --git a/docs/nodes/oci.md b/docs/nodes/oci.md new file mode 100644 index 0000000..c44dbef --- /dev/null +++ b/docs/nodes/oci.md @@ -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** diff --git a/resources/oci/compute/bm.png b/resources/oci/compute/bm.png new file mode 100644 index 0000000..9473453 Binary files /dev/null and b/resources/oci/compute/bm.png differ diff --git a/resources/oci/compute/container.png b/resources/oci/compute/container.png new file mode 100644 index 0000000..6a514be Binary files /dev/null and b/resources/oci/compute/container.png differ diff --git a/resources/oci/compute/vm.png b/resources/oci/compute/vm.png new file mode 100644 index 0000000..a23171f Binary files /dev/null and b/resources/oci/compute/vm.png differ diff --git a/resources/oci/connectivity/backbone.png b/resources/oci/connectivity/backbone.png new file mode 100644 index 0000000..74afd4b Binary files /dev/null and b/resources/oci/connectivity/backbone.png differ diff --git a/resources/oci/connectivity/customerdatacenter.png b/resources/oci/connectivity/customerdatacenter.png new file mode 100644 index 0000000..c1698b6 Binary files /dev/null and b/resources/oci/connectivity/customerdatacenter.png differ diff --git a/resources/oci/connectivity/customerpremisesequip.png b/resources/oci/connectivity/customerpremisesequip.png new file mode 100644 index 0000000..a158e84 Binary files /dev/null and b/resources/oci/connectivity/customerpremisesequip.png differ diff --git a/resources/oci/connectivity/fastconnect.png b/resources/oci/connectivity/fastconnect.png new file mode 100644 index 0000000..f0fc37d Binary files /dev/null and b/resources/oci/connectivity/fastconnect.png differ diff --git a/resources/oci/connectivity/vpn.png b/resources/oci/connectivity/vpn.png new file mode 100644 index 0000000..09369f4 Binary files /dev/null and b/resources/oci/connectivity/vpn.png differ diff --git a/resources/oci/database/databaseservice.png b/resources/oci/database/databaseservice.png new file mode 100644 index 0000000..ff79d4a Binary files /dev/null and b/resources/oci/database/databaseservice.png differ diff --git a/resources/oci/devops/apiservice.png b/resources/oci/devops/apiservice.png new file mode 100644 index 0000000..dc242aa Binary files /dev/null and b/resources/oci/devops/apiservice.png differ diff --git a/resources/oci/devops/resourcemgmt.png b/resources/oci/devops/resourcemgmt.png new file mode 100644 index 0000000..a11ec5d Binary files /dev/null and b/resources/oci/devops/resourcemgmt.png differ diff --git a/resources/oci/edge/cdn.png b/resources/oci/edge/cdn.png new file mode 100644 index 0000000..64be384 Binary files /dev/null and b/resources/oci/edge/cdn.png differ diff --git a/resources/oci/edge/dns.png b/resources/oci/edge/dns.png new file mode 100644 index 0000000..55f77e6 Binary files /dev/null and b/resources/oci/edge/dns.png differ diff --git a/resources/oci/edge/emaildelivery.png b/resources/oci/edge/emaildelivery.png new file mode 100644 index 0000000..283b793 Binary files /dev/null and b/resources/oci/edge/emaildelivery.png differ diff --git a/resources/oci/edge/waf.png b/resources/oci/edge/waf.png new file mode 100644 index 0000000..6a1b371 Binary files /dev/null and b/resources/oci/edge/waf.png differ diff --git a/resources/oci/monitoring/alarm.png b/resources/oci/monitoring/alarm.png new file mode 100644 index 0000000..44a7f90 Binary files /dev/null and b/resources/oci/monitoring/alarm.png differ diff --git a/resources/oci/monitoring/event.png b/resources/oci/monitoring/event.png new file mode 100644 index 0000000..53007a7 Binary files /dev/null and b/resources/oci/monitoring/event.png differ diff --git a/resources/oci/monitoring/healthcheck.png b/resources/oci/monitoring/healthcheck.png new file mode 100644 index 0000000..b0ee3d8 Binary files /dev/null and b/resources/oci/monitoring/healthcheck.png differ diff --git a/resources/oci/monitoring/logging.png b/resources/oci/monitoring/logging.png new file mode 100644 index 0000000..04129a4 Binary files /dev/null and b/resources/oci/monitoring/logging.png differ diff --git a/resources/oci/monitoring/notifications.png b/resources/oci/monitoring/notifications.png new file mode 100644 index 0000000..a76c473 Binary files /dev/null and b/resources/oci/monitoring/notifications.png differ diff --git a/resources/oci/monitoring/queuing.png b/resources/oci/monitoring/queuing.png new file mode 100644 index 0000000..d2c3845 Binary files /dev/null and b/resources/oci/monitoring/queuing.png differ diff --git a/resources/oci/monitoring/search.png b/resources/oci/monitoring/search.png new file mode 100644 index 0000000..fbedb3b Binary files /dev/null and b/resources/oci/monitoring/search.png differ diff --git a/resources/oci/monitoring/streaming.png b/resources/oci/monitoring/streaming.png new file mode 100644 index 0000000..0851abc Binary files /dev/null and b/resources/oci/monitoring/streaming.png differ diff --git a/resources/oci/monitoring/telemetry.png b/resources/oci/monitoring/telemetry.png new file mode 100644 index 0000000..95ccb5e Binary files /dev/null and b/resources/oci/monitoring/telemetry.png differ diff --git a/resources/oci/monitoring/workflow.png b/resources/oci/monitoring/workflow.png new file mode 100644 index 0000000..ef1e49c Binary files /dev/null and b/resources/oci/monitoring/workflow.png differ diff --git a/resources/oci/network/drg.png b/resources/oci/network/drg.png new file mode 100644 index 0000000..3587e8a Binary files /dev/null and b/resources/oci/network/drg.png differ diff --git a/resources/oci/network/firewall.png b/resources/oci/network/firewall.png new file mode 100644 index 0000000..41b07b3 Binary files /dev/null and b/resources/oci/network/firewall.png differ diff --git a/resources/oci/network/internetgateway.png b/resources/oci/network/internetgateway.png new file mode 100644 index 0000000..d0e180b Binary files /dev/null and b/resources/oci/network/internetgateway.png differ diff --git a/resources/oci/network/loadbalance.png b/resources/oci/network/loadbalance.png new file mode 100644 index 0000000..f20b429 Binary files /dev/null and b/resources/oci/network/loadbalance.png differ diff --git a/resources/oci/network/routetable.png b/resources/oci/network/routetable.png new file mode 100644 index 0000000..3cad4a8 Binary files /dev/null and b/resources/oci/network/routetable.png differ diff --git a/resources/oci/network/securitylists.png b/resources/oci/network/securitylists.png new file mode 100644 index 0000000..fa38f2d Binary files /dev/null and b/resources/oci/network/securitylists.png differ diff --git a/resources/oci/network/service-gateway.png b/resources/oci/network/service-gateway.png new file mode 100644 index 0000000..49bf9d8 Binary files /dev/null and b/resources/oci/network/service-gateway.png differ diff --git a/resources/oci/network/vcloudnetwork.png b/resources/oci/network/vcloudnetwork.png new file mode 100644 index 0000000..071292c Binary files /dev/null and b/resources/oci/network/vcloudnetwork.png differ diff --git a/resources/oci/security/audit.png b/resources/oci/security/audit.png new file mode 100644 index 0000000..f5ee92b Binary files /dev/null and b/resources/oci/security/audit.png differ diff --git a/resources/oci/security/compartments.png b/resources/oci/security/compartments.png new file mode 100644 index 0000000..b76c30f Binary files /dev/null and b/resources/oci/security/compartments.png differ diff --git a/resources/oci/security/ddos.png b/resources/oci/security/ddos.png new file mode 100644 index 0000000..3f3891b Binary files /dev/null and b/resources/oci/security/ddos.png differ diff --git a/resources/oci/security/encryption.png b/resources/oci/security/encryption.png new file mode 100644 index 0000000..629b72c Binary files /dev/null and b/resources/oci/security/encryption.png differ diff --git a/resources/oci/security/groups.png b/resources/oci/security/groups.png new file mode 100644 index 0000000..c604dc3 Binary files /dev/null and b/resources/oci/security/groups.png differ diff --git a/resources/oci/security/id-access.png b/resources/oci/security/id-access.png new file mode 100644 index 0000000..8af39c5 Binary files /dev/null and b/resources/oci/security/id-access.png differ diff --git a/resources/oci/security/keymgmt.png b/resources/oci/security/keymgmt.png new file mode 100644 index 0000000..efdd2d1 Binary files /dev/null and b/resources/oci/security/keymgmt.png differ diff --git a/resources/oci/security/ocid.png b/resources/oci/security/ocid.png new file mode 100644 index 0000000..069f8ee Binary files /dev/null and b/resources/oci/security/ocid.png differ diff --git a/resources/oci/security/policies.png b/resources/oci/security/policies.png new file mode 100644 index 0000000..f526386 Binary files /dev/null and b/resources/oci/security/policies.png differ diff --git a/resources/oci/security/tagging.png b/resources/oci/security/tagging.png new file mode 100644 index 0000000..00d913a Binary files /dev/null and b/resources/oci/security/tagging.png differ diff --git a/resources/oci/storage/backuprestore.png b/resources/oci/storage/backuprestore.png new file mode 100644 index 0000000..9cf80ba Binary files /dev/null and b/resources/oci/storage/backuprestore.png differ diff --git a/resources/oci/storage/blockstorage.png b/resources/oci/storage/blockstorage.png new file mode 100644 index 0000000..367e9a4 Binary files /dev/null and b/resources/oci/storage/blockstorage.png differ diff --git a/resources/oci/storage/buckets.png b/resources/oci/storage/buckets.png new file mode 100644 index 0000000..d373739 Binary files /dev/null and b/resources/oci/storage/buckets.png differ diff --git a/resources/oci/storage/datatransfer.png b/resources/oci/storage/datatransfer.png new file mode 100644 index 0000000..bec7a83 Binary files /dev/null and b/resources/oci/storage/datatransfer.png differ diff --git a/resources/oci/storage/filestorage.png b/resources/oci/storage/filestorage.png new file mode 100644 index 0000000..e6637ec Binary files /dev/null and b/resources/oci/storage/filestorage.png differ diff --git a/resources/oci/storage/objectstorage.png b/resources/oci/storage/objectstorage.png new file mode 100644 index 0000000..581f3ae Binary files /dev/null and b/resources/oci/storage/objectstorage.png differ diff --git a/resources/oci/storage/storagegateway.png b/resources/oci/storage/storagegateway.png new file mode 100644 index 0000000..755caaf Binary files /dev/null and b/resources/oci/storage/storagegateway.png differ diff --git a/scripts/generate.py b/scripts/generate.py index 2f8522d..a593aa9 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -7,7 +7,7 @@ from jinja2 import Environment, FileSystemLoader, Template import config as cfg from . import app_root_dir, doc_root_dir, resource_dir, template_dir -_usage = "Usage: generate.py " +_usage = "Usage: generate.py " def load_tmpl(tmpl: str) -> Template: diff --git a/scripts/resource.py b/scripts/resource.py index b024c2a..aaa6763 100644 --- a/scripts/resource.py +++ b/scripts/resource.py @@ -65,12 +65,24 @@ def cleaner_alibabacloud(f): 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 = { "aws": cleaner_aws, "azure": cleaner_azure, "gcp": cleaner_gcp, "k8s": cleaner_k8s, "alibabacloud": cleaner_alibabacloud, + "oci": cleaner_oci, } @@ -114,11 +126,26 @@ def svg2png(pvd: str) -> None: [_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 commands = { "clean": clean_png, "round": round_png, "svg2png": svg2png, + "svg2png2": svg2png2, } # fmt: on diff --git a/website/i18n/en.json b/website/i18n/en.json index 6e3fe2c..93d6f69 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -34,6 +34,9 @@ }, "nodes/k8s": { "title": "K8S" + }, + "nodes/oci": { + "title": "Oracle Cloud" } }, "links": { diff --git a/website/pages/en/index.js b/website/pages/en/index.js index fa265af..b6a9477 100644 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -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. - 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`. );