Skip to content

Commit

Permalink
cleanup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Sep 25, 2018
1 parent c01291f commit 91cb036
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 234 deletions.
2 changes: 1 addition & 1 deletion docs/pages/Asset_API.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _property_api:
.. _asset_api:

Asset API
=========
Expand Down
17 changes: 17 additions & 0 deletions docs/pages/Asset_History_API.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _history_api:

Asset History API
=================

An Asset History is a record of all the versions of a particular asset.

Asset History Retrieval
~~~~~~~~~~~~~~~~~~~~~~~

.. http:get:: /v1/asset/(asset_key)
Get a list of Asset Histories associated to a particular Asset.

:statuscode 200: Success

.. include:: _examples/asset/asset_history_get.rst
5 changes: 5 additions & 0 deletions docs/pages/_examples/asset/asset_history_get.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. http:example:: curl wget httpie python-requests
:response: asset_history_get_response.rst

GET /v1/asset-history/{key} HTTP/1.1
Host: localhost:5635
4 changes: 4 additions & 0 deletions docs/pages/_examples/asset/asset_history_get_response.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
HTTP/1.1 200 OK
Location: http://localhost:5635/v1/asset-history/{key}

[]
2 changes: 1 addition & 1 deletion docs/pages/_examples/asset/asset_update_response.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HTTP/1.1 200 OK
Location: http://localhost:5885/v1/asset/{key}
Location: http://localhost:5635/v1/asset/{key}

new-asset-key
1 change: 1 addition & 0 deletions docs/pages/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ API Documentation
:caption: Contents:

Asset_API.rst
Asset_History_API.rst
89 changes: 3 additions & 86 deletions docs/pages/dev_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,17 @@
Developer Notes
===============

This page contains a series of notes intended to be beneficial for any contributors to CLyman.

Vagrant
-------
We provide a Vagrantfile to setup a development environment, but this requires
that you install `Vagrant <(https://www.vagrantup.com/)>`__.
Once you have Vagrant installed, cd into the main directory and run:

.. code-block:: bash
vagrant up
Once the box starts, you can enter it with:

.. code-block:: bash
vagrant ssh
The Project folder on your machine is synced to the /vagrant folder in the VM, so you will
need to move there before building. Once in that folder, you can build the executable and tests:

.. code-block:: bash
make && make test
Packer
------

A Packer file is provided, which can be used with
`Hashicorp Packer <https://www.packer.io>`__. Configuration is provided for
building a Docker Image, which can be executed with:

.. code-block:: bash
packer build packer.json
This will create a tagged image, which can then be pushed with

.. code-block:: bash
docker push aostreetart/clyman:v2
Docker
------

The `CLyman Docker Hub Repository <https://hub.docker.com/r/aostreetart/clyman/>`__
contains the latest Docker images for CLyman.

Running Test Cases
------------------
Building the tests can be done with:

