Skip to content

A Python library to manage jails with iocage

License

Notifications You must be signed in to change notification settings

joachimmathes/libiocage

 
 

Repository files navigation

libiocage

Average time to resolve an issue Percentage of issues still open Python Version GitHub issues GitHub forks GitHub stars Twitter

Python Library to manage FreeBSD jails with libiocage.

iocage is a jail/container manager amalgamating some of the best features and technologies the FreeBSD operating system has to offer. It is geared for ease of use with a simple and easy to understand command syntax.

This library provides programmatic access to iocage features and jails, while being compatible with iocage-legacy, and the current Python 3 version of iocage.

Install

from Source Distribution

pkg install python36 py36-pygit2 py36-libzfs libucl
python3.6 -m ensurepip
pip3.6 install iocage

from Master branch

git clone https://github.com/iocage/libiocage
cd libiocage
make install

Please note: this will build py-libzfs from source, which will require /usr/src to be populated.

Usage

Library

import iocage

jail = iocage.Jail()
jail.create("11.1-RELEASE")

CLI

Libiocage comes bundles with a CLI tool called ioc. It is inspired by the command line interface of iocage but meant to be developed along with the library and to spike on new features.

Custom Release (e.g. running -CURRENT)

Initially create release dataset

zfs create zroot/iocage/releases/custom/root
cd /usr/src
#install your source tree
make installworld DESTDIR=/iocage/releases/custom/root
make distribution DESTDIR=/iocage/releases/custom/root
ioc fetch -r custom -b

Update the installation after recompile

make installworld DESTDIR=/iocage/releases/custom/root
ioc fetch -r custom -b

Development

Install Development Dependencies

make install-dev

Unit Tests

Unit tests may run on FreeBSD or HardenedBSD and require an activated iocage pool.

pytest

Type Checking

At this time differential type checking is enabled, which allows us to incrementally cover the library with strong typings until we can switch to strict type checking.

setenv MYPYPATH `pwd`/.travis/mypy-stubs
mypy iocage/

Code Style

The code style is automatically checked with flake8.

About

A Python library to manage jails with iocage

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%