Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update names brizo and aquarius #1

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.1
current_version = 0.1.0
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
export KEEPER_VERSION=latest
export AQUARIUS_VERSION=latest
rm -rf "${HOME}/.nevermind/nevermind-contracts/artifacts"
bash -x start_nevermind.sh --no-pleuston --no-commons --no-brizo --no-faucet --no-dashboard --no-agent --latest 2>&1 > start_nevermind.log &
bash -x start_nevermind.sh --no-commons --no-gateway --no-faucet --no-dashboard --latest 2>&1 > start_nevermind.log &
cd ..
for i in $(seq 1 50); do
sleep 5
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ clean-pyc: ## remove Python file artifacts
find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
Expand All @@ -58,8 +57,8 @@ lint: ## check style with PyLint
test: ## run tests quickly with the default Python
py.test

test-all: ## run tests on every Python version with tox
tox
test-all: ## run tests on every Python version
py.test

coverage: ## check code coverage quickly with the default Python
coverage run --source squid_py -m pytest
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ account = Account(config.parity_address, config.parity_password)
# Let's start by registering an asset in the Ocean network
metadata = Metadata.get_example()

# consume and service endpoints require `brizo.url` is set in the config file
# consume and service endpoints require `gateway.url` is set in the config file
# or passed to Ocean instance in the config_dict.
# define the services to include in the new asset DDO