.. code-block:: bash
make test
Tests cases are run using Catch2 (https://github.com/catchorg/Catch2), a few examples are shown below:

Run all tests:

.. code-block:: bash
./tests/tests
Run only the unit tests:

.. code-block:: bash
./tests/tests [unit]
Run only the integration tests:

.. code-block:: bash
./tests/tests [integration]
This page contains a series of notes intended to be beneficial for any contributors to Kelona.

Continuous Integration
----------------------

Travis CI is used to run automated tests against CLyman each time a commit
Travis CI is used to run automated tests against Kelona each time a commit
or pull request is submitted against the main repository. The configuration for
this can be updated via the .travis.yml file in the main folder of the project
repository.

`Latest CI Runs <https://travis-ci.org/AO-StreetArt/CLyman/>`__
`Latest CI Runs <https://travis-ci.org/AO-StreetArt/Kelona/>`__

Documentation
-------------
Expand All @@ -97,13 +23,4 @@ Documentation is built using Sphinx and hosted on Read the Docs.
Updates to documentation can be made in the docs/ folder of the project
repository, with files being in the .rst format.

Generating Releases
-------------------

The release_gen.sh script is utilized to generate releases for various systems.
It accepts three command line arguments:
* the name of the release: clyman-*os_name*-*os_version*
* the version of the release: we follow `semantic versioning <http://semver.org/>`__
* the location of the dependency script: current valid paths are linux/deb (uses apt-get) and linux/rhel (uses yum)

:ref:`Go Home <index>`
164 changes: 18 additions & 146 deletions docs/pages/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,170 +8,42 @@ Getting Started with Clyman
Docker
------

Using the Clyman Docker image is as simple as:

.. code-block:: bash
docker run --publish=8768:8768 --publish=8762:8762/udp aostreetart/clyman:v2 clyman.prod.mongo=mongodb://mongo:27017
However, we also need a running instance of Mongo to do anything interesting. The
above command assumes that you have an instance of Mongo running on the same
node with the container name 'mongo'. To get you up and running quickly,
a Docker Compose file is provided. To start up a Mongo instance and a Clyman
instance, simply run the following from the 'compose/min' folder:
An official Docker Image of Kelona is provided, and to get you up and running
quickly, a Docker Compose file is provided as well. To start up a Mongo
instance, a Consul instance, and a Kelona instance, simply run the following
from the 'compose/min' folder:

.. code-block:: bash
docker-compose up
Alternatively, you can deploy the stack with Docker Swarm using:

.. code-block:: bash
docker stack deploy --compose-file compose/min/docker-compose.yml clyman-stack
Once the services have started, test them by hitting Clyman's healthcheck endpoint:

.. code-block:: bash
curl http://localhost:8768/health
The Transaction (HTTP) API is available on port 8768, and the Event (UDP) API
is available on port 8762. Keep in mind that this is not a secure deployment,
but is suitable for exploring the :ref:`Clyman API <api_index>`.

You may also continue on to the discussion of :ref:`How to Use Clyman <use>`.

Shutdown
--------
Shutdown of Clyman can be initiated with a kill or interrupt signal to the
container, or with 'docker stop'. However, at least one udp message must be
received afterwards in order to successfully shut down the main event thread.
You can send one with:

.. code-block:: bash
echo "kill" | nc -u $(ip addr show eth0 | grep -Po 'inet \K[\d.]+') 8762
Replacing 'eth0' with your network device, if necessary.

Latest Release
--------------
curl http://localhost:5635/health
Download and unzip the latest release file from https://github.com/AO-StreetArt/CLyman/releases.

Once you have done this, you can run the easy_install script with the -d option
to install dependencies and the Clyman executable. Alternatively, you can
simply run the install_deps.sh script from the scripts/ folder, and then run
the clyman executable from the main release folder.

.. code-block:: bash
./clyman
In order to run Clyman, you will need a Mongo Server installed locally.
Instructions can be found at https://docs.mongodb.com/manual/administration/install-on-linux/, or Mongo
can be started via a Docker image:

.. code-block:: bash
docker run --name database -d -p 27017:27017 mongo:latest
Either way, the default connection for Clyman will connect without authentication.

You can move on to explore the :ref:`Clyman API <api_index>`, or
check out the :ref:`Configuration Section <configuration>` for more details
on the configuration options available when starting Clyman.

You may also continue on to the discussion of :ref:`How to Use Clyman <use>`.
Keep in mind that this is not a secure deployment,
but is suitable for exploring the :ref:`Kelona API <api_index>`.

Building from Source
--------------------

The recommended system for development of Clyman is either
Ubuntu 18.04 or CentOS7. You will need gcc 6.0 or greater and gnu make
installed to successfully compile the program.
Once you've got the required backend services started, build and execute the tests
for the repository. Please note that integration tests will fail unless you
have instances of the required backend services running:

* Ubuntu
``./gradlew check``

.. code-block:: bash
And, finally, start Kelona:

sudo apt-get install gcc-6 g++-6
export CC=gcc-6
export CXX=g++-6
``./gradlew bootRun``

* Redhat
Using the Latest Release
------------------------

https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/

Next, you'll need to clone the repository and run the build_deps script.
This will install all of the required dependencies for Clyman, and may take
a while to run.

.. code-block:: bash
git clone https://github.com/AO-StreetArt/CLyman.git
mkdir clyman_deps
cp CLyman/scripts/deb/build_deps.sh clyman_deps/build_deps.sh
cd clyman_deps
sudo ./build_deps.sh
You will also need to ensure that the POCO dependency is on the linker path,
which can be done with:

.. code-block:: bash
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
Now, we can build Clyman:

.. code-block:: bash
cd ../clyman
make
This will result in creation of the clyman executable, which we can run
with the below command:

.. code-block:: bash
./clyman
When not supplied with any command line parameters, Clyman will look for an app.properties file to start from.

You may also build the test executable in the tests/ directory with:

.. code-block:: bash
make tests
In order to run Clyman from a properties file, you will need:

- A Mongo Server installed locally. Instructions
can be found at https://docs.mongodb.com/manual/administration/install-on-linux/

Neo4j can be started via a Docker image:

.. code-block:: bash
docker run --name database -d -p 27017:27017 mongo:latest
Either way, the default connection for Clyman will connect without authentication.

You can move on to explore the :ref:`Clyman API <api_index>`, or
check out the :ref:`Configuration Section <configuration>` for more details
on the configuration options available when starting Clyman.

You may also continue on to the discussion of :ref:`How to Use Clyman <use>`.

Shutdown
--------
Shutdown of Clyman can be initiated with a kill or interrupt signal to the
main thread. However, at least one udp message must be received afterwards
in order to successfully shut down the main event thread. You can send one with:

.. code-block:: bash
Kelona can also be downloaded as a runnable JAR for the latest release from `here <https://github.com/AO-StreetArt/Kelona/releases>`__.

echo "kill" | nc -u $(ip addr show eth0 | grep -Po 'inet \K[\d.]+') 8764
When using a JAR, unzip the downloaded package, move to the main directory from a terminal, and run:

Replacing 'eth0' with your network device, if necessary.
``java -jar build/libs/kelona-0.0.1.jar``

0 comments on commit 91cb036

Please sign in to comment.