Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka and arangodb components update #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose/arangodb/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARANGO_ROOT_PASSWORD=iJJ9fWxb9Z6CS1aPagoW
ARANGO_ROOT_PASSWORD=CH@NGE-ME!
NETWORK_TYPE=placeholder
INSTANCE_NAME=first
ARANGO_SERVICE_SERVICE_HOST=arangodb
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/arangodb/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arangodb:3.7.15
FROM arangodb:3.10.5

RUN apk add bash
RUN rm /entrypoint.sh
Expand Down
1 change: 0 additions & 1 deletion docker-compose/kafka/arangodb-connector-download.url

This file was deleted.

9 changes: 4 additions & 5 deletions docker-compose/kafka/build_check/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM confluentinc/cp-kafka-connect:5.3.6
RUN apt update && apt -y --force-yes install jq bsdmainutils
FROM confluentinc/cp-kafka-connect:7.3.3
USER root
RUN microdnf update
RUN microdnf install jq findutils
COPY check.sh /work/check.sh
COPY create_topics.sh /work/create_topics.sh
COPY create_connectors.sh /work/create_connectors.sh
COPY connect-cli /usr/bin/connect-cli
COPY /connectors/ /work/connectors/
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
Binary file removed docker-compose/kafka/build_check/connect-cli
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "arangodb-accounts-sink",
"config": {
"connector.class": "io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector",
"tasks.max": "1",
"topics": "accounts",
"arangodb.host":"arangodb",
"arangodb.user":"root",
"arangodb.password":"CH@NGE-ME!",
"arangodb.port": "8529",
"arangodb.database.name": "blockchain",
"transforms": "KeyTransform",
"transforms.KeyTransform.field": "id",
"transforms.KeyTransform.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"key.converter.schemas.enable": "false",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "arangodb-blocks-signatures-sink",
"config": {
"connector.class": "io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector",
"tasks.max": "1",
"topics": "blocks_signatures",
"arangodb.host":"arangodb",
"arangodb.user":"root",
"arangodb.password":"CH@NGE-ME!",
"arangodb.port": "8529",
"arangodb.database.name": "blockchain",
"transforms": "KeyTransform",
"transforms.KeyTransform.field": "id",
"transforms.KeyTransform.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"key.converter.schemas.enable": "false",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "arangodb-blocks-sink",
"config": {
"connector.class": "io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector",
"tasks.max": "1",
"topics": "blocks",
"arangodb.host":"arangodb",
"arangodb.user":"root",
"arangodb.password":"CH@NGE-ME!",
"arangodb.port": "8529",
"arangodb.database.name": "blockchain",
"transforms": "KeyTransform",
"transforms.KeyTransform.field": "id",
"transforms.KeyTransform.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"key.converter.schemas.enable": "false",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "arangodb-messages-sink",
"config": {
"connector.class": "io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector",
"tasks.max": "1",
"topics": "messages",
"arangodb.host":"arangodb",
"arangodb.user":"root",
"arangodb.password":"CH@NGE-ME!",
"arangodb.port": "8529",
"arangodb.database.name": "blockchain",
"arangodb.insert.overwritemode": "update",
"transforms": "KeyTransform",
"transforms.KeyTransform.field": "id",
"transforms.KeyTransform.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"key.converter.schemas.enable": "false",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "arangodb-transactions-sink",
"config": {
"connector.class": "io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector",
"tasks.max": "1",
"topics": "transactions",
"arangodb.host":"arangodb",
"arangodb.user":"root",
"arangodb.password":"CH@NGE-ME!",
"arangodb.port": "8529",
"arangodb.database.name": "blockchain",
"transforms": "KeyTransform",
"transforms.KeyTransform.field": "id",
"transforms.KeyTransform.type": "org.apache.kafka.connect.transforms.HoistField$Key",
"key.converter.schemas.enable": "false",
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "false",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}

This file was deleted.

7 changes: 0 additions & 7 deletions docker-compose/kafka/build_check/create_connectors.sh

This file was deleted.

25 changes: 0 additions & 25 deletions docker-compose/kafka/build_check/create_topics.sh

This file was deleted.

32 changes: 30 additions & 2 deletions docker-compose/kafka/build_check/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
#!/bin/bash

/work/create_topics.sh
/work/create_connectors.sh
kafka-topics --create --bootstrap-server kafka:29092 --topic accounts --replication-factor 1 --partitions 20 --if-not-exists
sleep 2
kafka-topics --create --bootstrap-server kafka:29092 --topic transactions --replication-factor 1 --partitions 40 --if-not-exists
sleep 2
kafka-topics --create --bootstrap-server kafka:29092 --topic blocks --replication-factor 1 --partitions 5 --if-not-exists
sleep 2
kafka-topics --create --bootstrap-server kafka:29092 --topic messages --replication-factor 1 --partitions 60 --if-not-exists
sleep 2
kafka-topics --create --bootstrap-server kafka:29092 --topic requests --replication-factor 1 --partitions 30 --if-not-exists
sleep 2
kafka-topics --create --bootstrap-server kafka:29092 --topic blocks_signatures --replication-factor 1 --partitions 5 --if-not-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic accounts --partitions 20 --if-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic transactions --partitions 40 --if-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic blocks --partitions 5 --if-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic messages --partitions 60 --if-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic requests --partitions 30 --if-exists
sleep 2
kafka-topics --alter --bootstrap-server kafka:29092 --topic blocks_signatures --partitions 5 --if-exists


for connector in $(ls /work/connectors/*.json)
do
curl --max-time 5 -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" connect:8083/connectors/ -d @/${connector}
sleep 5s
done

exec tail -f /dev/null

Loading