Merge branch 'develop' of github.com:oceanprotocol/docker-images into feature/clean_env

This commit is contained in:
Javier Cortejoso 2018-11-30 10:55:15 +01:00
commit 47c6f26f30
No known key found for this signature in database
GPG Key ID: FBEEF3131E39EBCF
17 changed files with 257 additions and 57 deletions

View File

@ -19,6 +19,7 @@
---
Get info: oceanprotocol.com
Get docs: docs.oceanprotocol.com
Get code: github.com/oceanprotocol
Get help: gitter.im/oceanprotocol/Lobby

View File

@ -1,8 +1,8 @@
[![banner](doc/img/repo-banner@2x.png)](https://oceanprotocol.com)
[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
<h1 align="center">docker-images</h1>
> 🐳 Docker compose and tools running the complete Ocean Protocol network stack.
> 🐳 Docker images and Compose for the full Ocean Protocol Network stack.
> [oceanprotocol.com](https://oceanprotocol.com)
---
@ -18,6 +18,7 @@
- [Script Options](#script-options)
- [Ocean Protocol components](#ocean-protocol-components)
- [Environment Variables](#environment-variables)
- [Parity Client Accounts](#parity-client-accounts)
- [Contributing](#contributing)
- [License](#license)
@ -53,13 +54,11 @@ To get the `latest` versions of all components, referring to their `develop` bra
After getting everything running, you can open the **Pleuston Frontend** application in your browser:
```
http://localhost:3000
```
[http://localhost:3000](http://localhost:3000)
### Script Options
The script provides the following options:
The `start_ocean.sh` script provides the following options:
Option | Description
--- | ---
@ -67,22 +66,52 @@ Option | Description
`--no-pleuston` | Start up Ocean without an instance of `pleuston`. Helpful for development on `pleuston`.
`--local-parity-node` | Runs a local parity POA node and Secret Store instead of ganache-cli.
`--reuse-database` | Start up Ocean and reuse the Database from ganache. Helpful for development.
`--clean-all` | Remove the volumes, local folder and networks used by the script.
`--purge` | Remove the volumes, local folder and networks used by the script.
For example, the following command would run the latest version of the stack, without Pleuston and with the Parity + Secret Store nodes:
For example, if you do:
`./start_ocean.sh --latest --no-pleuston --local-parity-node`
```bash
./start_ocean.sh --latest
```
## Ocean Protocol components
then the main/default [docker-compose.yml](docker-compose.yml) will be used, so the following Docker images will all be started:
The Ocean Docker compose starts the following components:
- mongo:3.6
- oceanprotocol/keeper-contracts:latest
- oceanprotocol/aquarius:latest
- oceanprotocol/brizo:latest
- oceanprotocol/pleuston:latest
* [🦄 pleuston](https://github.com/oceanprotocol/pleuston). Frontend listening on port `3000`.
* [🐋 aquarius](https://github.com/oceanprotocol/aquarius). Backend listening on port `5000`.
* [💧 keeper-contracts](https://github.com/oceanprotocol/keeper-contracts). RPC client listening on port `8545`.
* [💧 secret-store](https://github.com/oceanprotocol/parity-ethereum). HTTP client listening on port `12001`.
To see what ports each of those listens on, read [docker-compose.yml](docker-compose.yml). Note that `keeper-contracts` runs a local Ganache node (not a local Parity Ethereum POA node).
![Ocean Protocol Components](doc/img/ocean-components@2x.png)
If you do:
```bash
./start_ocean.sh --no-pleuston
```
then [docker-compose-no-pleuston.yml](docker-compose-no-pleuston.yml) will be used, so these images will be started:
- mongo:3.6
- oceanprotocol/keeper-contracts:stable
- oceanprotocol/aquarius:stable
- oceanprotocol/brizo:stable
If you do:
```bash
./start_ocean.sh --latest --local-parity-node
```
then [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml) will be used. Read it to see what images it starts. Note that it _doesn't_ start Pleuston, and it _does_ start a Parity Secret Store.
If you do:
```bash
./start_ocean.sh --latest --no-pleuston --local-parity-node
```
then the last-selected Docker Compose file will be used, i.e. the one selected by `--local-parity-node`: [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml).
### Parity Client Accounts
@ -110,12 +139,7 @@ Variable | Description
`KEEPER_NETWORK_NAME` | set to one of `"ganache"` (default), `"kovan"`, or `"ocean_poa_net_local"`
`ARTIFACTS_FOLDER` | this is where the deployed smart contracts abi files will be available. This can be pointed at any path you like.
A subset of the components can be run by modifying the docker-compose file directly or by using one of the other pre-built compose files:
Compose file | Description
--- | ---
`docker-compose-no-pleuston.yml` | runs all components without the pleuston. This is useful for developing/debugging the front-end app. So first the docker compose container can be started then pleuston can be started separately from source. You can also use `./start_ocean.sh --no-pleuston` to do this
`docker-compose-local-parity-node.yml` | similar to the above with no pleuston, but runs a local parity POA node instead of ganache-cli. You can also use `./start_ocean.sh --local-parity-node` instead
In addition to these variables, when running Brizo you need to provide the Azure credentials to allow Brizo connect to Azure. These variables can be configured in the file `brizo.env`.
## Contributing
@ -127,7 +151,7 @@ Ocean Protocol uses [C4 Standard process](https://github.com/unprotocols/rfc/blo
## License
```
```text
Copyright 2018 Ocean Protocol Foundation
Licensed under the Apache License, Version 2.0 (the "License");

23
brizo.env Executable file
View File

@ -0,0 +1,23 @@
# Use this file to set the env vars required for Brizo.
KEEPER_URL=http://parity-node:8545
LOCAL_CONTRACTS=true
KEEPER_NETWORK_NAME=ocean_poa_net_local
SECRET_STORE_URL=http://secret-store:12001
PARITY_URL=http://parity-node:8545
# Set a valid parity address and password to have seamless interaction with the `keeper`
PARITY_ADDRESS=
PARITY_PASSWORD=
AQUARIUS_URL=http://aquarius:5000
BRIZO_URL=http://brizo:8030
AZURE_ACCOUNT_NAME=
AZURE_ACCOUNT_KEY=
AZURE_RESOURCE_GROUP=
AZURE_LOCATION=westus
AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
AZURE_TENANT_ID=
AZURE_SUBSCRIPTION_ID=

29
cors-proxy.conf Normal file
View File

@ -0,0 +1,29 @@
events {}
http {
upstream ss {
server secret-store:12001;
}
server {
listen 12001;
location ~ ^/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
proxy_pass http://ss;
proxy_redirect off;
proxy_set_header Origin "";
}
access_log off;
error_log off;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

View File

@ -53,11 +53,24 @@ services:
- ./parity/secret_store/keys/:/parity_data/keys/ocean-network/
ports:
- 12000:12000
- 12001:12001
- 12001
networks:
backend:
ipv4_address: 172.15.0.13
secret-store-cors-proxy:
image: nginx:alpine
volumes:
- ./cors-proxy.conf:/etc/nginx/nginx.conf:ro
depends_on:
- secret-store
ports:
- 12001:12001
networks:
backend:
ipv4_address: 172.15.0.16
command: nginx -g 'daemon off;'
keeper-contracts:
image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable}
networks:
@ -90,6 +103,20 @@ services:
volumes:
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro
brizo:
image: oceanprotocol/brizo:${OCEAN_VERSION:-stable}
ports:
- 8030:8030
networks:
backend:
ipv4_address: 172.15.0.17
depends_on:
- keeper-contracts
- parity-node
env_file:
- ${BRIZO_ENV_FILE}
volumes:
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro
networks:
backend:

View File

@ -50,11 +50,10 @@ services:
- backend
depends_on:
- keeper-contracts
environment:
KEEPER_URL: http://keeper-contracts:8545
LOCAL_CONTRACTS: "true"
env_file:
- ${BRIZO_ENV_FILE}
volumes:
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracs/:ro
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro
networks:
backend:

View File

@ -36,7 +36,7 @@ services:
depends_on:
- keeper-contracts
environment:
KEEPER_URL: http://keeper-contracts:8545
KEEPER_URL: http://keeper-contracts:8545
DB_HOSTNAME: mongodb
LOCAL_CONTRACTS: "true"
volumes:
@ -50,9 +50,8 @@ services:
- backend
depends_on:
- keeper-contracts
environment:
KEEPER_URL: http://keeper-contracts:8545
LOCAL_CONTRACTS: "true"
env_file:
- ${BRIZO_ENV_FILE}
volumes:
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro
@ -63,8 +62,9 @@ services:
depends_on:
- keeper-contracts
environment:
KEEPER_HOST: keeper-contracts
OCEAN_HOST: aquarius
NODE_HOST: localhost
AQUARIUS_HOST: localhost
BRIZO_HOST: localhost
LOCAL_CONTRACTS: 'true'
volumes:
- ${ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro

View File

@ -20,7 +20,7 @@
"params": {
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x2323",
"networkID": "0x2324",
"gasLimitBoundDivisor": "0x400",
"eip140Transition": 0,
"eip211Transition": 0,
@ -88,16 +88,19 @@
}
},
"0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": {
"balance": "1000"
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x0011598De1016A350ad719D23586273804076774": {
"balance": "100500"
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": {
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0xa99d43d86a0758d5632313b8fa3972b6088a21bb": {
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": {
"balance": "10000000111000111000111000"
"balance": "0x200000000000000000000000000000000000000000000000"
}
}
}

View File

@ -0,0 +1,22 @@
{
"id": "50aa801a-8d66-1402-1fa4-d8987868c2ce",
"version": 3,
"crypto": {
"cipher": "aes-128-ctr",
"cipherparams": {
"iv": "a874e6fe50a5bb088826c45560dc1b7e"
},
"ciphertext": "2383c6aa50c744b6558e77b5dcec6137f647c81f10f71f22a87321fd1306056c",
"kdf": "pbkdf2",
"kdfparams": {
"c": 10240,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "eca6ccc9fbb0bdc3a516c7576808ba5031669e6878f3bb95624ddb46449e119c"
},
"mac": "14e9a33a45ae32f88a0bd5aac14521c1fcf14f56fd55c1a1c080b2f81ddb8d44"
},
"address": "068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0",
"name": "",
"meta": "{}"
}

View File

@ -0,0 +1,22 @@
{
"id": "ce455fdd-11fd-5a71-0a31-9d0bec6a605d",
"version": 3,
"crypto": {
"cipher": "aes-128-ctr",
"cipherparams": {
"iv": "56b27c187d45aab59377869042b948aa"
},
"ciphertext": "c774b879793e2e54b85071d929cc7fbb11b47f6bab6e590edf3997fe4373eaf8",
"kdf": "pbkdf2",
"kdfparams": {
"c": 10240,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "33b3b99e4c6f7f6d7d804555d40c08e4a2acba20e1e46aca712c82c3b9bab749"
},
"mac": "10ee295ce6b1553887413f0e717ccedc1bddb62572bb9208ec3bd091085990db"
},
"address": "a99d43d86a0758d5632313b8fa3972b6088a21bb",
"name": "",
"meta": "{}"
}

View File

@ -20,7 +20,7 @@
"params": {
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x2323",
"networkID": "0x2324",
"gasLimitBoundDivisor": "0x400",
"eip140Transition": 0,
"eip211Transition": 0,
@ -88,15 +88,19 @@
}
},
"0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": {
"balance": "1000"
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x0011598De1016A350ad719D23586273804076774": {
"balance": "100500"
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0": {
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0xa99d43d86a0758d5632313b8fa3972b6088a21bb": {
"balance": "0x200000000000000000000000000000000000000000000000"
},
"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e": {
"balance": "10000000111000111000111000"
"balance": "0x200000000000000000000000000000000000000000000000"
}
}
}

View File

@ -0,0 +1,22 @@
{
"id": "50aa801a-8d66-1402-1fa4-d8987868c2ce",
"version": 3,
"crypto": {
"cipher": "aes-128-ctr",
"cipherparams": {
"iv": "a874e6fe50a5bb088826c45560dc1b7e"
},
"ciphertext": "2383c6aa50c744b6558e77b5dcec6137f647c81f10f71f22a87321fd1306056c",
"kdf": "pbkdf2",
"kdfparams": {
"c": 10240,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "eca6ccc9fbb0bdc3a516c7576808ba5031669e6878f3bb95624ddb46449e119c"
},
"mac": "14e9a33a45ae32f88a0bd5aac14521c1fcf14f56fd55c1a1c080b2f81ddb8d44"
},
"address": "068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0",
"name": "",
"meta": "{}"
}

View File

@ -0,0 +1,22 @@
{
"id": "ce455fdd-11fd-5a71-0a31-9d0bec6a605d",
"version": 3,
"crypto": {
"cipher": "aes-128-ctr",
"cipherparams": {
"iv": "56b27c187d45aab59377869042b948aa"
},
"ciphertext": "c774b879793e2e54b85071d929cc7fbb11b47f6bab6e590edf3997fe4373eaf8",
"kdf": "pbkdf2",
"kdfparams": {
"c": 10240,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "33b3b99e4c6f7f6d7d804555d40c08e4a2acba20e1e46aca712c82c3b9bab749"
},
"mac": "10ee295ce6b1553887413f0e717ccedc1bddb62572bb9208ec3bd091085990db"
},
"address": "a99d43d86a0758d5632313b8fa3972b6088a21bb",
"name": "",
"meta": "{}"
}

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run.
export DEPLOY_CONTRACTS="true"
export DEPLOY_CONTRACTS="false"
# Ganache specific option, these two options have no effect when not running ganache-cli
export GANACHE_DATABASE_PATH="."
export REUSE_DATABASE="false"
@ -9,6 +9,7 @@ export REUSE_DATABASE="false"
export KEEPER_NETWORK_NAME="ganache"
export ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts
export PROJECT_NAME="ocean"
export BRIZO_ENV_FILE=./brizo.env
# colors
COLOR_R="\033[0;31m" # red
@ -29,8 +30,8 @@ function show_banner {
show_banner
# default to stable versions
export OCEAN_VERSION=stable
# default to latest versions
export OCEAN_VERSION=latest
COMPOSE_FILE='docker-compose.yml'
while :; do
@ -52,8 +53,9 @@ while :; do
COMPOSE_FILE='docker-compose-local-parity-node.yml'
printf $COLOR_Y'Starting with local Parity node...\n\n'$COLOR_RESET
;;
--clean-all)
--purge)
docker network rm $PROJECT_NAME_backend || true
docker network rm $PROJECT_NAME_default || true
docker volume rm $PROJECT_NAME_parity-node || true
docker volume rm $PROJECT_NAME_secret-store || true
read -p "Are you sure you want to delete $ARTIFACTS_FOLDER? " -n 1 -r
@ -64,13 +66,13 @@ while :; do
fi
;;
--) # End of all options.
shift
break
;;
shift
break
;;
-?*)
printf $COLOR_R'WARN: Unknown option (ignored): %s\n'$COLOR_RESET "$1" >&2
break
;;
printf $COLOR_R'WARN: Unknown option (ignored): %s\n'$COLOR_RESET "$1" >&2
break
;;
*)
printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET
docker-compose --project-name=$PROJECT_NAME -f $COMPOSE_FILE up