summaryrefslogtreecommitdiff
path: root/shell_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'shell_scripts')
-rwxr-xr-xshell_scripts/build.sh6
-rwxr-xr-xshell_scripts/gradle_cache_clean.sh3
-rwxr-xr-xshell_scripts/kafka_connect.sh2
-rwxr-xr-xshell_scripts/kafka_create_topic.sh2
-rwxr-xr-xshell_scripts/kafka_server_start.sh2
-rwxr-xr-xshell_scripts/kafka_storage_format.sh2
-rw-r--r--shell_scripts/readme.md13
-rwxr-xr-xshell_scripts/schema_registry_start.sh2
8 files changed, 32 insertions, 0 deletions
diff --git a/shell_scripts/build.sh b/shell_scripts/build.sh
new file mode 100755
index 00000000..b50c7485
--- /dev/null
+++ b/shell_scripts/build.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+# This script exports OpenDC to a standalone binary
+cd ..
+./gradlew assembleDist -x "opendc-experiments:opendc-experiments-m3sa:sourcesJar"
+mv ./opendc-experiments/opendc-experiments-base/build/distributions/OpenDCExperimentRunner.tar .
+
diff --git a/shell_scripts/gradle_cache_clean.sh b/shell_scripts/gradle_cache_clean.sh
new file mode 100755
index 00000000..4b7ddb0e
--- /dev/null
+++ b/shell_scripts/gradle_cache_clean.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+# Also trashes .idea
+trash -rf $XDG_CONFIG_HOME/gradle; trash -rf $HOME/.gradle; trash -rf ../.gradle; trash -rf ../.idea
diff --git a/shell_scripts/kafka_connect.sh b/shell_scripts/kafka_connect.sh
new file mode 100755
index 00000000..3f22b6de
--- /dev/null
+++ b/shell_scripts/kafka_connect.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/opt/confluent/bin/connect-standalone /opt/confluent/etc/kafka/connect-standalone.properties /opt/confluent/share/confluent-common/connectors/sink-jdbc.properties /opt/confluent/share/confluent-common/connectors/sink-redis.properties
diff --git a/shell_scripts/kafka_create_topic.sh b/shell_scripts/kafka_create_topic.sh
new file mode 100755
index 00000000..6c0abd8b
--- /dev/null
+++ b/shell_scripts/kafka_create_topic.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+kafka-topics --create --topic postgres_topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1
diff --git a/shell_scripts/kafka_server_start.sh b/shell_scripts/kafka_server_start.sh
new file mode 100755
index 00000000..365c20dd
--- /dev/null
+++ b/shell_scripts/kafka_server_start.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/opt/confluent/bin/kafka-server-start /opt/confluent/etc/kafka/server.properties
diff --git a/shell_scripts/kafka_storage_format.sh b/shell_scripts/kafka_storage_format.sh
new file mode 100755
index 00000000..c6cceb80
--- /dev/null
+++ b/shell_scripts/kafka_storage_format.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/opt/confluent/bin/kafka-storage format -t 2vi2WtHxQAOPyXb1Bj1Jvw -c /opt/confluent/etc/kafka/server.properties --standalone > /dev/null 2>&1; echo 0
diff --git a/shell_scripts/readme.md b/shell_scripts/readme.md
new file mode 100644
index 00000000..2a0842b1
--- /dev/null
+++ b/shell_scripts/readme.md
@@ -0,0 +1,13 @@
+You need to run this each time you change `schema.proto`
+```bash
+cd resources/experiments/
+protoc --java_out=/home/matt/git/opendc/opendc-common/src/main/java/ schema.proto
+curl -X DELETE http://localhost:8081/subjects/postgres-topic-value
+```
+Confluent JDBC sink and source (includes Postgres connector) files:
+https://www.confluent.io/hub/confluentinc/kafka-connect-jdbc
+
+Be aware the project will only work with this OpenDC as there are hidden Maven dependencies.
+Kafka topic should be named `postgres_topic`.
+
+Confluent local (see https://www.confluent.io/installation/):
diff --git a/shell_scripts/schema_registry_start.sh b/shell_scripts/schema_registry_start.sh
new file mode 100755
index 00000000..2f4a4afe
--- /dev/null
+++ b/shell_scripts/schema_registry_start.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+/opt/confluent/bin/schema-registry-start /opt/confluent/etc/schema-registry/schema-registry.properties