Expand Down Expand Up @@ -121,10 +121,10 @@ config_dict = {

},
'resources': {
# aquarius is the metadata store. It stores the assets DDO/DID-document
'aquarius.url': 'http://localhost:5000',
# Brizo is the publisher's agent. It serves purchase and requests for both data access and compute services
'brizo.url': 'http://localhost:8030',
# Metadata is the metadata store. It stores the assets DDO/DID-document
'metadata.url': 'http://localhost:5000',
# Gateway is the publisher's agent. It serves purchase and requests for both data access and compute services
'gateway.url': 'http://localhost:8030',
# points to the local database file used for storing temporary information (for instance, pending service agreements).
'storage.path': 'squid_py.db',
# Where to store downloaded asset files
Expand Down Expand Up @@ -159,7 +159,7 @@ In addition to the configuration file, you may use the following environment var
1. Create the local testing environment using [barge](https://github.com/oceanprotocol/barge). Once cloned that repository, you can start the cluster running:

```
./start_ocean.sh --latest --no-brizo --no-pleuston --local-spree-node
./start_ocean.sh --latest --no-gateway --no-common --local-spree-node
```

It runs an Aquarius node and an Ethereum RPC client. For details, read `docker-compose.yml`.
Expand Down Expand Up @@ -202,24 +202,21 @@ and [python-style-guide](https://github.com/oceanprotocol/dev-ocean/blob/master/

#### Testing

Automatic tests are setup via Travis, executing `tox`.
Automatic tests are setup via Github actions
Our test use pytest framework.

#### New Version / New Release

See [RELEASE_PROCESS.md](RELEASE_PROCESS.md)

## Attribution
##Attribution
This project is based in the [Ocean Protocol Squid-py](https://github.com/oceanprotocol/squid-py). It keeps the same Apache v2 License and adds some improvements.

This library is based in the [Ocean Protocol](https://oceanprotocol.com) [Squid Python](https://github.com/oceanprotocol/squid-py) library.
It keeps the same Apache v2 License and adds some improvements. See [NOTICE file](NOTICE).

## License

```
Copyright 2020 Keyko GmbH
This product includes software developed at
BigchainDB GmbH and Ocean Protocol (https://www.oceanprotocol.com/)
```text
Copyright 2020 Keyko GmbH.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -232,3 +229,4 @@ 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.
```
6 changes: 2 additions & 4 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ parity.address1 = 0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0
parity.password1 = secret

[resources]

;; 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
metadata.url = http://localhost:5000
gateway.url = http://localhost:8030

storage.path = squid_py.db
downloads.path = consume-downloads
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
author = 'squid-py contributors'

# The full version, including alpha/beta/rc tags
release = '0.7.1'
release = '0.1.0'
# The short X.Y version
release_parts = release.split('.') # a list
version = release_parts[0] + '.' + release_parts[1]
Expand Down
58 changes: 29 additions & 29 deletions examples/example_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ def get_variable_value(variable):


class ExampleConfig:
_local_aqua_url = "http://172.15.0.15:5000"
_local_brizo_url = "http://localhost:8030"
_duero_aqua_url = "https://aquarius.compute.duero.dev-ocean.com"
_duero_brizo_url = "https://brizo.compute.duero.dev-ocean.com"
# _duero_aqua_url = "http://localhost:5000"
# _duero_brizo_url = "http://localhost:8030"

_pacific_aqua_url = "https://aquarius.pacific.dev-ocean.com"
_pacific_brizo_url = "https://brizo.pacific.dev-ocean.com"

# _nile_aqua_url = "http://172.15.0.15:5000"

# _nile_aqua_url = "https://nginx-aquarius.dev-ocean.com"
# _nile_brizo_url = "https://nginx-brizo.dev-ocean.com"
# _nile_aqua_url = "https://nginx-aquarius.dev-ocean.com"
_nile_aqua_url = "https://aquarius.marketplace.dev-ocean.com"
# _nile_aqua_url = "http://172.15.0.15:5000"
_nile_brizo_url = "https://brizo.marketplace.dev-ocean.com"
# _nile_brizo_url = "http://localhost:8030"
_local_metadata_url = "http://172.15.0.15:5000"
_local_gateway_url = "http://localhost:8030"
_duero_metadata_url = "https://metadata.compute.duero.dev-ocean.com"
_duero_gateway_url = "https://gateway.compute.duero.dev-ocean.com"
# _duero_metadata_url = "http://localhost:5000"
# _duero_gateway_url = "http://localhost:8030"

_pacific_metadata_url = "https://metadata.pacific.dev-ocean.com"
_pacific_gateway_url = "https://gateway.pacific.dev-ocean.com"

# _nile_metadata_url = "http://172.15.0.15:5000"

# _nile_metadata_url = "https://nginx-metadata.dev-ocean.com"
# _nile_gateway_url = "https://nginx-gateway.dev-ocean.com"
# _nile_metadata_url = "https://nginx-metadata.dev-ocean.com"
_nile_metadata_url = "https://metadata.marketplace.dev-ocean.com"
# _nile_metadata_url = "http://172.15.0.15:5000"
_nile_gateway_url = "https://gateway.marketplace.dev-ocean.com"
# _nile_gateway_url = "http://localhost:8030"

_duero_secret_store_url = "https://secret-store.duero.dev-ocean.com"
_nile_secret_store_url = "https://secret-store.dev-ocean.com"
Expand All @@ -45,10 +45,10 @@ class ExampleConfig:
_remote_keeper_url = "https://%s.dev-ocean.com"
_parity_url = "http://localhost:8545"
_net_to_services_url = {
'duero': {'aquarius': _duero_aqua_url, 'brizo': _duero_brizo_url},
'nile': {'aquarius': _nile_aqua_url, 'brizo': _nile_brizo_url},
'kovan': {'aquarius': _local_aqua_url, 'brizo': _local_brizo_url},
'pacific': {'aquarius': _pacific_aqua_url, 'brizo': _pacific_brizo_url},
'duero': {'metadata': _duero_metadata_url, 'gateway': _duero_gateway_url},
'nile': {'metadata': _nile_metadata_url, 'gateway': _nile_gateway_url},
'kovan': {'metadata': _local_metadata_url, 'gateway': _local_gateway_url},
'pacific': {'metadata': _pacific_metadata_url, 'gateway': _pacific_gateway_url},
}
_net_name_map = {
'duero': 'duero',
Expand Down Expand Up @@ -92,10 +92,10 @@ def get_base_config():
"parity.url": "http://localhost:8545",
},
"resources": {
"aquarius.url": "http://172.15.0.15:5000",
# "aquarius.url": "http://localhost:5000",
# "brizo.url": "http://172.15.0.17:8030",
"brizo.url": "http://localhost:8030",
"metadata.url": "http://172.15.0.15:5000",
# "metadata.url": "http://localhost:5000",
# "gateway.url": "http://172.15.0.17:8030",
"gateway.url": "http://localhost:8030",
"storage.path": "squid_py.db",
"downloads.path": "consume-downloads"
}
Expand All @@ -120,8 +120,8 @@ def _get_config(local_node=True, net_key=''):
else ExampleConfig._nile_secret_store_url

service_url = ExampleConfig._net_to_services_url[net_name]
config['resources']['aquarius.url'] = service_url['aquarius']
config['resources']['brizo.url'] = service_url['brizo']
config['resources']['metadata.url'] = service_url['metadata']
config['resources']['gateway.url'] = service_url['gateway']

# parity_url maybe different than the keeper_url
# config['keeper-contracts']['parity.url'] = ExampleConfig._parity_url
Expand Down
21 changes: 0 additions & 21 deletions library.json

This file was deleted.

2 changes: 1 addition & 1 deletion nevermind_sdk_py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = """OceanProtocol"""
__version__ = '0.7.1'
__version__ = '0.1.0'

# Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
Expand Down
6 changes: 3 additions & 3 deletions nevermind_sdk_py/agreement_events/accessSecretStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from common_utils_py.did import did_to_id
from common_utils_py.did_resolver.did_resolver import DIDResolver

from nevermind_sdk_py.brizo import BrizoProvider
from nevermind_sdk_py.gateway import GatewayProvider
from nevermind_sdk_py.ocean.keeper import SquidKeeper as Keeper
from nevermind_sdk_py.secret_store import SecretStoreProvider

Expand Down Expand Up @@ -91,14 +91,14 @@ def consume_asset(event, agreement_id, did, service_agreement, consumer_account,
secret_store = SecretStoreProvider.get_secret_store(
secret_store_url, parity_url, consumer_account
)
brizo = BrizoProvider.get_brizo()
gateway = GatewayProvider.get_gateway()

consume_callback(
agreement_id,
service_agreement.service_definition_id,
DIDResolver(Keeper.get_instance().did_registry).resolve(did),
consumer_account,
downloads_path,
brizo,
gateway,
secret_store
)
6 changes: 3 additions & 3 deletions nevermind_sdk_py/agreement_events/computeExecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
import logging

from nevermind_sdk_py.brizo import BrizoProvider
from nevermind_sdk_py.gateway import GatewayProvider
from common_utils_py.did_resolver.did_resolver import DIDResolver
from nevermind_sdk_py.ocean.keeper import SquidKeeper as Keeper

Expand All @@ -27,11 +27,11 @@ def execute_computation(event, agreement_id, did, service_agreement, consumer_ac
"""
logger.debug(f"consuming asset (agreementId {agreement_id}) after event {event}.")
if consume_callback:
brizo = BrizoProvider.get_brizo()
gateway = GatewayProvider.get_gateway()
consume_callback(
agreement_id,
DIDResolver(Keeper.get_instance().did_registry).resolve(did),
DIDResolver(Keeper.get_instance().did_registry).resolve(workflow_did),
consumer_account,
brizo
gateway
)
6 changes: 3 additions & 3 deletions nevermind_sdk_py/assets/asset_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AssetConsumer:

@staticmethod
def download(service_agreement_id, service_index, ddo, consumer_account, destination,
brizo, secret_store, index=None):
gateway, secret_store, index=None):
"""
Download asset data files or result files from a compute job.

Expand All @@ -25,7 +25,7 @@ def download(service_agreement_id, service_index, ddo, consumer_account, destina
:param ddo: DDO
:param consumer_account: Account instance of the consumer
:param destination: Path, str
:param brizo: Brizo instance
:param gateway: Gateway instance
:param secret_store: SecretStore instance
:param index: Index of the document that is going to be downloaded, int
:return: Asset folder path, str
Expand Down Expand Up @@ -72,7 +72,7 @@ def download(service_agreement_id, service_index, ddo, consumer_account, destina
assert index >= 0, logger.error('index has to be 0 or a positive integer.')
assert index < len(decrypted_content_urls), logger.error(
'index can not be bigger than the number of files')
brizo.consume_service(
gateway.consume_service(
service_agreement_id,
consume_url,
consumer_account,
Expand Down
6 changes: 3 additions & 3 deletions nevermind_sdk_py/assets/asset_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@


class AssetExecutor:
"""Class representing the call to the brizo executre endpoint."""
"""Class representing the call to the Gateway execute endpoint."""

@staticmethod
def execute(agreement_id, compute_ddo, workflow_ddo, consumer_account, brizo, index):
def execute(agreement_id, compute_ddo, workflow_ddo, consumer_account, gateway, index):
"""

:param agreement_id:
Expand All @@ -24,4 +24,4 @@ def execute(agreement_id, compute_ddo, workflow_ddo, consumer_account, brizo, in
service_endpoint = ServiceAgreement.from_ddo(ServiceTypes.CLOUD_COMPUTE,
compute_ddo).service_endpoint

brizo.execute_service(agreement_id, service_endpoint, consumer_account, workflow_ddo)
gateway.execute_service(agreement_id, service_endpoint, consumer_account, workflow_ddo)
6 changes: 0 additions & 6 deletions nevermind_sdk_py/brizo/__init__.py

This file was deleted.

25 changes: 0 additions & 25 deletions nevermind_sdk_py/brizo/brizo_provider.py

This file was deleted.