Giter Site home page Giter Site logo

wagoodman / stacko-py Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 15 KB

A way to instantiate writable "instances" of immutable "image" layers similar to Docker images, but instead backed by OverlayFS and not coupled to a container solution.

Makefile 0.13% Python 99.87%
overlayfs python containers

stacko-py's Introduction

Code Issues

Stacko

This is a overlayFS manager that provides 'stacking' functionalities similar to Docker images, but not tied specifically to a container solution. With Stacko you can create immutable "images" which stack together. You can create one or more writable "instances" of a stack that have a thin Copy-On-Write layer. These instances are usable at a named "stackpoint", which always points to an instance. Eventually you can cutover a stackpoint to a new instance and fallback to a previous instance without copying or destroying files.

Note: this is a work in progress, so it is not stable or finished yet. This was a weekend project, which was successful! However, it appears there is a more promising alternative to Stacko named Siren: https://github.com/LEW21/siren .

Dependencies

This package requires the following packages to function:

Example

A working concept of how Stacko works:

# create and populate a new image 'foundation-libs0.1'
stacko new-image foundation-libs0.1
stacko edit-image foundation-libs0.1
   ...<head to the mount directory and add/edit contents>
stacko close-image foundation-libs0.1

# create another image 'apps-1.0' which "stacks" on image 'foundation-libs0.1'
stacko new-image apps-1.0 foundation-libs0.1
stacko edit-image apps-1.0
   ...<head to the mount directory and add/edit contents>
stacko close-image apps-1.0

# create a stackpoint named 'system1fs'. This automatically creates a new instance
# of the 'apps-1.0' image
stacko new-stackpoint system1fs apps-1.0

# mount the 'system1fs' for usage...
stacko mount-stackpoint system1fs

<reboot>
# This is all you need to do to use this stack again!
stacko mount-stackpoint system1fs

...

# Time to upgrade to another version of the application
stacko new-image apps-2.0 foundation-libs0.1
<populate it as before>...

# Use this new image as a new instance for the 'system1fs' stackpoint:
stacko cutover-stackpoint system1fs apps-2.0

# Oh no! something is wrong and you need to go back to the previous instance used
# (this includes all changes made in the CoW layer)
stacko fallback-stackpoint system1fs

Motivation

This came about when looking for a solution that provided the prescriptive-ness of a Docker image, something that can be stacked and referenced, but not written to. Though, using this solution implies that you will use Docker --the image/layer/storage solution is closely coupled to the container engine. This means that you need to run the Docker daemon to create images, even if you intend to export them for use with systemd-nspawn instead. Secondly, exporting the image merges all of the layers into a single directory! Though docker save keeps the layers in separate directories you are now closely tied to the Docker image format.

What I really wanted (right or wrong) was the ability to manage this concept of immutable "images" in layers, with the ability to fork off CoW instances on a whim, and do all of this without being tied to a particular container engine.

Usage

usage: stacko <command> [<args>]

Image commands:
    new-image     Create an image
    edit-image    Mount an image for editing
    close-image   Umount an image to stop editing
    delete-image
    list-images   Show the existing images
    import-image
    export-image

StackPoint commands:
    new-stackpoint
    delete-stackpoint
    cutover-stackpoint-instance:    unmount a current instance, create a new
        instance of the given image (if it does not already exist), set the
        current instance, and mount the new current instance

    fallback-stackpoint-instance:   unmount a current instance, set the
        current instance to the last known image instance, and mount the
        new current instance
    new-stackpoint-instance
    set-stackpoint-instance
    delete-stackpoint-instance
    mount-stackpoint
    umount-stackpoint
    get-stackpoint-dir
    is-stackpoint-mounted

stacko-py's People

Contributors

quantifiedcode-bot avatar wagoodman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pombredanne

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.