Skip to main content

No project description provided

Project description

Incant

PyPI version

Incant is a frontend for Incus that provides a declarative way to define and manage development environments. It simplifies the creation, configuration, and provisioning of Incus instances using YAML-based configuration files.

Features

  • Declarative Configuration: Define your development environments using simple YAML files.
  • Provisioning Support: Declare and run provisioning scripts automatically.
  • Shared Folder Support: Mount the current working directory into the instance.

Installation

Ensure you have Python installed and incus available on your system.

You can install Incant from PyPI:

pipx install incus-incant

Or install directly from Git:

pipx install git+https://github.com/lnussbaum/incant.git

Usage

Configure Incant

Incant looks for a configuration file named incant.yaml, incant.yaml.j2, or incant.yaml.mako in the current directory. Here is an example:

instances:
  my-instance:
    image: images:debian/12
    vm: false # use a container, not a KVM virtual machine
    provision:
      - echo "Hello, World!"
      - apt-get update && apt-get install -y curl

You can also ask Incant to create an example in the current directory:

$ incant init

Initialize and Start an Instance

$ incant up

or for a specific instance:

$ incant up my-instance

Provision again an Instance that was already started previously

$ incant provision

or for a specific instance:

$ incant provision my-instance

Use your Instances

Use Incus commands to interact with your instances:

$ incus exec ubuntu-container -- apt-get update
$ incus shell my-instance
$ incus console my-instance
$ incus file edit my-container/etc/hosts
$ incus file delete <instance_name>/<path_to_file>

Your instance's services are directly reachable on the network. They should be discoverable in DNS if the instance supports LLMNR or mDNS.

Destroy an Instance

$ incant destroy

or for a specific instance:

$ incant destroy my-instance

View Configuration (especially useful if you use Mako or Jinja2 templates)

$ incant dump

Incant compared to Vagrant

Incant is inspired by Vagrant, and intended as an Incus-based replacement for Vagrant.

The main differences between Incant and Vagrant are:

  • Incant is Free Software (licensed under the Apache 2.0 license). Vagrant is licensed under the non-Open-Source Business Source License.
  • Incant is only a frontend for Incus, which supports containers (LXC-based) and virtual machines (KVM-based) on Linux. It will not attempt to be a more generic frontend for other virtualization providers. Thus, Incant only works on Linux.

Some technical differences are useful to keep in mind when migrating from Vagrant to Incant.

  • Incant is intended as a thin layer on top of Incus, and focuses on provisioning. Once the provisioning has been performed by Incant, you need to use Incus commands such as incus shell to work with your instances.
  • Incant shares the current directory as /incant inside the instance (compared to Vagrant's sharing of /vagrant). Incant tries to share the current directory read-write (using Incus' shift=true) but this fails in some cases, such as restricted containers. So there are chances that the directory will only be shared read-only.
  • Incant does not create a user account inside the instance -- you need to use the root account, or create a user account during provisioning (for example, with adduser --disabled-password --gecos "" incant)
  • Incant uses a YAML-based description format for instances. Mako or Jinja2 templates can be used to those YAML configuration files if you need more complex processing, similar to what is available in Vagrantfiles (see the examples/ directory).

Incant compared to other projects

There are several other projects addressing similar problem spaces. They are shortly described here so that you can determine if Incant is the right tool for you.

  • lxops and blincus manage the provisioning of Incus instances using a declarative configuration format, but the provisioning actions are described using cloud-init configuration files. lxops uses cloudconfig to apply them, while blincus requires cloud instances that include cloud-init. In contrast, using Incant does not require knowing about cloud-init or fitting into cloud-init's formalism.
  • terraform-provider-incus is a Terraform or OpenTofu provider for Incus. Incant uses a more basic scheme for provisioning, and does not require knowing about Terraform or fitting into Terraform's formalism.
  • cluster-api-provider-lxc (CAPL) is an infrastructure provider for Kubernetes' Cluster API, which enables deploying Kubernetes clusters on Incus. Incant focuses on the more general use case of provisioning system containers or virtual machines outside of the Kubernetes world.
  • devenv is a Nix-based development environment manager. It also uses a declarative file format. It goes further than Incant by including the definition of development tasks. It also covers defining services that run inside the environment, and generating OCI containers to deploy the environment to production. Incant focuses on providing the environment based on classical Linux distributions and tools.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

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

incus_incant-0.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

incus_incant-0.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file incus_incant-0.1.tar.gz.

File metadata

  • Download URL: incus_incant-0.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.2 Linux/6.12.12+bpo-amd64

File hashes

Hashes for incus_incant-0.1.tar.gz
Algorithm Hash digest
SHA256 a6dc362708ea2503a0ed403c27c6a9ec06ffc2a5f22c6b8f65ffa44cd185f63d
MD5 f81af88fd9a5961c634e10b8654c12cb
BLAKE2b-256 f7b819ff637b76a539f31fe374e66431280eb15d774e8ae50cb871f4b0e1656a

See more details on using hashes here.

File details

Details for the file incus_incant-0.1-py3-none-any.whl.

File metadata

  • Download URL: incus_incant-0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.2 Linux/6.12.12+bpo-amd64

File hashes

Hashes for incus_incant-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf4a87ba3edbcd51b87b0ab550de9551b6950242ed55929e410f0a2d323088b9
MD5 1771902f4179af49a4be42e67926e8a5
BLAKE2b-256 9f832a6ba1a2455db2a1255d7e01afb1c8707eb54a1232a42f2d487da0d50b45

See more details on using hashes here.

Supported by

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