Commit Graph

13 Commits

Author SHA1 Message Date
SamYaple 34942d3aeb Revert "Add bare bones ekko-api"
This implementation of the API is no longer tested or supported. We
will be using a new one based on flask

This reverts commit a5f99317ac.

Change-Id: I7e1a3f0f341685b2455a4cdfeb0b13b7fba5bfc0
2016-06-15 20:44:51 +00:00
Paul Bourke a5f99317ac Add bare bones ekko-api
Foundation for ekko-api, ported over from the Ironic project.

The goal here was to copy enough to give a solid foundation that
conforms to the "OpenStack way", without a lot of extra frills that we
either may not need right away, or makes it harder see what's going on
starting out.

After installation the service can be started via 'ekko-api', which
listens on port 6800 by default. This was chosen from the list of
unassigned ports at
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt

There are still plenty of TODO's, primarily keystone integration and
config file generation. Foundations for these are here but completely
untested as of this commit.

Change-Id: If136a3bb66949ef710d741eaf3691f36f7b60692
2016-02-08 01:07:34 +00:00
SamYaple 622140b2ba Add base for compression and encryption
nopp, zlib and lzma compression implemented, but not configurable yet

noop encryption implemented

Change-Id: Id649974c3b0bb3852746fd7cdbf578768d7090c7
2016-01-20 23:23:24 +00:00
SamYaple fa9d060094 Rename backup to image
As per IRC conversation, backup should be image so it can mean backup
or restore since they will basically be inverses of each other.

Change-Id: Ic0d14cc7bfa9071bf45d70b0731e02c106b58277
2016-01-19 19:23:04 +00:00
SamYaple 2e389f1ddb Add storage code
This code will be the basis of writing out the data to the backing
storage with the initial driver being on disk storage.

Additionally move compression/encryption code to storage rather than
backup module

./backup.py --backup /dev/loop0 --manifest mani --location /path/to/store/backup/

Change-Id: I22d291ea3ac03b4d5ddb447915c972db4cdc195d
2016-01-19 19:14:23 +00:00
SamYaple 401c05413c Add initial backup code
Updates backup.py and adds dump_manifest.py that will print out all
hashes from the underlying blocks. This can be replicated with a
simple python script as follows:

    # dump_disk.py
    import hashlib
    with open('/dev/loop0', 'rb') as f:
        while True:
            data = f.read(4*1024**2)
            if not data:
                break
            print(hashlib.sha1(data).hexdigest())

    python dump_disk.py | grep -v 2bccbd2f38f15c13eb7d5a89fd9d85f595e23bc3

NOTE: 2bccbd2f38f15c13eb7d5a89fd9d85f595e23bc3 == segment of all zero

To perform backup and dump info from manifest (which will match
the output of the above script):

    tools/backup.py --backup /dev/loop0 --manifest mani
    tools/dump_manifest.py --manifest mani

The backup works on both files and block devices with the raw driver.
Further drivers will be implemented (such as qcow2 and rbd) as time
goes on.

Adjust sectors to equal number of bytes on size instead.

Change-Id: I976f02a27bc13b5774a6088799ca61f65ec04f14
2016-01-16 05:54:23 +00:00
SamYaple e2ee32ed82 stevedoreize the drivers
I don't expect these to be plugable, mostly just wrapping my head
around stevedores codebase.

Of note, because of the stevedore-ness, we _must_ install ekko to use
it. No longer will it work in the local dir, it must be installed on
the system (or in a venv)

Change-Id: I5037f6877e623614ef7ecf991b0009f49824ec0a
2016-01-13 21:31:25 +00:00
SamYaple 94bf4209b2 Add manifest read functions for sqlite
Change-Id: I73855f446316ddaf31a492c90a6d3b444d77683c
2016-01-11 18:15:17 +00:00
SamYaple 0f62c546d1 Adjust the way backupsets are stored in manifest
Upon debugging the difference between the storage with sqlite and OSDK
I discovered the biggest difference was the backupset_id storage.

Converting this back to my original design of a index reference has
brought the two formats within ~5% of each other in size! Additionally
this change creates a 40% reduction in the manifest size.

A 2^24 objects backup will now only take ~500MB instead of ~800MB

Now SQLite is still about 50% slower than OSDK, but since it is about
the same size the slowdown isn't even something worth mentioning. The
exact times are 55s of OSDK and 90s for sqlite at 2^24 objects.

Change-Id: If63380f312691e34c92f8a95fff5e724a4f5a465
2016-01-11 18:15:17 +00:00
SamYaple d31e2ebef5 Add OSDK driver for manifest
Now we can easily test performance and size differences between OSDK
and sqlite. The expectation here is we will use sqlite going forward,
but the extra validation for speed and size will be comforting.

Adds a new --driver option to generate_manifest.py to select between
osdk and sqlite

Change-Id: I59751080b3169d3d7bfd1f60a73edabe307d7fbf
2016-01-11 18:15:17 +00:00
Michal Jastrzebski a9d13fc32f Create manifest and implement sqlite driver
Use class inheritance for driver in case we need something other than
sqlite as time goes on.

SQLite is only 10% larger than the custom format used with osdk. When
compressed the SQLite manifest only fractionally larger than osdk. The
time it takes to generate and process is about 2x longer. However, the
benefit we get from using common contructs (sqlite) and tracking and
changing the manifest schema is enough for me to think this is right
way to proceed.

To generate a manifest with 2^24 objects (64TB disk) run:
tools/generate_manifest.py --backupsize 64000 --manifest /pathtosave/manifest

This will generate a 809MB file

Co-Authored-By: Sam Yaple <sam@yaple.net>
Change-Id: Ic431bfa52b6fcaeb1c6a64cf270cbb36c496335e
2016-01-11 18:15:17 +00:00
SamYaple 4795802efd Add manifest parser and generator
This reads the manifest. Its more based on osdk.py that I initially
thought it would be. But hopefully I have cleaned it up a good bit.

Add tool to generate manifest

To generate a manifest with 2^24 objects (64TB for 4MB objects) run:
tools/generate_manifest.py --backupsize 64000 --manifest /pathtosave/manifest

Change-Id: I09a8fb64c0d4b8e4b4b436cca44b57bec87116cd
2016-01-09 00:55:38 +00:00
SamYaple fdfb83197c Initial Commit
Change-Id: Iaa4726694388e24e944a37da52c851bba1ead1ce
2016-01-04 16:28:29 +00:00