-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a93a69
commit 3d21e22
Showing
15 changed files
with
256 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,15 @@ | ||
import org.radarbase.gradle.plugin.radarKotlin | ||
|
||
plugins { | ||
id("org.radarbase.radar-root-project") version Versions.radarCommons | ||
id("org.radarbase.radar-dependency-management") version Versions.radarCommons | ||
id("org.radarbase.radar-kotlin") version Versions.radarCommons apply false | ||
|
||
id("org.jetbrains.kotlin.plugin.noarg") version Versions.kotlin apply false | ||
id("org.jetbrains.kotlin.plugin.jpa") version Versions.kotlin apply false | ||
id("org.jetbrains.kotlin.plugin.allopen") version Versions.kotlin apply false | ||
id("com.avast.gradle.docker-compose") version Versions.dockerCompose apply false | ||
} | ||
|
||
allprojects { | ||
group = "org.radarbase" | ||
version = "0.5.14" | ||
} | ||
|
||
|
||
radarRootProject { | ||
projectVersion.set(Versions.project) | ||
gradleVersion.set(Versions.wrapper) | ||
} | ||
|
||
|
||
subprojects { | ||
apply(plugin = "org.radarbase.radar-kotlin") | ||
|
||
radarKotlin { | ||
javaVersion.set(Versions.java) | ||
kotlinVersion.set(Versions.kotlin) | ||
slf4jVersion.set(Versions.slf4j) | ||
log4j2Version.set(Versions.log4j2) | ||
junitVersion.set(Versions.junit) | ||
} | ||
} | ||
|
||
project(":kafka-connect-upload-source") { | ||
radarKotlin { | ||
javaVersion.set(17) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.10" | ||
id("org.radarbase.radar-kotlin") version "1.1.3" | ||
} | ||
|
||
repositories { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/bin/bash | ||
|
||
if [ "$WAIT_FOR_KAFKA" != "1" ]; then | ||
echo "Starting without checking for Kafka availability" | ||
exit 0 | ||
fi | ||
|
||
max_timeout=32 | ||
|
||
IS_TEMP=0 | ||
|
||
echo "===> Wait for infrastructure ..." | ||
|
||
if [ -z "$COMMAND_CONFIG_FILE_PATH" ]; then | ||
COMMAND_CONFIG_FILE_PATH="$(mktemp)" | ||
IS_TEMP=1 | ||
fi | ||
|
||
if [ ! -f "$COMMAND_CONFIG_FILE_PATH" ] || [ $IS_TEMP = 1 ]; then | ||
while IFS='=' read -r -d '' n v; do | ||
if [[ "$n" == "CONNECT_"* ]]; then | ||
name="${n/CONNECT_/""}" # remove first "CONNECT_" | ||
name="${name,,}" # lower case | ||
name="${name//_/"."}" # replace all '_' with '.' | ||
echo "$name=$v" >> ${COMMAND_CONFIG_FILE_PATH} | ||
fi | ||
done < <(env -0) | ||
fi | ||
|
||
# Check if variables exist | ||
if [ -z "$CONNECT_BOOTSTRAP_SERVERS" ]; then | ||
echo "CONNECT_BOOTSTRAP_SERVERS is not defined" | ||
else | ||
KAFKA_BROKERS=${KAFKA_BROKERS:-3} | ||
|
||
tries=10 | ||
timeout=1 | ||
while true; do | ||
KAFKA_CHECK=$(kafka-broker-api-versions --bootstrap-server "$CONNECT_BOOTSTRAP_SERVERS" --command-config "${COMMAND_CONFIG_FILE_PATH}" | grep "(id: " | wc -l) | ||
|
||
if [ "$KAFKA_CHECK" -ge "$KAFKA_BROKERS" ]; then | ||
echo "Kafka brokers available." | ||
break | ||
fi | ||
|
||
tries=$((tries - 1)) | ||
if [ ${tries} -eq 0 ]; then | ||
echo "FAILED: KAFKA BROKERs NOT READY." | ||
exit 5 | ||
fi | ||
echo "Expected $KAFKA_BROKERS brokers but found only $KAFKA_CHECK. Waiting $timeout second before retrying ..." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
|
||
echo "Kafka is available." | ||
fi | ||
|
||
if [ -z "$CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL" ]; then | ||
echo "CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL is not defined" | ||
else | ||
tries=10 | ||
timeout=1 | ||
while true; do | ||
if wget --spider -q "${CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL}/subjects" 2>/dev/null; then | ||
echo "Schema registry available." | ||
break | ||
fi | ||
tries=$((tries - 1)) | ||
if [ $tries -eq 0 ]; then | ||
echo "FAILED TO REACH SCHEMA REGISTRY." | ||
exit 6 | ||
fi | ||
echo "Failed to reach schema registry. Retrying in ${timeout} seconds." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
|
||
echo "Schema registry is available." | ||
fi | ||
|
||
if [ $IS_TEMP = 1 ]; then | ||
/bin/rm -f "$COMMAND_CONFIG_FILE_PATH" | ||
fi |
Oops, something went wrong.