Skip to content

Commit

Permalink
docker compose instead of docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Aug 24, 2024
1 parent a73f483 commit 967a893
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 71 deletions.
7 changes: 6 additions & 1 deletion docker-compose-no-bind-volumes.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Complete joystream development network
version: '3.4'
services:
joystream-node:
image: joystream/node:$JOYSTREAM_NODE_TAG
Expand Down Expand Up @@ -37,6 +36,9 @@ services:
- ACCOUNT_URI=${COLOSSUS_1_TRANSACTOR_URI}
# - OTEL_EXPORTER_OTLP_ENDPOINT=http://apm-server:8200
# - OTEL_RESOURCE_ATTRIBUTES=service.name=colossus-1,deployment.environment=production
- AWS_BUCKET_NAME=test-bucket-1
- LOCALSTACK_ENDPOINT=${LOCALSTACK_ENDPOINT}
- LOCALSTACK_ENABLED=${LOCALSTACK_ENABLED}
entrypoint: ['yarn']
command: [
'start', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data/uploads',
Expand Down Expand Up @@ -106,6 +108,9 @@ services:
environment:
# ACCOUNT_URI overrides command line arg --accountUri
- ACCOUNT_URI=${COLOSSUS_2_TRANSACTOR_URI}
- AWS_BUCKET_NAME=test-bucket-2
- LOCALSTACK_ENDPOINT=${LOCALSTACK_ENDPOINT}
- LOCALSTACK_ENABLED=${LOCALSTACK_ENABLED}
entrypoint: ['yarn', 'storage-node']
command: [
'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data/uploads',
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
# Ref: https://www.elastic.co/guide/en/elasticsearch/reference/8.7/docker.html
elasticsearch:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.localstack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.4'
services:
localstack:
container_name: local_stack
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.storage-squid.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
squid_db:
container_name: squid_db
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Complete joystream development network
version: '3.4'
services:
joystream-node:
image: joystream/node:$JOYSTREAM_NODE_TAG
Expand Down Expand Up @@ -256,7 +255,7 @@ services:
"
indexer:
image: joystream/hydra-indexer:v5.0.0-alpha.8
image: hydra-indexer
container_name: indexer
restart: unless-stopped
env_file:
Expand All @@ -278,7 +277,7 @@ services:
sh -c "yarn db:bootstrap && yarn start:prod"
hydra-indexer-gateway:
image: joystream/hydra-indexer-gateway:5.0.0-alpha.8
image: hydra-indexer-gateway
container_name: hydra-indexer-gateway
restart: unless-stopped
env_file:
Expand Down
12 changes: 6 additions & 6 deletions query-node/kill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd $SCRIPT_PATH

# Only remove query-node related services
docker-compose -f ../docker-compose.yml rm -vsf processor
docker-compose -f ../docker-compose.yml rm -vsf graphql-server
docker-compose -f ../docker-compose.yml rm -vsf indexer
docker-compose -f ../docker-compose.yml rm -vsf hydra-indexer-gateway
docker-compose -f ../docker-compose.yml rm -vsf redis
docker-compose -f ../docker-compose.yml rm -vsf db
docker compose -f ../docker-compose.yml rm -vsf processor
docker compose -f ../docker-compose.yml rm -vsf graphql-server
docker compose -f ../docker-compose.yml rm -vsf indexer
docker compose -f ../docker-compose.yml rm -vsf hydra-indexer-gateway
docker compose -f ../docker-compose.yml rm -vsf redis
docker compose -f ../docker-compose.yml rm -vsf db
docker volume rm joystream_query-node-data
4 changes: 2 additions & 2 deletions query-node/reset-processor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd $SCRIPT_PATH

docker-compose -f ../docker-compose.yml rm -vsf processor
docker-compose -f ../docker-compose.yml rm -vsf graphql-server
docker compose -f ../docker-compose.yml rm -vsf processor
docker compose -f ../docker-compose.yml rm -vsf graphql-server
docker exec db psql -U postgres -c "DROP DATABASE query_node_processor;"
./start.sh
10 changes: 5 additions & 5 deletions query-node/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ cd $SCRIPT_PATH
[ ! -d "generated/" ] && yarn build

# Bring up db
docker-compose -f ../docker-compose.yml up -d db
docker compose -f ../docker-compose.yml up -d db
echo "Waiting for the db to be ready..."
sleep 5

# Start indexer and gateway
docker-compose -f ../docker-compose.yml up -d indexer
docker-compose -f ../docker-compose.yml up -d hydra-indexer-gateway
docker compose -f ../docker-compose.yml up -d indexer
docker compose -f ../docker-compose.yml up -d hydra-indexer-gateway

# Start processor
docker-compose -f ../docker-compose.yml up -d processor
docker compose -f ../docker-compose.yml up -d processor
echo "Waiting for processor to be ready..." && sleep 30
if [[ "$OSTYPE" == "darwin"* ]]; then
# On Docker Desktop things take a bit longer to startup
sleep 150
fi

# Start graphql-server
docker-compose -f ../docker-compose.yml up -d graphql-server
docker compose -f ../docker-compose.yml up -d graphql-server
echo "Waiting for graphql-server to be ready..." && sleep 30
6 changes: 3 additions & 3 deletions scripts/save-to-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -e

# clean start
docker-compose -f ../docker-compose.yml down -v
docker compose -f ../docker-compose.yml down -v

function cleanup() {
docker-compose -f ../docker-compose.yml down -v
docker compose -f ../docker-compose.yml down -v
}

trap cleanup EXIT
Expand All @@ -21,7 +21,7 @@ if [[ -z $JOYSTREAM_NODE_TAG ]]; then
fi

# start node image, network and volume
docker-compose -f ../docker-compose.yml up -d joystream-node
docker compose -f ../docker-compose.yml up -d joystream-node

# copy native runtime
docker cp ../target/release/joystream-node joystream-node:/joystream/node
Expand Down
14 changes: 7 additions & 7 deletions start-elasticsearch-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ ELASTIC_USERNAME=${ELASTIC_USERNAME:="elastic"}
ELASTIC_PASSWORD=${ELASTIC_PASSWORD:="password"}

# Remove elasticsearch stack containers & volumes
docker-compose -f ./docker-compose.elasticsearch.yml down -v
docker compose -f ./docker-compose.elasticsearch.yml down -v

# Run docker-compose to start elasticsearch container
docker-compose -f ./docker-compose.elasticsearch.yml up -d elasticsearch
# Run docker compose to start elasticsearch container
docker compose -f ./docker-compose.elasticsearch.yml up -d elasticsearch

echo 'Waiting for Elasticsearch...'

Expand Down Expand Up @@ -46,10 +46,10 @@ export ELASTICSEARCH_SERVICEACCOUNTTOKEN=$(echo $response_body | jq -r '.token.v

echo 'Starting for Kibana...'

## Run docker-compose to start kibana container
docker-compose -f ./docker-compose.elasticsearch.yml up -d kibana
## Run docker compose to start kibana container
docker compose -f ./docker-compose.elasticsearch.yml up -d kibana

echo 'Starting APM Server...'

## Run docker-compose to start apm-server container
docker-compose -f ./docker-compose.elasticsearch.yml up -d apm-server
## Run docker compose to start apm-server container
docker compose -f ./docker-compose.elasticsearch.yml up -d apm-server
20 changes: 10 additions & 10 deletions start-multistorage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ else
function down()
{
# Stop containers and clear volumes
docker-compose -f ./docker-compose.storage-squid.yml down -v
docker-compose down -v
docker compose -f ./docker-compose.storage-squid.yml down -v
docker compose down -v
}

trap down EXIT ERR SIGINT SIGTERM
Expand All @@ -34,7 +34,7 @@ fi
if [ "${SKIP_NODE}" != true ]
then
## Run a local development chain
docker-compose up -d joystream-node
docker compose up -d joystream-node
fi

## Query Node Infrastructure
Expand All @@ -44,7 +44,7 @@ fi
./start-orion.sh

## Storage Squid
docker-compose -f ./docker-compose.storage-squid.yml up -d
docker compose -f ./docker-compose.storage-squid.yml up -d

## Init the chain with some state
if [[ $SKIP_CHAIN_SETUP != 'true' ]]; then
Expand All @@ -58,19 +58,19 @@ if [[ $SKIP_CHAIN_SETUP != 'true' ]]; then

## Member faucet
export INVITER_KEY=`cat ./tests/network-tests/output.json | jq -r .faucet.suri`
docker-compose up -d faucet
docker compose up -d faucet

## Storage Infrastructure Nodes
docker-compose up -d colossus-1
docker-compose up -d distributor-1
docker-compose up -d colossus-2
docker-compose up -d distributor-2
docker compose up -d colossus-1
docker compose up -d distributor-1
docker compose up -d colossus-2
docker compose up -d distributor-2
fi

if [ "${PERSIST}" == true ]
then
echo "All services started in the background"
echo "Remember to run 'docker-compose down -v' to kill all docker services before starting new playground."
echo "Remember to run 'docker compose down -v' to kill all docker services before starting new playground."
else
echo "use Ctrl+C to shutdown the development network."
while true; do
Expand Down
16 changes: 8 additions & 8 deletions start-orion.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
set -e

docker-compose up -d orion-db
docker-compose up -d orion-processor
docker-compose up -d orion-graphql-api
docker-compose up -d orion-auth-api
docker-compose up -d squid-archive-ingest
docker-compose up -d squid-archive-db
docker-compose up -d squid-archive-gateway
docker-compose up -d squid-archive-explorer
docker compose up -d orion-db
docker compose up -d orion-processor
docker compose up -d orion-graphql-api
docker compose up -d orion-auth-api
docker compose up -d squid-archive-ingest
docker compose up -d squid-archive-db
docker compose up -d squid-archive-gateway
docker compose up -d squid-archive-explorer
16 changes: 8 additions & 8 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ else
function down()
{
# Stop containers and clear volumes
docker-compose -f ./docker-compose.storage-squid.yml down -v
docker-compose down -v
docker compose -f ./docker-compose.storage-squid.yml down -v
docker compose down -v
}

trap down EXIT ERR SIGINT SIGTERM
Expand All @@ -36,7 +36,7 @@ fi
if [ "${SKIP_NODE}" != true ]
then
## Run a local development chain
docker-compose up -d joystream-node
docker compose up -d joystream-node
fi

## Query Node Infrastructure
Expand All @@ -46,7 +46,7 @@ fi
./start-orion.sh

## Storage Squid
docker-compose -f ./docker-compose.storage-squid.yml up -d
docker compose -f ./docker-compose.storage-squid.yml up -d

## Init the chain with some state
if [[ $SKIP_CHAIN_SETUP != true ]]; then
Expand All @@ -58,17 +58,17 @@ if [[ $SKIP_CHAIN_SETUP != true ]]; then

## Member faucet
export INVITER_KEY=`cat ./tests/network-tests/output.json | jq -r .faucet.suri`
docker-compose up -d faucet
docker compose up -d faucet

## Storage Infrastructure Nodes
docker-compose up -d colossus-1
docker-compose up -d distributor-1
docker compose up -d colossus-1
docker compose up -d distributor-1
fi

if [ "${PERSIST}" == true ]
then
echo "All services started in the background"
echo "Remember to run 'docker-compose down -v' to kill all docker services before starting new playground."
echo "Remember to run 'docker compose down -v' to kill all docker services before starting new playground."
else
echo "use Ctrl+C to shutdown the development network."
while true; do
Expand Down
2 changes: 1 addition & 1 deletion tests/network-tests/run-node-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ docker run --pull never --rm -v ${DATA_PATH}:/spec joystream/node:${RUNTIME} bui

# Start a chain with generated chain spec
export JOYSTREAM_NODE_TAG=${RUNTIME}
docker-compose -p joystream -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec --name joystream-node \
docker compose -p joystream -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec --name joystream-node \
--service-ports joystream-node \
--alice --validator --unsafe-ws-external --unsafe-rpc-external \
--rpc-methods Unsafe --rpc-cors=all -l runtime \
Expand Down
4 changes: 2 additions & 2 deletions tests/network-tests/run-runtime-upgrade-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function create_raw_chain_spec() {

# Start a chain with generated chain spec
function start_joystream_node {
docker-compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec \
docker compose -f ../../docker-compose.yml run -d -v ${DATA_PATH}:/spec \
--name joystream-node \
-p 9944:9944 -p 9933:9933 joystream-node \
--validator --unsafe-ws-external --unsafe-rpc-external \
Expand Down Expand Up @@ -140,7 +140,7 @@ function init_chain_db() {
# if the initial state is large.
# exporting should give some essential tasks errors but they are harmless https://github.com/paritytech/substrate/issues/10583
echo >&2 "exporting state"
docker-compose -f ../../docker-compose.yml run --rm \
docker compose -f ../../docker-compose.yml run --rm \
-v ${DATA_PATH}:/spec joystream-node export-state \
--chain /spec/chain-spec-forked.json \
--base-path /data --pruning archive >${DATA_PATH}/exported-state.json
Expand Down
6 changes: 3 additions & 3 deletions tests/network-tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function cleanup() {
docker logs colossus-2 --tail 100 || :

if [ "${NO_STORAGE}" != true ]; then
docker-compose -f ../../docker-compose.storage-squid.yml down -v
docker-compose -f ../../docker-compose.localstack.yml down -v
docker compose -f ../../docker-compose.storage-squid.yml down -v
docker compose -f ../../docker-compose.localstack.yml down -v
fi

docker-compose -f ../../docker-compose.yml down -v
docker compose -f ../../docker-compose.yml down -v
}

trap cleanup EXIT ERR SIGINT SIGTERM
Expand Down
12 changes: 6 additions & 6 deletions tests/network-tests/start-storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ THIS_DIR=$(dirname $TMP)
echo "Staring storage infrastructure"

# Start Storage-Squid
docker-compose -f $THIS_DIR/../../docker-compose.storage-squid.yml up -d
docker compose -f $THIS_DIR/../../docker-compose.storage-squid.yml up -d

HOST_IP=`$THIS_DIR/get-host-ip.sh`
export COLOSSUS_1_URL="http://${HOST_IP}:3333"
Expand All @@ -24,7 +24,7 @@ sleep 30
export LOCALSTACK_ENABLED=true
export LOCALSTACK_HOST="${HOST_IP}:4566"
export LOCALSTACK_ENDPOINT="http://${LOCALSTACK_HOST}"
docker-compose -f $THIS_DIR/../../docker-compose.localstack.yml up -d localstack && sleep 15
docker compose -f $THIS_DIR/../../docker-compose.localstack.yml up -d localstack && sleep 15
python3 -m venv .venv
pip install awscli-local
source .venv/bin/activate
Expand All @@ -33,10 +33,10 @@ awslocal s3api create-bucket --bucket test-bucket-2 --endpoint ${LOCALSTACK_ENDP
deactivate

# Start colossus & argus
docker-compose -f $THIS_DIR/../../docker-compose.yml up -d colossus-1
docker-compose -f $THIS_DIR/../../docker-compose.yml up -d distributor-1
docker-compose -f $THIS_DIR/../../docker-compose.yml up -d colossus-2
docker-compose -f $THIS_DIR/../../docker-compose.yml up -d distributor-2
docker compose -f $THIS_DIR/../../docker-compose.yml up -d colossus-1
docker compose -f $THIS_DIR/../../docker-compose.yml up -d distributor-1
docker compose -f $THIS_DIR/../../docker-compose.yml up -d colossus-2
docker compose -f $THIS_DIR/../../docker-compose.yml up -d distributor-2

# allow a few seconds for nodes to startup and display first few log entries
# to help debug tests
Expand Down
2 changes: 1 addition & 1 deletion tests/network-tests/test-setup-new-chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function cleanup() {
docker logs ${CONTAINER_ID} --tail 15
docker stop ${CONTAINER_ID}
docker rm ${CONTAINER_ID}
docker-compose -f ../../docker-compose.yml down -v
docker compose -f ../../docker-compose.yml down -v
}

trap cleanup EXIT ERR SIGINT SIGTERM
Expand Down

0 comments on commit 967a893

Please sign in to comment.