Giter Site home page Giter Site logo

ismail2ov / excalidocker-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from etolbakov/excalidocker-rs

0.0 1.0 0.0 90.02 MB

Convert your docker-compose into excalidraw

License: MIT License

Shell 0.56% Rust 94.36% Makefile 4.65% Dockerfile 0.43%

excalidocker-rs's Introduction

excalidocker-rs

License โ˜ GitHub release (latest by date) Docker Pulls โ˜ Activity GitHub closed issues Maintenance

Rust-based utility to convert docker-compose.yaml files into excalidraw files. excalidocker

Key features

  • Transform your local docker-compose files into excalidraw with just a single docker run command. Showcase your infrastructure designs in a visually appealing and engaging format.
  • Convert external docker-compose files into excalidraw by simply providing a Github link. Easy to share and collaborate.
  • Available for installation on both Linux and MacOS platforms (amd64/arm64). Could be installed via ๐Ÿบ brew and ๐Ÿณ docker.
  • Design customization. Tailor your infrastructure diagrams to your specific needs by customizing alignment(vertical, horizontal, stepped), font, background colours, styles, etc.

Demo ๐ŸŽฅ

If a picture is worth a thousand words, then is a video worth a million?

excalidocker-demo

Usage examples could be found here.

Table of contents

Motivation

The idea of writing this utility originates from Robin Moffatt's tweet. motivation

Usage

Docker image

๐Ÿณ excalidocker is available as a Docker image. Convert docker-compose files without hassle. Use as a Github action step for documentation, presentations, ADRs what have you. The sky is the limit!

Convert a local file:

docker run --rm --pull always \
          -v "$(pwd)/data/compose/:/tmp/" \
          -e INPUT_PATH=/tmp/docker-compose.yaml \
          etolbakov/excalidocker:latest \
          > produced-by-image.excalidraw

Convert an external file:

docker run --rm --pull always \
           -e INPUT_PATH=https://github.com/apache/pinot/blob/master/docker/images/pinot/docker-compose.yml \
           etolbakov/excalidocker:latest \
           > produced-by-image-remote.excalidraw

The produced excalidraw file can be opened in excalidraw and .... hopefully it won't be too scary ๐Ÿ‘ป ๐Ÿ˜….

Convert a local file proving a config

The command below shows how to pass the config file for additional customization

 docker run --rm --pull always \
           -v "$(pwd)/data/compose/:/tmp/" \
           -v "$(pwd)/excalidocker-config.yaml:/tmp/excalidocker-config.yaml" \
           -e INPUT_PATH=/tmp/docker-compose.yaml \
           -e CONFIG_PATH=/tmp/excalidocker-config.yaml \
           etolbakov/excalidocker:latest \
           > produced-by-image-config-deps.excalidraw

More command examples could be found either in the Makefile or in the examples.

Brew

To install excalidocker with brew run the following command:

brew install etolbakov/taps/excalidocker

To uninstall:

brew uninstall etolbakov/taps/excalidocker

Binaries

๐Ÿ“š Download the latest pre-compiled binaries for your platform/architecture from releases and ungzip it.

OS=linux
ARCH=amd64
tar -xvzf excalidocker-${OS}-${ARCH}.tgz
chmod +x excalidocker
sudo mv excalidocker /usr/local/bin

To get the help menu use:

excalidocker -h

The output should be similar to:

Utility to convert docker-compose into excalidraw

Usage: 
excalidocker 0.1.8
    โ•ฐโ†’ excalidocker --input-path <INPUT_PATH>
    โ•ฐโ†’ excalidocker --show-config

Options:
  -C, --show-config                show configuration file
  -i, --input-path <INPUT_PATH>    file path to the docker-compose.yaml
  -s, --skip-dependencies          display connecting lines between services; if `true` then only service without the lines are rendered
  -N, --skip-network               display network(s); if `true` then network are not rendered
  -o, --output-path <OUTPUT_PATH>  file path for the output excalidraw file. By default the file content is sent to console output
  -c, --config-path <CONFIG_PATH>  config file path for the excalidraw [default: excalidocker-config.yaml]
  -h, --help                       Print help
  -V, --version                    Print version

Convert docker to excalidraw:

excalidocker --input-path /your/path/docker-compose.yaml --output-path /your/path/result.excalidraw

Create a configuration file for further customization:

excalidocker --show-config > sample-config.yaml

Warning

On the first launch the ungzipped artifact I saw the following pop up "Mac cannot be opened because it is from an unidentified developer" If you are fine with that you can Control-click the artifact, then choose Open from the shortcut menu. Click Open. The utility will be saved as an exception to your security settings, and you can open it in the future by double-clicking it just as you can any registered app.

mac-warning

Config file

๐ŸŽจ excalidocker supports basic customization provided via file, for example excalidocker-config.yaml. At the moment it's possible to customize:

  • alignment mode (stepped(default), vertical, horizontal)
  • font size and type
  • fill type (hachure, cross-hatch, solid)
  • background colours for services and ports. Both hex / colour names are supported.
  • edge type (sharp, round)
  • enable/disable connections (has the same effect as --skip-dependencies cli option)
  • enable/disable network (has the same effect as --skip-network cli option)

Installation

To build excalidocker locally, please follow these steps:

  1. Install Rust and Cargo if you haven't already. Refer to the official Rust documentation for installation instructions:
  2. Clone this repository:
git clone https://github.com/etolbakov/excalidocker-rs.git
  1. Build the project using Cargo:
cd excalidocker-rs && cargo build --release

There is the make r command available in the Makefile along with other useful command shortcuts.

Roadmap

These are the features that I would like to add at some point:

  • ๐Ÿ“Š visualize more data from a docker-compose file - volumes, etc.
  • ๐ŸŽฉ theoretically it's possible to compile the code for wasm target, so it makes sense creating a browser extension
  • ๐Ÿฆ€ various code improvements/enhancements. Feel free to review/suggest if anything could be done better!
  • ๐Ÿ‘จโ€๐Ÿ’ป etc

Contributing

Contributions are welcome! If you encounter any issues, have suggestions for improvements or would like to participate please open an issue or submit a pull request.

License

This project is licensed under the MIT License. Feel free to customize the text based on your project's specific details, such as repository URLs, installation instructions, and contribution guidelines.

excalidocker-rs's People

Contributors

etolbakov avatar rmoff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.