From eb8c6f1214f5627361796fa3a0c3f2693cbf5f9e Mon Sep 17 00:00:00 2001 From: Alfredo Oliviero Date: Mon, 5 Aug 2024 12:43:45 +0200 Subject: [PATCH] first commit --- .env | 12 +++ .gitignore | 191 ++++++++++++++++++++++++++++++++++++++++++ .gitmodules | 6 ++ .vscode/settings.json | 3 + README.md | 32 +++++++ cassandra | 1 + compose.yml | 41 +++++++++ socialservice | 1 + 8 files changed, 287 insertions(+) create mode 100644 .env create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .vscode/settings.json create mode 100644 README.md create mode 160000 cassandra create mode 100644 compose.yml create mode 160000 socialservice diff --git a/.env b/.env new file mode 100644 index 0000000..6ac89f3 --- /dev/null +++ b/.env @@ -0,0 +1,12 @@ +CASSANDRA_CLUSTER_NAME=TestCluster +CASSANDRA_SEEDS=cassandra1,cassandra2,cassandra3 +CASSANDRA_NUM_TOKENS=256 + +KEYSPACE=dev_keyspace_1 + +DUMP_DIR=/dump + +CASSANDRA_DC=DC1 +CASSANDRA_RACK=RAC1 + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95a759d --- /dev/null +++ b/.gitignore @@ -0,0 +1,191 @@ +logs +keys + +# Created by https://www.toptal.com/developers/gitignore/api/java,macos,visualstudiocode,linux,windows,eclipse +# Edit at https://www.toptal.com/developers/gitignore?templates=java,macos,visualstudiocode,linux,windows,eclipse + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7bfdfc8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "socialservice"] + path = socialservice + url = gitea@code-repo.d4science.org:alfredo.oliviero/dockerizing_socialnetworkinglibraryws.git +[submodule "cassandra"] + path = cassandra + url = gitea@code-repo.d4science.org:alfredo.oliviero/dockerizing_cassandra.git diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7b016a8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.compile.nullAnalysis.mode": "automatic" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d8777d --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Docker Cassandra Social + +## subprojects: + +* [cassandra](./cassandra/README.md) +* [socialservice](./socialservice/README.md) + +### cassandra + +[cassandra](./cassandra/README.md) is the dockerization of the cassandra infrastructure +it contains the script for dumping the devel environment, and the [Dockerfile](./cassandra/Dockerfile) and [Docker compose](./cassandra/compose.yaml) files to build and start the composed instance with the dumped schema and data + +### socialservice +[socialservice](./socialservice/README.md) is the dockerization of the socialservice infrastructure +it contains the script for dumping the devel environment, and the [Dockerfile](./socialservice/Dockerfile) and [Docker compose](./socialservice/compose.yaml) files to build and start the composed instance with the dumped schema and data + + +## DOCKER instructions + +you can start the 2 services individually entering in the folder and starting the docker compose instance, or start the common compose in the base folder. + +start common composer: +`docker compose up --build` + +force recreate docker image +`docker compose build --no-cache` + +check status: +`docker exec -it cassandra-1 nodetool status` +`docker exec -it cassandra-2 nodetool status` +`docker exec -it cassandra-3 nodetool status` +`docker exec -it social nodetool status` diff --git a/cassandra b/cassandra new file mode 160000 index 0000000..814b030 --- /dev/null +++ b/cassandra @@ -0,0 +1 @@ +Subproject commit 814b03059b7b30d87c24f7353386a7fa7121813d diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..58c2e4f --- /dev/null +++ b/compose.yml @@ -0,0 +1,41 @@ +version: '3.8' + +services: + cassandra1: + extends: + file: ./cassandra/compose.yml + service: cassandra1 + networks: + - app-network + + cassandra2: + extends: + file: ./cassandra/compose.yml + service: cassandra2 + networks: + - app-network + + cassandra3: + extends: + file: ./cassandra/compose.yml + service: cassandra3 + networks: + - app-network + + tomcat: + extends: + file: ./socialservice/compose.yml + service: tomcat + depends_on: + cassandra1: + condition: service_healthy + cassandra2: + condition: service_healthy + cassandra3: + condition: service_healthy + networks: + - app-network + +networks: + app-network: + driver: bridge diff --git a/socialservice b/socialservice new file mode 160000 index 0000000..3c50bfa --- /dev/null +++ b/socialservice @@ -0,0 +1 @@ +Subproject commit 3c50bfa984c8dfb42ab7ec06989eb0b2a8382f87