From 3b1478aeba2a01754cf01c57c3f198192376a1e8 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Wed, 2 Aug 2023 21:34:03 +0000 Subject: [PATCH 01/10] Add .gitignore to protect line endings of *.bash files --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9a24f57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.bash eol=lf From b3b8b4813205916eb9015e97854b888ab82bce86 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Wed, 2 Aug 2023 21:34:24 +0000 Subject: [PATCH 02/10] Add bash scripts for 01_postgres --- 01_postgres/down.bash | 6 ++++++ 01_postgres/up.bash | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100755 01_postgres/down.bash create mode 100755 01_postgres/up.bash diff --git a/01_postgres/down.bash b/01_postgres/down.bash new file mode 100755 index 0000000..fc0bc11 --- /dev/null +++ b/01_postgres/down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose down \ No newline at end of file diff --git a/01_postgres/up.bash b/01_postgres/up.bash new file mode 100755 index 0000000..e856240 --- /dev/null +++ b/01_postgres/up.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting PostgreSQL..." +docker compose up --detach + +>&2 echo "Connecting to the CLI as postgres..." +docker exec -it 7dbs_postgres_db psql -U postgres -W --dbname=7dbs From bb970c872d83a3dcdc5dddd2b43b55f4da8708eb Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Wed, 2 Aug 2023 21:34:51 +0000 Subject: [PATCH 03/10] Add bash scripts for 02_postgres --- 02_hbase/cluster_down.bash | 6 ++++++ 02_hbase/cluster_setup.bash | 8 ++++++++ 02_hbase/cluster_teardown.bash | 8 ++++++++ 02_hbase/cluster_up.bash | 12 ++++++++++++ 02_hbase/local_down.bash | 12 ++++++++++++ 02_hbase/local_up.bash | 10 ++++++++++ 6 files changed, 56 insertions(+) create mode 100755 02_hbase/cluster_down.bash create mode 100755 02_hbase/cluster_setup.bash create mode 100755 02_hbase/cluster_teardown.bash create mode 100755 02_hbase/cluster_up.bash create mode 100755 02_hbase/local_down.bash create mode 100755 02_hbase/local_up.bash diff --git a/02_hbase/cluster_down.bash b/02_hbase/cluster_down.bash new file mode 100755 index 0000000..2f18608 --- /dev/null +++ b/02_hbase/cluster_down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose -f docker-images/docker-compose-distributed-local.yml down diff --git a/02_hbase/cluster_setup.bash b/02_hbase/cluster_setup.bash new file mode 100755 index 0000000..e2e8753 --- /dev/null +++ b/02_hbase/cluster_setup.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker volume create --name=hadoop_namenode +docker volume create --name=hadoop_datanode +docker volume create --name=hadoop_historyserver \ No newline at end of file diff --git a/02_hbase/cluster_teardown.bash b/02_hbase/cluster_teardown.bash new file mode 100755 index 0000000..95d4396 --- /dev/null +++ b/02_hbase/cluster_teardown.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker volume rm hadoop_namenode +docker volume rm hadoop_datanode +docker volume rm hadoop_historyserver \ No newline at end of file diff --git a/02_hbase/cluster_up.bash b/02_hbase/cluster_up.bash new file mode 100755 index 0000000..9dc048b --- /dev/null +++ b/02_hbase/cluster_up.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting HBase (local cluster)..." +docker-compose -f docker-images/docker-compose-distributed-local.yml up --detach + +# Connect to HBase shell +>&2 echo "To connect to the shell: /opt/hbase-1.2.6/bin/hbase shell" +>&2 echo "To access scripts: /tmp/scripts/" +docker exec -it hbase-master /bin/bash \ No newline at end of file diff --git a/02_hbase/local_down.bash b/02_hbase/local_down.bash new file mode 100755 index 0000000..cb232fc --- /dev/null +++ b/02_hbase/local_down.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose -f docker-images/docker-compose-standalone.yml down + +docker volume rm docker-hbase_hadoop_namenode +docker volume rm docker-hbase_hadoop_datanode +docker volume rm docker-hbase_hadoop_historyserver +docker volume rm docker-hbase_hbase_data +docker volume rm docker-hbase_hbase_zookeeper_data diff --git a/02_hbase/local_up.bash b/02_hbase/local_up.bash new file mode 100755 index 0000000..da7ed3c --- /dev/null +++ b/02_hbase/local_up.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting HBase (local standalone)..." +docker-compose -f docker-images/docker-compose-standalone.yml up --detach + +# Connect to HBase shell +docker exec -it hbase /opt/hbase-1.2.6/bin/hbase shell \ No newline at end of file From 0fd7de91ed4cc0928c9d07c54a3d443a2f1128e5 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Wed, 2 Aug 2023 21:45:43 +0000 Subject: [PATCH 04/10] Add EOL to last line of Bash files --- 01_postgres/down.bash | 2 +- 02_hbase/cluster_setup.bash | 2 +- 02_hbase/cluster_teardown.bash | 2 +- 02_hbase/cluster_up.bash | 2 +- 02_hbase/local_up.bash | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/01_postgres/down.bash b/01_postgres/down.bash index fc0bc11..db5a021 100755 --- a/01_postgres/down.bash +++ b/01_postgres/down.bash @@ -3,4 +3,4 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" cd "${SCRIPT_DIR}" -docker-compose down \ No newline at end of file +docker-compose down diff --git a/02_hbase/cluster_setup.bash b/02_hbase/cluster_setup.bash index e2e8753..316b8d2 100755 --- a/02_hbase/cluster_setup.bash +++ b/02_hbase/cluster_setup.bash @@ -5,4 +5,4 @@ cd "${SCRIPT_DIR}" docker volume create --name=hadoop_namenode docker volume create --name=hadoop_datanode -docker volume create --name=hadoop_historyserver \ No newline at end of file +docker volume create --name=hadoop_historyserver diff --git a/02_hbase/cluster_teardown.bash b/02_hbase/cluster_teardown.bash index 95d4396..699b2f2 100755 --- a/02_hbase/cluster_teardown.bash +++ b/02_hbase/cluster_teardown.bash @@ -5,4 +5,4 @@ cd "${SCRIPT_DIR}" docker volume rm hadoop_namenode docker volume rm hadoop_datanode -docker volume rm hadoop_historyserver \ No newline at end of file +docker volume rm hadoop_historyserver diff --git a/02_hbase/cluster_up.bash b/02_hbase/cluster_up.bash index 9dc048b..000d0f5 100755 --- a/02_hbase/cluster_up.bash +++ b/02_hbase/cluster_up.bash @@ -9,4 +9,4 @@ docker-compose -f docker-images/docker-compose-distributed-local.yml up --detach # Connect to HBase shell >&2 echo "To connect to the shell: /opt/hbase-1.2.6/bin/hbase shell" >&2 echo "To access scripts: /tmp/scripts/" -docker exec -it hbase-master /bin/bash \ No newline at end of file +docker exec -it hbase-master /bin/bash diff --git a/02_hbase/local_up.bash b/02_hbase/local_up.bash index da7ed3c..f1adb2b 100755 --- a/02_hbase/local_up.bash +++ b/02_hbase/local_up.bash @@ -7,4 +7,4 @@ cd "${SCRIPT_DIR}" docker-compose -f docker-images/docker-compose-standalone.yml up --detach # Connect to HBase shell -docker exec -it hbase /opt/hbase-1.2.6/bin/hbase shell \ No newline at end of file +docker exec -it hbase /opt/hbase-1.2.6/bin/hbase shell From 3ff22a9b3e469f43338995a2b47a68b59243acc7 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Wed, 2 Aug 2023 21:55:12 +0000 Subject: [PATCH 05/10] Add bash scripts for 03_mongodb --- 03_mongodb/cluster_down.bash | 6 ++++++ 03_mongodb/cluster_up.bash | 11 +++++++++++ 03_mongodb/local_down.bash | 6 ++++++ 03_mongodb/local_up.bash | 14 ++++++++++++++ 4 files changed, 37 insertions(+) create mode 100755 03_mongodb/cluster_down.bash create mode 100755 03_mongodb/cluster_up.bash create mode 100755 03_mongodb/local_down.bash create mode 100755 03_mongodb/local_up.bash diff --git a/03_mongodb/cluster_down.bash b/03_mongodb/cluster_down.bash new file mode 100755 index 0000000..0691a58 --- /dev/null +++ b/03_mongodb/cluster_down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose -f cluster/mongo-cluster-docker/docker-compose.1.yml -f cluster/mongo-cluster-docker/docker-compose.2.yml -f cluster/mongo-cluster-docker/docker-compose.cnf.yml -f cluster/mongo-cluster-docker/docker-compose.shard.yml -f cluster/docker-compose.gui.yml down diff --git a/03_mongodb/cluster_up.bash b/03_mongodb/cluster_up.bash new file mode 100755 index 0000000..9b62c61 --- /dev/null +++ b/03_mongodb/cluster_up.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose -f cluster/mongo-cluster-docker/docker-compose.1.yml -f cluster/mongo-cluster-docker/docker-compose.2.yml -f cluster/mongo-cluster-docker/docker-compose.cnf.yml -f cluster/mongo-cluster-docker/docker-compose.shard.yml -f cluster/docker-compose.gui.yml up --detach + +# No authentication needed +>&2 echo "Connecting to the CLI..." +sleep 5 +docker exec -it mongo-router mongo diff --git a/03_mongodb/local_down.bash b/03_mongodb/local_down.bash new file mode 100755 index 0000000..fc0bc11 --- /dev/null +++ b/03_mongodb/local_down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker-compose down \ No newline at end of file diff --git a/03_mongodb/local_up.bash b/03_mongodb/local_up.bash new file mode 100755 index 0000000..85dc2aa --- /dev/null +++ b/03_mongodb/local_up.bash @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting MongoDB..." +docker-compose up --detach + +>&2 echo "Opening GUI (mongo-express)" + +>&2 echo "Connecting to the CLI..." +sleep 5 +>&2 echo "Username: mongo; Password: gonmo" +docker exec -it 7dbs_mongo_db mongo --username mongo --password gonmo From 6a57d67645be23406bc0412488b63d086bb9d648 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Thu, 3 Aug 2023 13:16:44 +0000 Subject: [PATCH 06/10] Add bash scripts for 04_couchdb --- 04_couchdb/cluster/cluster_down.bash | 10 ++++++++ 04_couchdb/cluster/cluster_up.bash | 14 +++++++++++ 04_couchdb/cluster/couch-cookie/build.bash | 6 +++++ 04_couchdb/connect_couchdb.bash | 8 +++++++ 04_couchdb/connect_curl.bash | 7 ++++++ 04_couchdb/docker-compose-linux.yml | 27 ++++++++++++++++++++++ 04_couchdb/local_down.bash | 6 +++++ 04_couchdb/local_up.bash | 9 ++++++++ 8 files changed, 87 insertions(+) create mode 100755 04_couchdb/cluster/cluster_down.bash create mode 100755 04_couchdb/cluster/cluster_up.bash create mode 100755 04_couchdb/cluster/couch-cookie/build.bash create mode 100755 04_couchdb/connect_couchdb.bash create mode 100755 04_couchdb/connect_curl.bash create mode 100644 04_couchdb/docker-compose-linux.yml create mode 100755 04_couchdb/local_down.bash create mode 100755 04_couchdb/local_up.bash diff --git a/04_couchdb/cluster/cluster_down.bash b/04_couchdb/cluster/cluster_down.bash new file mode 100755 index 0000000..0b6bbff --- /dev/null +++ b/04_couchdb/cluster/cluster_down.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker compose down + +rm -rf couch1data +rm -rf couch2data +rm -rf couch3data diff --git a/04_couchdb/cluster/cluster_up.bash b/04_couchdb/cluster/cluster_up.bash new file mode 100755 index 0000000..4885b83 --- /dev/null +++ b/04_couchdb/cluster/cluster_up.bash @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +mkdir -p couch1data +mkdir -p couch2data +mkdir -p couch3data + +docker build --file couch-cookie/Dockerfile --tag couch_cluster:latest couch-cookie +docker compose up -d + +sleep 15 +./setup_clustering.sh diff --git a/04_couchdb/cluster/couch-cookie/build.bash b/04_couchdb/cluster/couch-cookie/build.bash new file mode 100755 index 0000000..c4a5f3c --- /dev/null +++ b/04_couchdb/cluster/couch-cookie/build.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker build --tag couch_cluster:latest . \ No newline at end of file diff --git a/04_couchdb/connect_couchdb.bash b/04_couchdb/connect_couchdb.bash new file mode 100755 index 0000000..8950156 --- /dev/null +++ b/04_couchdb/connect_couchdb.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +#docker exec -it 7dbs_couch_db bash + +docker compose --file docker-compose-linux.yml exec couch bash diff --git a/04_couchdb/connect_curl.bash b/04_couchdb/connect_curl.bash new file mode 100755 index 0000000..5804aca --- /dev/null +++ b/04_couchdb/connect_curl.bash @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +# docker run -it --entrypoint sh --network 04_couchdb_default 04_couchdb_firstrun +docker compose --file docker-compose-linux.yml run --entrypoint sh firstrun diff --git a/04_couchdb/docker-compose-linux.yml b/04_couchdb/docker-compose-linux.yml new file mode 100644 index 0000000..4756ce0 --- /dev/null +++ b/04_couchdb/docker-compose-linux.yml @@ -0,0 +1,27 @@ +version: '3.1' + +services: + couch: + container_name: 7dbs_couch_db + hostname: 7dbs_couch_db + image: couchdb:2.3.1 + ports: + - 8084:5984 + restart: always + volumes: + - ./scripts:/tmp + environment: + COUCHDB_USER: couchdb + COUCHDB_PASSWORD: bouchdc + firstrun: + container_name: 7dbs_couch_firstrun + build: + context: couch-firstrun + dockerfile: Dockerfile + depends_on: + - couch + restart: "no" + environment: + COUCHDB_USER: couchdb + COUCHDB_PASSWORD: bouchdc + NODENAME: couch-single \ No newline at end of file diff --git a/04_couchdb/local_down.bash b/04_couchdb/local_down.bash new file mode 100755 index 0000000..4a12fc2 --- /dev/null +++ b/04_couchdb/local_down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker compose --file docker-compose-linux.yml down diff --git a/04_couchdb/local_up.bash b/04_couchdb/local_up.bash new file mode 100755 index 0000000..aa03e93 --- /dev/null +++ b/04_couchdb/local_up.bash @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting CouchDB..." +docker compose --file docker-compose-linux.yml up --detach + +>&2 echo "Opening GUI (Fauxton) at 'http://localhost:8084/_utils/#login'" From 73736461e3520b2a3215a0a871953631dac10565 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Thu, 3 Aug 2023 13:23:47 +0000 Subject: [PATCH 07/10] Add bash scripts for 05_neo4j --- 05_neo4j/.gitignore | 2 ++ 05_neo4j/docker-compose-linux.yml | 16 ++++++++++++++++ 05_neo4j/local_down.bash | 6 ++++++ 05_neo4j/local_up.bash | 11 +++++++++++ 4 files changed, 35 insertions(+) create mode 100644 05_neo4j/.gitignore create mode 100644 05_neo4j/docker-compose-linux.yml create mode 100755 05_neo4j/local_down.bash create mode 100755 05_neo4j/local_up.bash diff --git a/05_neo4j/.gitignore b/05_neo4j/.gitignore new file mode 100644 index 0000000..5eb6531 --- /dev/null +++ b/05_neo4j/.gitignore @@ -0,0 +1,2 @@ +data/ +logs/ diff --git a/05_neo4j/docker-compose-linux.yml b/05_neo4j/docker-compose-linux.yml new file mode 100644 index 0000000..ce36ce7 --- /dev/null +++ b/05_neo4j/docker-compose-linux.yml @@ -0,0 +1,16 @@ +version: '3.1' + +services: + neo: + container_name: 7dbs_neo4j_db + hostname: 7dbs_neo4j_db + image: neo4j:3.5.8 + ports: + - 8085:7474 + - 7687:7687 + restart: always + volumes: + - ./data:/data + - ./logs:/logs + environment: + NEO4J_AUTH: neo4j/geo4a diff --git a/05_neo4j/local_down.bash b/05_neo4j/local_down.bash new file mode 100755 index 0000000..4a12fc2 --- /dev/null +++ b/05_neo4j/local_down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker compose --file docker-compose-linux.yml down diff --git a/05_neo4j/local_up.bash b/05_neo4j/local_up.bash new file mode 100755 index 0000000..c01c135 --- /dev/null +++ b/05_neo4j/local_up.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting Neo4j..." +mkdir -p "data" +mkdir -p "logs" +docker compose --file docker-compose-linux.yml up --detach + +>&2 echo "Opening GUI at 'http://localhost:8085'" From cb728a1408bf3623fe8a12e42fc5bcc4dedd7c33 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Thu, 3 Aug 2023 13:31:31 +0000 Subject: [PATCH 08/10] Add local_clean.bash to remove data/ and log/ --- 05_neo4j/local_clean.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 05_neo4j/local_clean.bash diff --git a/05_neo4j/local_clean.bash b/05_neo4j/local_clean.bash new file mode 100755 index 0000000..ee3c3a0 --- /dev/null +++ b/05_neo4j/local_clean.bash @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +# Because the files created inside the container may have have a different +# user id than the user outside the container, the user outside the container +# cannot delete the files in data and logs without elevated privileges. +# Instead, we again run the container, and delete from within the container +# with the same user id that created them. +docker compose --file docker-compose-linux.yml run --entrypoint rm neo -rf /data/* /logs/* +rm -rf data logs From 59d6a55a55c0208c9ac423b71b6b000d2671545b Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Thu, 3 Aug 2023 16:30:01 +0000 Subject: [PATCH 09/10] Add bash scripts for 06_dynamodb --- 06_dynamodb/down.bash | 9 +++++++++ 06_dynamodb/up.bash | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 06_dynamodb/down.bash create mode 100755 06_dynamodb/up.bash diff --git a/06_dynamodb/down.bash b/06_dynamodb/down.bash new file mode 100755 index 0000000..9644063 --- /dev/null +++ b/06_dynamodb/down.bash @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker stop 7dbs_dynamo_cli +docker rm 7dbs_dynamo_cli +docker compose down +docker network rm dynamo_net diff --git a/06_dynamodb/up.bash b/06_dynamodb/up.bash new file mode 100755 index 0000000..28ab355 --- /dev/null +++ b/06_dynamodb/up.bash @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting DynamoDB (local)..." +docker network create -d bridge --subnet 173.106.0.0/24 dynamo_net + +docker build -t aws-cli:1.16.173 ./aws_cli +docker compose up --detach + +>&2 echo "Opening dynamo-admin at 'http://localhost:8086'" + +>&2 echo "Connecting to the CLI..." +>&2 echo "All Dynamo commands need the following appended: --endpoint-url http://db:8000" +docker run \ + -it \ + --name 7dbs_dynamo_cli \ + --network dynamo_net \ + -e "AWS_ACCESS_KEY_ID=dummy" \ + -e "AWS_SECRET_ACCESS_KEY=dummy" \ + -e "AWS_DEFAULT_REGION=eu-west-1" \ + -e "AWS_DEFAULT_OUTPUT=json" \ + aws-cli:1.16.173 \ + sh From 0ab43331b6ec17e21b341d9280c890cdfd4ed2b6 Mon Sep 17 00:00:00 2001 From: Stoney Jackson Date: Thu, 3 Aug 2023 16:37:56 +0000 Subject: [PATCH 10/10] Add bash scripts for 07_redis --- 07_redis/cluster/down.bash | 8 ++++++++ 07_redis/cluster/up.bash | 16 ++++++++++++++++ 07_redis/down.bash | 6 ++++++ 07_redis/up.bash | 13 +++++++++++++ 4 files changed, 43 insertions(+) create mode 100755 07_redis/cluster/down.bash create mode 100755 07_redis/cluster/up.bash create mode 100755 07_redis/down.bash create mode 100755 07_redis/up.bash diff --git a/07_redis/cluster/down.bash b/07_redis/cluster/down.bash new file mode 100755 index 0000000..63389f9 --- /dev/null +++ b/07_redis/cluster/down.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker compose -f docker-compose-cluster.yml down +docker compose down +docker network rm redis_net diff --git a/07_redis/cluster/up.bash b/07_redis/cluster/up.bash new file mode 100755 index 0000000..7b288de --- /dev/null +++ b/07_redis/cluster/up.bash @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting Redis Cluster..." +docker network create -d bridge --subnet 173.17.0.0/24 redis_net +docker compose up --detach + +>&2 echo "Attempting to Cluster Redis instances..." +docker compose -f docker-compose-cluster.yml up + +>&2 echo "Opening rebrow (for visual representation) at 'http://localhost:8097'" + +>&2 echo "Connecting to the CLI..." +# docker exec -it 7dbs_redis_db redis-cli diff --git a/07_redis/down.bash b/07_redis/down.bash new file mode 100755 index 0000000..ccc563c --- /dev/null +++ b/07_redis/down.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +docker compose down diff --git a/07_redis/up.bash b/07_redis/up.bash new file mode 100755 index 0000000..d9b286c --- /dev/null +++ b/07_redis/up.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "${SCRIPT_DIR}" + +>&2 echo "Starting Redis..." +docker compose up --detach + +>&2 echo "Opening rebrow (for visual representation) at 'http://localhost:8087'" + +>&2 echo "Connecting to the CLI..." + +docker compose exec db redis-cli