Skip to main content

Standardise and speed up application architecture design and deployments

Project description

Architecture as Code

Standardise and speed up application architecture and deployments

Architecture as Code is a Python package that allows you to standardise and speed up your application architecture design and deployments.

By populating a configuration file (in YAML format) that sets out each microservice in your application, you get 'three things for the price of one' - 1. automatically-generated docker run scripts, 2. automatically-generated Kubernetes deployment files, and 3. an automatically-generated architecture diagram.

Improve communication amongst your product team, make your devops folks happier, and shorten time-to-market!

architecture as code

Requirements

It requires Python 3.6 or higher, check your Python version first.

It uses Graphviz (via Diagrams) to render the diagram, so you first need to install Graphviz before using this package.

Installation

Using pip: pip install architecture-as-code

Usage

Create a file called config_main.yaml, with the following example of a web application architecture comprising a front-end microservice, middleware microservice, and database:

# Environment config
kind: EnvironmentDetails
environments:

  - name: prod
    image_registry: 192.168.1.1:5000
    default_host: 192.168.1.2

---

# Service config
kind: ServiceDetails
services:

  - name: webapp-react-front-end
    containers:
    - name: react
      port_mappings:
      - target: 3000
      environment_variables:
      - name: WEBAPP_DJANGO_SERVICE_SERVICE_HOST

  - name: webapp-django
    containers:
    - name: django
      port_mappings:
      - target: 8000
      environment_variables:
      - name: WEBAPP_DB_SERVICE_SERVICE_HOST

  - name: webapp-db
    containers:
    - name: postgres
      port_mappings:
      - target: 5432

Next, run the following code in Jupyter / Python. If you're not using Jupyter, omit the second and last lines.

from architecture_as_code import ArchitectureAsCode
from IPython.display import Image
prefix='WebApp'
aac = ArchitectureAsCode(prefix)
aac(config_main_file_name='config_main.yaml')
aac.generate_architecture_diagram()
Image(filename=prefix.lower() + '_architecture.png') 

You will then get three types of outputs:

  1. Docker run scripts for each microservice will be generated in the deployment_files/<environment name> folder.
  2. Kubernetes deployment files for each microservice will generated in the same folder above.
  3. An architecture diagram will be created in the file name webapp_architecture.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

architecture-as-code-0.0.14.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

architecture_as_code-0.0.14-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file architecture-as-code-0.0.14.tar.gz.

File metadata

  • Download URL: architecture-as-code-0.0.14.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for architecture-as-code-0.0.14.tar.gz
Algorithm Hash digest
SHA256 b88a382a1245a42ddfe03b08c8ac8881ab2547dea00cc9598b13f396f2438e2f
MD5 127cf631439b3cc09acfa2b783db5a12
BLAKE2b-256 5d86c15f13edffed36b131fb6e0187f9016d69185d34b12be30345abee6126b5

See more details on using hashes here.

File details

Details for the file architecture_as_code-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: architecture_as_code-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for architecture_as_code-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 b064f7ece0cea7705aa50a8ab3df24efd601364883ecf71603f5fbef83599815
MD5 19329a5dd2ddc23be7b2aa36cfbbb9fb
BLAKE2b-256 e3784210f74d48d38c9a1bf9b79d032ea96c2f8a9869e1390cd827baeb7fa336

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page