Skip to main content

Fabric-based software provisioning tool

Project description

Carnival

Tests PyPI version PyPI Documentation Status

MIT

Software provisioning tool, built on top of Fabric

Also carnival contrib package available.

  • Runs on MacOs and Linux
  • Tested on Ubuntu and CentOS

Install

$ pip3 install carnival
$ pip3 install carnival_contrib  # Optional community receipts

Docs

Documentation available at readthedocs.org

Cli

Usage

$ carnival --help
Usage: carnival [OPTIONS] [deploy_frontend|deploy_backend]...

    Options:
    -d, --dry_run  Simulate run
    --debug        Turn on debug mode
    --help         Show this message and exit.

Competion

  • for Bash: place eval "$(_CARNIVAL_COMPLETE=source carnival)" in .bashrc
  • for ZSH: place eval "$(_CARNIVAL_COMPLETE=source_zsh carnival)" in .zshrc

Quick example

carnival_file.py - entry point for carnival cli

Lets create one.

from carnival import Step, Host, Task, cmd

class Deploy(Task):
    def run(self):
        self.step(
            DeployFrontend(),
            Host("1.2.3.5", ssh_user="root", can="context", additional="give"),
        )

        self.step(
            DeployFrontend(),
            [
                Host("root@1.2.3.6", can="give", additional="context"),
                Host("root@1.2.3.7", can="context", additional="give"),
            ]
        )


class DeployFrontend(Step):
    def run(self, can, additional, **kwargs):
        cmd.apt.install_multiple("htop", "nginx")
        cmd.systemd.enable("nginx", start_now=True)


class DeployBackend(Step):
    def run(self, can, additional, **kwargs):
        cmd.apt.install_multiple("htop")
        cmd.docker.install_ce_ubuntu()
        cmd.docker.install_compose()

Run

$  python3 -m carnival deploy
💃💃💃 Runing ⛏frontend at 🖥 1.2.3.4
...
💃💃💃 Runing ⛏frontend at 🖥 1.2.3.5
...

Develop

Run tests

$ make dev  # Run docker containers for testing
$ make test_deps  # Install test dependencies
$ make test  # run static analyzers and tests
$ make qs  # Run static analyzers only
$ make nodev  # Stop docker containers

Run carnival from dev env

$ python3 -m carnival --help

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

carnival-1.3.1.tar.gz (19.2 kB view details)

Uploaded Source

File details

Details for the file carnival-1.3.1.tar.gz.

File metadata

  • Download URL: carnival-1.3.1.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for carnival-1.3.1.tar.gz
Algorithm Hash digest
SHA256 b6636f228bb36a63152f8d8b06be11ecd90233c1d7b0918e0b53fbe2c3c7e634
MD5 d35dfed1f5e70921bf7f042f3da5fd47
BLAKE2b-256 48a86cec9a85edbfa97db92832a7b17ae082b28401da156bd5f86ba50b8d0ff8

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