Welcome to Open-Prime documentation!

Open Prime lets’ an organization host all its web projects on one machine using Docker. Open Prime helps project committer host their project’s live. and development servers. It includes Postgres, Mongo and Redis servers for your backend, wraps your app server with Varnish and Nginx and servs your files from a CDN.

After a simple setup, your servers will be automaticly updated whenever you update your git repository. The system assumes you are using Travis for CI and if you are not, please stop reading this guide and add Travis to your project.

Contents:

Quick Start

Note

nothing really works yet

First you’ll need to get install the opri CLI:

$ curl -Lo- https://[...] | bash

Now create a host for your project:

$ opri host <short_name> <repo_url | local_dir> [main_url]
...

If you use a local_dir opri will look for the git config and use the origin url as the host’s blessed repo.

Next, configure your .travis.yml file to fire the update process on success by adding the following lines to the end of your file:

notifications:
  webhooks:
    urls:
      - http://opri.hasadna.org.il/events
    on_success: always
    on_failure: never
    on_start: false

Commit your changes and you’re done. Whenever you push to your master or dev branches and your tests pass, the host at <short_name>.hasadna.org.il or dev.<short_name>.hasdna.org.il will be updated.

Development

Open Prime lets’ an organization host all its web projects in on one machine using Docker containers.

Note

if you’re ready to contribute, check out our board.

Architecture

Open Prime is made from multiple components each contained in a docker. Redundency is achieved through mirroring and clustering of the entire machine. i.e. no need for a DB cluster or for multiple apps serving the same code base.

Each of the eKnights is updated using Travis Webhooks resulting in a cycle that starts when a committer pushes his code to github, waking up travis and upon success, updating the App server. Prime will watch both the master and dev branches, updating the appropiate container:

                                    +                                       +
              Unix Sockets          |               TCP Sockets             |
                                    |                                       |
 +----------+     +--------------+  |   +------------+                      |
 |          |     |              |  |   |            |                      |
 | Postgres |     | Open Knesset |  |   |    DNS     |                      |
 |          |     |              |  |   |            |                      |
 +----------+     ++------------++  |   +------------+                      |
                   |     Dev    |   |                                       |
 +----------+      +------------+   |   +------------+     +-------------+  |
 |          |                       |   |            |     |             |  |
 |  Mongo   |     +--------------+  |   | Web Server |     | Accelarator |  |
 |          |     |              |  |   |            |     |             |  |
 +----------+     | Open Pension |  |   +------------+     +-------------+  |
                  |              |  |                                       |
 +----------+     ++------------++  |   +------------+                      |
 |          |      |     Dev    |   |   |            |                      |
 |  Redis   |      +------------+   |   |   SMTP     |                      |
 |          |           ...         |   |            |                      |
 +----------+                       |   +------------+                      |
                                    |                                       |
+---------------------------------------------------------------------------+

   +---------------------------------------------------------------------+
   |                                                                     |
   |                     Content Distribuition Network                   |
   |                                                                     |
   +---------------------------------------------------------------------+

Monitoring

[supervisord?, logs?]

Research

  1. some thought should go into pure data containers, so that database containers are not storing their data directly
  2. https://github.com/joyent/sdc/#smartdatacenter1
  3. https://github.com/joyent/manta/#manta-object-storage-with-integrated-compute