Skip to content
iidioteque edited this page Nov 12, 2012 · 3 revisions
  1. Introduction
  2. Components
  3. Projects using Cocaine
  4. Developers

Introduction

Cocaine is an open-source cloud platform enabling you to build your own PaaS clouds using simple yet effective dynamic components.

The cloud consists of one or more independent nodes with installed Cocaine (Cocained) server on each of them. Access to cloud is carried out with the help of the client library (Cocaine Dealer).

Cocaine architecture

Cocained

Notable features:

  • You are not restricted by a language or a framework. Language support is plugin-based, and we already support several common languages, so your needs are probably covered. Of course, if you want to write your apps in Whitespace, you'll need to write the language support plugin first, but it's easier to write the actual Whitespace code, we bet.
  • Your apps are driven by events, which is fancy. In order for events to actually appear from somewhere, your app defines a set of event drivers. We got lots of predefined event drivers, so unless you need to handle clients via a PS/2 port, you're good.
  • We got dynamic self-managing slave pools for each app with a rich but simple configuration and resource usage control to scale with the app needs. Yeah, it's scales automatically, you don't need to think about it.
  • Even more, it scales automatically across your server cluser via automatic node discovery and smart peer-to-peer balancing.
  • If your startup idea is about processing terabytes of pirated video, we got data streaming and pipelining for you, enjoy.
  • You can use smart balancer (Cocaine Dealer) with the Cocaine cloud.

Cocained is your personal AppEngine.

At the moment, Cocained supports the following languages and specifications:

  • C
  • C++
  • Python, WSGI
  • Perl [In Development]
  • JavaScript [In Development]

Also, we have the following event drivers built-in:

  • Recurring Timer (multiple jobs can be run if they are not finished in the timer intervals)
  • Drifting Timer (only one job can be run, hence the drift)
  • Filesystem Monitor
  • ZeroMQ Server (Request-Response)
  • Native Server (Request-Response + Smart Balancing)

Cocaine Dealer

Cocaine Dealer is an entry point for Cocaine Cloud.

Technically speaking, it's an open-source balancer that enables you to communicate with cocaine cloud in simple and most importantly persistant manner. It's a library implemented in C++ which can be used from your application to send data to cocaine cloud.

Notable features:

  • Cocaine Dealer keeps track of cocaine cloud nodes and schedules tasks to alive nodes only.
  • No tasks are ever lost, you are guaranteed to get either proper responce or error.
  • More than that, you can specify timeframe during which your task must be processed, so you will always get response in that timeframe, making Cocaine Cloud a soft-realtime system.
  • Even more, balancer optionally supports persistant message delivery, which means that your tasks are stored in local or distributed storage before being sent to the cloud. This guarantees that scheduled tasks are not lost even in case of machine restart or complete hardware failure.
  • Different balancing policies are supported, by default task can be distributed among cloud nodes in round-robin manner.
  • Dealer also supports "smart balancing", here we take each cocaine node performance as well as network routing into account, so that tasks are sent to the closest and least busy cloud node.
  • State of the cocaine nodes, state of apps on those nodes, even apps handles are discovered and processed on-the-fly, no restarts needed.

At the moment, Cocaine Dealer supports the following languages and specifications:

  • C/C++
  • Python
  • Perl [In Development]

There are several bindings which allow you to use balancer from different languages. In case your language is not supported, you can always implement your own binding. C++ API of Cocaine Dealer is dead-simple, so this won't be a problem at all.

Components

All packages can be downloaded here — Launchpad.

Server part

To install the server part you’ll need the following packages:

Name of the Package Version Prescription
cocaine-server 0.9.3 Cocaine - Server (the core of the cloud platform)
cocaine-tools 0.9.3 Cocaine - Toolset (with this set of tools you can manage the server part)
libcocaine-common1 0.9.3 Cocaine - Common Libraries (common components for the platform)
libcocaine-core1 0.9.3 Cocaine - Core Libraries (server components of the platform)
libcocaine-dev 0.9.3 Cocaine - Development Headers (files for developers, which allow to enhance the capabilities of the server)
cocaine-generic-slave 0.9.3 Cocaine - Generic Slave (standard sandbox to run the application)

Cocained Plugins

Name of the Package Version Prescription
libcocaine-plugin-python 0.9.1 Cocaine - Python Sandbox (Python support)
libcocaine-plugin-binary 0.9.1 Cocaine - Binary Sandbox (library to support execution of the compiled binary files)
libcocaine-plugin-chrono 0.9.1 Cocaine - Time-based Drivers (allows you to run timed tasks)
libcocaine-plugin-fs 0.9.1 Cocaine - Filesystem-based Drivers (allows you to run tasks based on the events in the file system)
libcocaine-plugin-elliptics 0.9.1 Cocaine - Elliptics Storage (plugin to work with the data store Elliptics)
libcocaine-plugin-mongodb 0.9.1 Cocaine - MongoDB Storage (plugin to work with the data store MongoDB)
libcocaine-plugin-perl 0.9.1 Cocaine - Perl Sandbox (Perl support)
libcocaine-plugin-dealer 0.9.1 Cocaine - Dealer Driver (library to work with Cocaine Dealer)

Client part

Name of the Package Version Prescription
libcocaine-dealer1 0.9.4 Cocaine - Dealer (library of the router and balancer)
libcocaine-dealer-dev 0.9.4 Cocaine - Development Headers (files for developers using Cocaine Dealer in C++ code)
libfastcgi-cocaine-proxy1 0.9.4 Cocaine Dealer FastCGI component (module to support Cocaine Dealer in FastCGI Proxy to work with the HTTP Protocol)

Cocaine Dealer Bindings

Name of the Package Version Prescription
cocaine-framework-perl 0.8.0-2.af2bc4e8 Cocaine - Dealer Perl binding (binding for Cocaine Dealer for the Perl language and auxiliary components for writing code in Perl)
cocaine-framework-python 0.9.5 Cocaine - Dealer Python binding (binding for Cocaine Dealer for the Python language and auxiliary components for writing code in Python)

Cocaine is supported on multiple platforms:

Platform Repository
Ubuntu Lucid x64 ppa:yandex-opensource/cocaine-dev
Ubuntu Precise Pangolin x64 ppa:yandex-opensource/cocaine-dev

Projects using Cocaine

Developers

Andrey Sibiryov kobolog@yandex-team.ru - сосаіпе-core, cocaine-plugins cocaine-framework-python, cocaine-fastcgi-proxy.

Rim Zaydullin rimz@yandex-team.ru - cocaine-dealer, cocaine-framework-perl.

Alexandr Eliseev inkvi@yandex-team.ru - cocaine-flow.

Anton Kortunov toshik@yandex-team.ru - cocaine-fastcgi-proxy.

Vladimir Shakhov vshakhov@yandex-team.ru - cocaine-framework-java.

Mail all comments and suggestions about Cocaine cloud platform documentation to ringmybell@yandex-team.ru

Thank you!