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

Consolidate Aquarius compose files #221

Merged
merged 4 commits into from
Oct 13, 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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ ganache-db/
# Emacs
*~

# mutable secret store config (Issue #126)
networks/secret-store/config/config.toml

# Mac OS Filesystem artifacts
.DS_Store
**/.DS_Store
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export AQUARIUS_VERSION=v2.0.0
| `--no-provider` | Start up Ocean without the `provider` Building Block. |
| `--no-ganache` | Start up Ocean without the `ganache` Building Block. |
| `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. |
| `--mongodb` | Start up Ocean with MongoDB as DB engine for Aquarius instead of Elasticsearch. |
| `--force-pull` | Force pulling the latest revision of the used Docker images. |
| `--purge` | Removes the Docker containers, volumes, artifact folder and networks used by the script. |
| `--exposeip` | Binds the components to that specific ip. Example: `./start_ocean.sh --exposeip 192.168.0.1` |
Expand All @@ -96,15 +95,14 @@ Barge consists of a set of building blocks that can be combined to form a local

### Aquarius

By default it will start two containers (one for Aquarius and one for its database engine). By default, Barge will use Elasticsearch for its database engine. You can use the `--mongodb` option to use MongoDB instead.
By default it will start two containers (one for Aquarius and one for its database engine). By default, Barge will use Elasticsearch for its database engine.

This Building Block can be disabled by setting the `--no-aquarius` flag.

| Hostname | External Port | Internal URL | Local URL | Description |
| --------------- | ------------- | -------------------- | --------------------- | ----------------------------------------------------- |
| `aquarius` | `5000` | http://aquarius:5000 | http://localhost:5000 | [Aquarius](https://github.com/oceanprotocol/aquarius) |
| `elasticsearch` | | | | The Elasticsearch used by Aquarius |
| `mongodb` | | | | The MongoDB used by Aquarius |

### Provider

Expand Down
18 changes: 14 additions & 4 deletions compose-files/aquarius.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
version: '3'
services:
elasticsearch:
image: elasticsearch:6.8.3
networks:
backend:
ipv4_address: 172.15.0.6
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
MAX_MAP_COUNT: "64000"
discovery.type: "single-node"

aquarius:
image: oceanprotocol/aquarius:$AQUARIUS_VERSION
image: oceanprotocol/aquarius:${AQUARIUS_VERSION:-stable}
ports:
- 5000:5000
- 5000:5000
networks:
backend:
ipv4_address: 172.15.0.5
depends_on:
- elasticsearch
- ocean-contracts
environment:
DB_MODULE: ${DB_MODULE}
Expand All @@ -23,12 +34,11 @@ services:
LOG_LEVEL: DEBUG
EVENTS_ECIES_PRIVATE_KEY: "0x5d75837394b078ce97bc289fa8d75e21000573520bfa7784a9d28ccaae602bf8"
ARTIFACTS_PATH: "/ocean-contracts/artifacts"
ADDRESS_FILE: ${OCEAN_ADDRESS_FILE:-/ocean-contracts/artifacts/address.json}
ADDRESS_FILE: "/ocean-contracts/artifacts/address.json"
DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS}
NETWORK_NAME: ${CONTRACTS_NETWORK_NAME}
EVENTS_RPC: "http://172.15.0.3:8545"
EVENTS_ALLOW: "0"
RUN_EVENTS_MONITOR: "1"

volumes:
- ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/
44 changes: 0 additions & 44 deletions compose-files/aquarius_elasticsearch.yml

This file was deleted.

21 changes: 0 additions & 21 deletions compose-files/aquarius_mongodb.yml

This file was deleted.

21 changes: 5 additions & 16 deletions start_ocean.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019 Ocean Protocol contributors
# Copyright (c) 2020 Ocean Protocol contributors
# SPDX-License-Identifier: Apache-2.0
#
# Usage: ./start_ocean.sh
Expand Down Expand Up @@ -90,7 +90,8 @@ fi
export OPERATOR_SERVICE_URL=https://operator-api.operator.dev-ocean.com


#add aquarius to /etc/hosts
# Add aquarius to /etc/hosts
# Workaround mainly for macOS

if [ ${IP} = "localhost" ]; then
if grep -q "aquarius" /etc/hosts; then
Expand Down Expand Up @@ -156,7 +157,7 @@ show_banner
COMPOSE_FILES=""
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/dashboard.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius_elasticsearch.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ganache.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_contracts.yml"
Expand Down Expand Up @@ -191,26 +192,14 @@ while :; do
printf $COLOR_Y'Starting without Ganache...\n\n'$COLOR_RESET
;;
--no-aquarius)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius_elasticsearch.yml/}"
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius.yml/}"
printf $COLOR_Y'Starting without Aquarius...\n\n'$COLOR_RESET
;;
--no-dashboard)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/dashboard.yml/}"
printf $COLOR_Y'Starting without Dashboard ...\n\n'$COLOR_RESET
;;
#################################################
# MongoDB
#################################################
--mongodb)
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius_mongodb.yml"
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius_elasticsearch.yml/}"
CHECK_ELASTIC_VM_COUNT=false
export DB_MODULE="mongodb"
export DB_HOSTNAME="mongodb"
export DB_PORT="27017"
printf $COLOR_Y'Starting with MongoDB...\n\n'$COLOR_RESET
;;
#################################################
# Cleaning switches
#################################################
--purge)
Expand Down