Giter VIP home page Giter VIP logo

cacus's Introduction

Κάκος

Distributed, fault-tolerant and fast Debian repository with REST API and pluggable storage modules.

Idea:

Managing the huge and highloaded (for read and write) debian repo can be a tricky job - existing solutions like reprepro could be slow in refreshing repo indices and barely suitable for horizontal scaling.

Cacus is designed as scalable, high-load and high-availability debian repo fully compatible with official Debian repository layout, relying on MongoDB and various pluggable cloud storage engines and can be easily installed and used on multiple instances behind any kind of load balancing.

Moreover, Cacus features REST API that can be used to integrate it with CI/CD systems

Installation:

Get the code, then either run python setup.py install to install it locally or use docker build to create Docker image. Dependencies:

  • pymongo
  • motor
  • tornado
  • pyinotify
  • requests
  • gnupg
  • yapsy
  • concurrent.futures
  • python-debian (>= 0.1.22 for .xz compression support in .deb)

NOTE: on some crippled platforms, like Debian Jessie, you probably will need to manually install azure libs in order to use AzureStorage plugin: sudo pip install --upgrade azure-common azure-storage (this is probably due to Azure/azure-storage-python#51)

Also you will need MongoDB running somewhere, and storage:

Human-friendly ways (debian package, docker image etc) pending

Configuration & environment

You can use sample config file to make your own config (its default location is /etc/cacus.yml). For docker you can map some external folder with config file, incoming dir and GPG homedir to some location inside, i.e. docker run --name cacus -P -v /srv/cacus:/cacus cacus-image, just make sure that paths in config are correct.

Usage:

Just run cacus --help

To start incoming dirs watcher, run

cacus --config /path/to/cacus.yaml --duploader-daemon

Start repository HTTP daemon (APT and REST APIs):

cacus --config /path/to/cacus.yaml --repo-daemon

REST API documentation pending, some examples:

# Create distribution "test-repo", duploader daemon will start listening for incoming files at /src/cacus/incoming/test-repo/[unstable, testing, main]
curl -X POST -H 'Content-Type: application/json' -vks \
  'localhost/debian/api/v1/distro/create/test-repo' \
  -d '{"gpg_check": false, "description": "Test distro", "incoming_timeout": 5, "strict": false,
       "simple": false, "components": ["unstable", "testing", "main"] }'

# Create "simple" distribution "test-repo", only for single .deb binary packages
curl -X POST -H 'Content-Type: application/json' -vks \
  'localhost/debian/api/v1/distro/create/test-repo' \
  -d '{"description": "Test distro", "simple": true, "components": ["unstable", "testing", "main"] }'

# Remove distribution "test-repo", including all snapshots and files uploaded to storage
curl -X POST -vks 'localhost/debian/api/v1/distro/remove/test-repo'

# Create snapshot "snap1" of distro "test-repo"
curl -X POST  -vks 'localhost/debian/api/v1/distro/snapshot/test-repo/snap1'

# List snapshots of "test-repo"
curl -vks 'localhost/debian/api/v1/distro/snapshot/test-repo'

# Upload package to distribution "common", component "unstable"
curl -vks -T hello-world_0.1-1ubuntu1_amd64.deb localhost/debian/api/v1/package/upload/common/unstable

# Copy package hello-world=0.1 from "unstable" to "stable" components
curl -X POST  -vks 'localhost/debian/api/v1/package/copy/apt-test' \
  -d '{"pkg": "hello-world", "ver": "0.1", "from": "unstable", "to": "stable"}' -H 'Content-Type: application/json'

cacus's People

Contributors

beebeeep avatar toshic 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.