diff --git a/tools/docker-network/docker-compose.yml b/tools/docker-network/docker-compose.yml index 205037762..8aa1df43c 100644 --- a/tools/docker-network/docker-compose.yml +++ b/tools/docker-network/docker-compose.yml @@ -36,6 +36,9 @@ services: --prometheus.goMetrics=true --prometheus.processMetrics=true --debugAPI.enabled=true + profiles: + - minimal + - full node-2-validator: image: docker-network-node-1-validator:latest @@ -68,6 +71,8 @@ services: --inx.bindAddress=0.0.0.0:9029 --prometheus.goMetrics=true --prometheus.processMetrics=true + profiles: + - full node-3-validator: image: docker-network-node-1-validator:latest @@ -100,6 +105,8 @@ services: --inx.bindAddress=0.0.0.0:9029 --prometheus.goMetrics=true --prometheus.processMetrics=true + profiles: + - full node-4-validator: image: docker-network-node-1-validator:latest @@ -130,6 +137,8 @@ services: --node.alias=node-4-validator --inx.enabled=true --inx.bindAddress=0.0.0.0:9029 + profiles: + - full node-5: image: docker-network-node-1-validator:latest @@ -162,6 +171,8 @@ services: --inx.bindAddress=0.0.0.0:9029 --prometheus.goMetrics=true --prometheus.processMetrics=true + profiles: + - full node-6: image: docker-network-node-1-validator:latest @@ -194,6 +205,8 @@ services: --inx.bindAddress=0.0.0.0:9029 --prometheus.goMetrics=true --prometheus.processMetrics=true + profiles: + - full ################################################################## # Monitoring # @@ -255,6 +268,9 @@ services: --inx.address=node-1-validator:9029 --restAPI.bindAddress=0.0.0.0:9091 --restAPI.advertiseAddress=inx-indexer:9091 + profiles: + - minimal + - full inx-mqtt: image: iotaledger/inx-mqtt:2.0-alpha @@ -268,6 +284,9 @@ services: command: > --inx.address=node-1-validator:9029 --mqtt.websocket.bindAddress=inx-mqtt:1888 + profiles: + - minimal + - full inx-blockissuer: image: iotaledger/inx-blockissuer:1.0-alpha @@ -287,6 +306,9 @@ services: --restAPI.bindAddress=inx-blockissuer:9086 --blockIssuer.accountAddress=rms1prkursay9fs2qjmfctamd6yxg9x8r3ry47786x0mvwek4qr9xd9d5c6gkun --blockIssuer.proofOfWork.targetTrailingZeros=5 + profiles: + - minimal + - full inx-faucet: image: iotaledger/inx-faucet:2.0-alpha @@ -314,6 +336,9 @@ services: --faucet.baseTokenAmountMaxTarget=5000000000 --faucet.manaAmount=100000000 --faucet.manaAmountMinFaucet=1000000000 + profiles: + - minimal + - full inx-validator-1: image: iotaledger/inx-validator:1.0-alpha @@ -332,6 +357,9 @@ services: --validator.ignoreBootstrapped=true --validator.accountAddress=rms1pzg8cqhfxqhq7pt37y8cs4v5u4kcc48lquy2k73ehsdhf5ukhya3y5rx2w6 --validator.issueCandidacyPayload=${ISSUE_CANDIDACY_PAYLOAD_V1:-true} + profiles: + - minimal + - full inx-validator-2: image: iotaledger/inx-validator:1.0-alpha @@ -349,6 +377,8 @@ services: --inx.address=node-2-validator:9029 --validator.accountAddress=rms1pqm4xk8e9ny5w5rxjkvtp249tfhlwvcshyr3pc0665jvp7g3hc875k538hl --validator.issueCandidacyPayload=${ISSUE_CANDIDACY_PAYLOAD_V2:-true} + profiles: + - full inx-validator-3: image: iotaledger/inx-validator:1.0-alpha @@ -366,6 +396,8 @@ services: --inx.address=node-3-validator:9029 --validator.accountAddress=rms1pp4wuuz0y42caz48vv876qfpmffswsvg40zz8v79sy8cp0jfxm4kunflcgt --validator.issueCandidacyPayload=${ISSUE_CANDIDACY_PAYLOAD_V3:-true} + profiles: + - full inx-validator-4: image: iotaledger/inx-validator:1.0-alpha @@ -383,6 +415,8 @@ services: --inx.address=node-4-validator:9029 --validator.accountAddress=rms1pr8cxs3dzu9xh4cduff4dd4cxdthpjkpwmz2244f75m0urslrsvtsshrrjw --validator.issueCandidacyPayload=${ISSUE_CANDIDACY_PAYLOAD_V4:-true} + profiles: + - full inx-dashboard-1: container_name: inx-dashboard-1 @@ -402,6 +436,9 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - minimal + - full inx-dashboard-2: container_name: inx-dashboard-2 @@ -421,6 +458,8 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - full inx-dashboard-3: container_name: inx-dashboard-3 @@ -440,6 +479,8 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - full inx-dashboard-4: container_name: inx-dashboard-4 @@ -459,6 +500,8 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - full inx-dashboard-5: container_name: inx-dashboard-5 @@ -478,6 +521,8 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - full inx-dashboard-6: container_name: inx-dashboard-6 @@ -497,6 +542,8 @@ services: - "--dashboard.auth.username=${DASHBOARD_USERNAME:-admin}" - "--dashboard.auth.passwordHash=${DASHBOARD_PASSWORD:-0000000000000000000000000000000000000000000000000000000000000000}" - "--dashboard.auth.passwordSalt=${DASHBOARD_SALT:-0000000000000000000000000000000000000000000000000000000000000000}" + profiles: + - full # Create our own network networks: diff --git a/tools/docker-network/run.sh b/tools/docker-network/run.sh index 396c6b9ff..fda5a9d75 100755 --- a/tools/docker-network/run.sh +++ b/tools/docker-network/run.sh @@ -3,13 +3,30 @@ # Create a function to join an array of strings by a given character function join { local IFS="$1"; shift; echo "$*"; } -# All parameters can be optional now, just make sure we don't have too many -if [[ $# -gt 2 ]] ; then - echo 'Call with ./run.sh [monitoring=0|1]' - exit 0 -fi - -MONITORING=${1:-0} +# Initialize variables +MONITORING=0 +MINIMAL=0 + +# Loop over all arguments +for arg in "$@" +do + case $arg in + monitoring=*) + MONITORING="${arg#*=}" + shift + ;; + minimal=*) + MINIMAL="${arg#*=}" + shift + ;; + *) + # Unknown option + echo "Unknown argument: $arg" + echo 'Call with ./run.sh [monitoring=0|1] [minimal=0|1]' + exit 1 + ;; + esac +done export DOCKER_BUILDKIT=1 export COMPOSE_DOCKER_CLI_BUILD=1 @@ -66,13 +83,21 @@ fi chmod o+r docker-network-snapshots/snapshot.bin echo "Run iota-core network" -# IOTA_CORE_PEER_REPLICAS is used in docker-compose.yml to determine how many replicas to create -export IOTA_CORE_PEER_REPLICAS=$REPLICAS + # Profiles is created to set which docker profiles to run # https://docs.docker.com/compose/profiles/ PROFILES=() if [ $MONITORING -ne 0 ]; then PROFILES+=("monitoring") + echo "Monitoring profile active" +fi + +if [ $MINIMAL -ne 0 ]; then + PROFILES+=("minimal") + echo "Minimal profile active" +else + PROFILES+=("full") + echo "Full profile active" fi export COMPOSE_PROFILES=$(join , ${PROFILES[@]})