onecommons / unfurl

A command line tool for deploying services and applications using git.
https://docs.unfurl.run
MIT License
98 stars 14 forks source link
ansible devops gitops infrastructure-as-code terraform tosca

PyPI version

Introduction

Unfurl is a command line tool for managing your DevOps infrastructure. Unfurl lets you easily track configuration, secrets, software and code dependencies, and deployment history all in git.

Unfurl can integrate with the DevOps tools you are already using -- like Terraform, Ansible, and Helm -- allowing you to encapsulate your DevOps processes into reusable building blocks and describe your cloud infrastructure in simple, application-centric terms.

Our Vision

The ultimate goal of Unfurl is enable anyone to clone, fork, and deploy live cloud services as easily as cloning and building code from git. So that we can have:

How it works

1. Use unfurl init to create an Unfurl-managed git repository. Or use unfurl clone to clone an existing one.

2. The repository will contain a few YAML files that you can edit. They will describe everything you'll need to deploy your application, such as:

3. Use unfurl deploy to deploy the infrastructure. Unfurl will generate a plan based on your target environment and high-level model and choose the correct operations to call. It will commit to git the latest configuration and a history of changes to your cloud accounts.

4. Now you have a reproducible description of your cloud infrastructure stored in git! So you can:

Features

No server, agentless

Simple, stand-alone CLI that can be used both in your local development environment or in an automated CI/CD pipeline.

Deploy infrastructure from simple, application-centric descriptions

Integrates with the DevOps tools you are already using

Developer-friendly state management

Zero installation

Flexible Secrets Management

"Day Two" Operations

Installation

unfurl is available on PyPI. You can install using pip (or pip3):

pip install unfurl

Running unfurl home --init creates a virtual Python environment to run unfurl in so by default unfurl only installs the minimal requirements needed to run the command line. If you want to run unfurl using your system Python install it with the "full" option:

pip install unfurl[full]

You can also install unfurl directly from this repository to get the latest code:

pip3 install "git+https://github.com/onecommons/unfurl.git#egg=unfurl"

Alternatively, you can use the Unfurl container on Docker Hub:

docker run --rm -it -v $(pwd):/data -w /data onecommons/unfurl:stable unfurl ...

The stable tag matches the version published to PyPi; latest is the latest code from the repository.

Requirements

Optional: Docker or Podman

Shell autocomplete

Use the table below to activate shell autocompletion for the unfurl:

Shell Instructions
Bash Add this to ~/.bashrc:
eval "$(_UNFURL_COMPLETE=bash_source unfurl)"
Zsh Add this to ~/.zshrc:
eval "$(_UNFURL_COMPLETE=zsh_source unfurl)"
Fish Add this to ~/.config/fish/completions/unfurl.fish:
eval (env _UNFURL_COMPLETE=fish_source unfurl)

Developing

git clone --recurse-submodules https://github.com/onecommons/unfurl

To build documentation: Run tox -e docs.

To build a distribution package run:

python setup.py sdist bdist_wheel

You can now install this package with pip, for example:

pip install ./dist/unfurl-0.2.2.dev3-py2.py3-none-any.whl

Running unit tests

You can use tox to run the unit tests inside the supported python environments with the latest source installed. Install tox pip install tox==3.28.0 and then run tox in source root. To install the dependencies you may need header files installed by the following OS packages: python-dev, libcrypt-dev, openssl-dev. (Note: if installation of a dependency fails, reinvoke tox with -r to recreate the test environment.) If you use asdf to manage multiple versions of Python, also install tox-asdf: pip install tox-asdf.

Arguments after -- are passed to the test runner, e.g. to run an individual test: tox -- tests/test_runtime.py.

Status and Caveats

Be mindful of these limitations:

Unfurl Cloud

The best way to manage your Unfurl project is to use Unfurl Cloud, our open-source platform for collaboratively developing cloud applications.

Get Started

Check out the rest of Unfurl's documentation here. Release notes can be found here.