Giter Club home page Giter Club logo

imsy's Introduction

imsy

overview

imsy shows the underlying principle of file replication mechanism suitable for large immutable files, such as VM images.

The core idea is to split a file in chunks using a Content Defined Chunking (CDC) mechanism, and save chunks in a Content Addressed Store (CAS), where each chunk is identified by its hash (e.g. SHA256)

The file can now be fully recovered by knowing the list of hashes of its constituent chunks, in order.

usage

First check out and run go build.

Then get hold of a couple of big files that are different but related, e.g. two VM images. Squashed uncompressed docker images would work too. Let's call them vm1.img and vm2.img.

Then run:

$ imsy -dir server1data prepare <vm1.img
72d21dabc5a57782eaad5745f968a58cd3f029c00897a4da5688e795256dac50

This will fill server1data with chunks of vm1.img.

Now, we want show how to pull this VM from another machine .

On the first machine, run:

$ imsy -dir server1data serve

On the second machine (it works also on the same machine via localhost):

$ imsy -dir server2data -o vm1.img pull 72d21dabc5a57782eaad5745f968a58cd3f029c00897a4da5688e795256dac50

Since server2data on the second machine is empty, this will basically just pull the whole image. It would have been cheaper to just serve the whole file via HTTP.

But now, on the first machine, you can run:

$ imsy -dir server2data prepare <vm2.img
ff62efe2d8f6c4a3b488fafe9ec9046dee5d2fab5b0a5488506bb3af766eacff

When you pull that image on the second machine, you'll notice that only a small number of chunks gets actually downloaded (look at the imsy serve log)

$ imsy -dir server2data pull 72d21dabc5a57782eaad5745f968a58cd3f029c00897a4da5688e795256dac50

imsy's People

Contributors

mkmik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.