🐳 Ocean Brizo.
Project description
Brizo
Helping to Publishers to expose their services. oceanprotocol.com
"🏄♀️🌊 Brizo is an ancient Greek goddess who was known as the protector of mariners, sailors, and fishermen. She was worshipped primarily by the women of Delos, who set out food offerings in small boats. Brizo was also known as a prophet specializing in the interpretation of dreams."
🐲🦑 THERE BE DRAGONS AND SQUIDS. This is in alpha state and you can expect running into problems. If you run into them, please open up a new issue. 🦑🐲
Table of Contents
- Features
- Running Locally, for Dev and Test
- API documentation
- Configuration
- Code style
- Testing
- New Version
- License
Features
In the "Ocean ecosystem", Brizo is the technical component executed by the Publishers allowing to them to provide extended data services. Brizo, as part of the Publisher ecosystem, includes the credentials to interact with the infrastructure (initially cloud, but could be on-premise).
Running Locally, for Dev and Test
If you want to contribute to the development of Brizo, then you could do the following. (If you want to run a Brizo in production, then you will have to do something else.)
First, clone this repository:
git clone git@github.com:oceanprotocol/brizo.git
cd brizo/
Then run some things that Brizo expects to be running:
cd docker
docker-compose up
You can see what that runs by reading docker/docker-compose.yml. Note that it runs a Aquarius instance and MongoDB but the Aquarius can also work with BigchainDB or Elasticsearch. It also runs Ganache with all Ocean Protocol Keeper Contracts and Ganache CLI.
The most simple way to start is:
pip install -r requirements_dev.txt # or requirements_conda.txt if using Conda
export FLASK_APP=brizo/run.py
export CONFIG_FILE=config.ini
./scripts/deploy
flask run
That will use HTTP (i.e. not SSL/TLS).
The proper way to run the Flask application is using an application server such as Gunicorn. This allow you to run using SSL/TLS. You can generate some certificates for testing by doing:
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
and when it asks for the Common Name (CN), answer localhost
Then edit the config file config.ini
so that:
brizo.url = https://localhost:8030
Then execute this command:
gunicorn --certfile cert.pem --keyfile key.pem -b 0.0.0.0:8030 -w 1 brizo.run:app
API documentation
Once you have your application running you can get access to the documentation at:
https://127.0.0.1:8030/api/v1/docs
Currently Brizo give you the posibility of consume your data allocated in an Azure BlobStorage and a basic capability of execution of an algorithm.
Configuration
You can pass the configuration using the CONFIG_FILE environment variable (recommended) or locating your configuration in config.ini file.
In the configuration there are now two sections:
-
keeper-contracts: This section help you to connect with the network where you have deployed the contracts. You can find more information of how to configure here.
[keeper-contracts] keeper.url = http://127.0.0.1:8545 keeper.network = development ;contracts.folder=venv/contracts market.address = auth.address = token.address = aquarius.address = aquarius.account =
-
resources: In this section we are showing the url in wich the aquarius is going to be deployed. We are assuming that the algorithm and the data are in the same folder for this first approach.
[resources] azure.account.name = testocnfiles azure.account.key = DCNmb542DWbtkPf1lKz+WXii6Z50vScBvVJQMOy4XtG+bVIjHymbKm8iUZnSdlQlLRsrxlWaOwvAzbQmSm/oBw== azure.container = testfiles azure.resource_group = OceanProtocol azure.share.input = compute azure.share.output = output azure.location = westus ;; These consitute part of the aquarius url which is used in setting the `api_url` in the `OceanContractsWrapper` aquarius.url = http://localhost:5000 brizo.url = http://localhost:8030
Code style
The information about code style in python is documented in this two links python-developer-guide and python-style-guide.
Testing
Automatic tests are setup via Travis, executing tox
.
Our test use pytest framework.
New Version
The bumpversion.sh
script helps to bump the project version. You can execute the script using as first argument {major|minor|patch} to bump accordingly the version.
License
Copyright 2018 Ocean Protocol Foundation Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ocean_brizo-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a908e182db09ba39ebf89125a3d988c47d763f34423180bc3d24aa4c8f20d38 |
|
MD5 | 48ac04f8db49d3031b84df768703a685 |
|
BLAKE2b-256 | a2c67588ae2c6ca4a960f3d0024d83c237ca90351c8da4d76b7c7496aca6cb3b |