项目作者: replicante-io

项目描述 :
A DataStore orchestration solution
高级语言: Rust
项目地址: git://github.com/replicante-io/replicante.git
创建时间: 2018-02-16T20:28:31Z
项目社区:https://github.com/replicante-io/replicante

开源协议:MIT License

下载


Replicante

A distributed datastore orchestration system.

Code of Conduct

Our aim is to build a thriving, healthy and diverse community.
To help us get there we decided to adopt the Contributor Covenant Code of Conduct
for all our projects.

Any issue should be reported to stefano-pogliani
by emailing conduct@replicante.io.
Unfortunately, as the community lucks members, we are unable to provide a second contact to report
incidents to.
We would still encourage people to report issues, even anonymously.

In addition to the Code Of Conduct the following documents are relevant:

Features and feature naming convention

Rust offers features
to conditionally code, logic and options into the final build.

In Replicante Core features are used to choose what to include with regards to things like:

  • Backend implementations: such as stores, messaging platform, etc … (WIP)
  • Built-in orchestrator actions.
  • Experimental or advanced features.

A naming convention for features is defined here to ensure consistency: $namespace-$feature.

  • $namespace: logical grouping of features (for example action or store_backend).
  • $feature: the exact feature (for example debug [actions] or mongo [store backend]).

The characters allowed in features name are restricted by rust and even more by :
https://doc.rust-lang.org/cargo/reference/features.html#the-features-section

As such the following two special characters should be the only one in use:

  • - as the separator between $namespace and $feature.
  • _ as the world separator within each of $namespace and $feature.

Development environment

Replicante Core requires a few dependencies in order to run.
To make development easier and faster these dependencies are run locally using containers.

Replicante Core uses podman to manage these containers.
This is mainly due to podman’s support for cgroups v2 and rootless containers.

An opinionated development tool built on top of many generic projects is also available.
This is replidev, located in devtools/replidev, and is written in rust.
As mentioned, it will require some additional tools to work:

It can be complied and installed in $HOME/bin/replidev with:

  1. cargo install --path devtools/replidev

Once installed, the Replicante Core development environment can be set up with:

  1. # Start the essential dependences (kafka, mongo, zookeeper)
  2. # as well as an NGINX server for static content (includes an "useful links" page).
  3. $ replidev deps start essential
  4. --> Create pod replideps-essential
  5. 3062d4295cbec38890f271b283f5d7aeae1e9987d865fc249685e48884608bf4
  6. --> Start container replideps-essential-zookeeper
  7. 59cf21245a515905a52ccc545ae0b8efc16fb1a84f58a8e6bbe03685f9d1bffc
  8. --> Start container replideps-essential-nginx
  9. 9c9be7b7368836fb7f2116a1d61d04dfbba0cc2ce9d0e4adb4ec5475162fb702
  10. --> Start container replideps-essential-mongo
  11. 759980c6606aa46aefbf63f9f61dde7a471a10dded308ca1a79ef5cce6c2dbe2
  12. --> Start container replideps-essential-kafka
  13. e174144db830918a78805fbb729cfbd23b51568fedc5432d867abfa15f6186c1
  14. # Once the command completes you can get the above mentioned links at
  15. # http://localhost:8080/
  16. # When dependences start without any data, some initialisation may be required.
  17. $ replidev deps initialise essential
  18. --> Initialise essential/mongo from replideps-essential-mongo
  19. ==> Checking (and initialising) mongo replica set ...
  20. MongoDB shell version v4.2.3
  21. connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
  22. Implicit session: session { "id" : UUID("9d957838-7984-4d98-b667-e3b9937fb0d5") }
  23. MongoDB server version: 4.2.3
  24. ---> Replica Set initialised, nothing to do
  25. ==> Ensuring all mongo indexes exist ...
  26. MongoDB shell version v4.2.3
  27. connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
  28. Implicit session: session { "id" : UUID("f72c6214-59c1-4066-baf6-78c19d61606d") }
  29. MongoDB server version: 4.2.3
  30. # Dependencies can be stopped, and containers removed with
  31. $ replidev deps stop essential
  32. --> Stop pod replideps-essential
  33. 3062d4295cbec38890f271b283f5d7aeae1e9987d865fc249685e48884608bf4
  34. --> Remove pod replideps-essential
  35. 3062d4295cbec38890f271b283f5d7aeae1e9987d865fc249685e48884608bf4
  36. # Once the pods have been stopped, persisted data can be PERMANENTLY deleted with
  37. $ replidev deps clean essential --confirm
  38. --> Clean data for essential pod (from ./devtools/data/essential)
  39. # Additional development dependences and tools:
  40. $ replidev deps list
  41. NAME STATUS POD ID DEFINITION
  42. essential - - devtools/deps/podman/essential.yaml
  43. grafana - - devtools/deps/podman/grafana.yaml
  44. jaeger - - devtools/deps/podman/jaeger.yaml
  45. prometheus - - devtools/deps/podman/prometheus.yaml
  46. sentry - - devtools/deps/podman/sentry.yaml
  47. uis - - devtools/deps/podman/uis.yaml

Build dependences

  • clang: for rdkafka
  • cmake
  • openssl-devel

Playgrounds

Playgrounds are docker and docker-compose projects that run distributed
datastores locally so that replicante can be developed and tested.

They moved to a dedicated repo: https://github.com/replicante-io/playgrounds

Development Documentation

The code is documented with rustdoc even for private methods.
This helps existing and new developers keep a handle on the codebase.

Use the following command from the root of the repo to generate the documentation:

  1. cargo rustdoc -- --document-private-items

Developers Notebook

Architectural nodes, implementation details, suggestions, proposals and more.

The developers notebook is a collection of documents aimed at present and future project developers
as well as advanced users that want to know more about Replicante internals.
It is also a place to jot down ideas for the future or potential changes that may be
needed/useful some day but are not quite yet.

TODOs and the like

You can scan the code for TODOs, NOTEs, etcetera with fixme.

  1. npm install fixme
  2. node_modules/.bin/fixme -i 'devtools/**' -i 'node_modules/**' -i 'target/**' '**/*.rs'
  3. rm -r node_modules package-lock.json