Skip to content

Commit 8a825df

Browse files
authored
Publish hoptimator-cli and hoptimator-operator (#13)
* Publish to LinkedInJFrog * Publish hoptimator-cli and hoptimator-operator * Fix javadoc * Disable Javadoc lint, for now
1 parent 7904541 commit 8a825df

File tree

49 files changed

+239
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+239
-182
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ jobs:
2020
arguments: publish
2121
env:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
JFROG_USERNAME:
24+
JROG_API_KEY:
25+
VERSION: ${{ github.event.release.tag_name }}

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM eclipse-temurin:18
22
WORKDIR /home/
3-
COPY ./hoptimator-cli/run.sh ./hoptimator
4-
COPY ./hoptimator-operator/run.sh ./hoptimator-operator
5-
COPY ./hoptimator-cli/build/libs/hoptimator-cli-all.jar ./hoptimator-cli-all.jar
6-
COPY ./hoptimator-operator/build/libs/hoptimator-operator-all.jar ./hoptimator-operator-all.jar
7-
COPY ./etc/* ./
3+
ADD ./hoptimator-cli/run.sh ./hoptimator
4+
ADD ./hoptimator-operator/run.sh ./hoptimator-operator
5+
ADD ./hoptimator-cli/build/libs/hoptimator-cli-all.jar ./hoptimator-cli-all.jar
6+
ADD ./hoptimator-operator/build/libs/hoptimator-operator-all.jar ./hoptimator-operator-all.jar
7+
ADD ./etc/* ./
88
ENTRYPOINT ["/bin/sh", "-c"]
99
CMD ["./hoptimator -n '' -p '' -u jdbc:calcite:model=model.yaml"]
1010

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ generate-models:
4747
./models/generate-models.sh
4848

4949
release:
50+
test -n "$(VERSION)" # MISSING ARG: $$VERSION
5051
./gradlew publish
5152

5253
.PHONY: build clean quickstart deploy-dev-environment deploy deploy-samples deploy-config integration-tests bounce generate-models release

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11

2+
3+
subprojects {
4+
tasks.withType(JavaCompile) {
5+
options.release = 8
6+
options.compilerArgs << '-Xlint:deprecation'
7+
options.compilerArgs << '-Xlint:unchecked'
8+
}
9+
tasks.withType(Javadoc) {
10+
options.addStringOption('Xdoclint:none', '-quiet')
11+
}
12+
}

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ flinkTableApiJavaBridge = "org.apache.flink:flink-table-api-java-bridge:1.17.0"
1313
flinkTableCommon = "org.apache.flink:flink-table-common:1.17.0"
1414
flinkTablePlanner = "org.apache.flink:flink-table-planner_2.12:1.17.0"
1515
flinkTableRuntime = "org.apache.flink:flink-table-runtime:1.17.0"
16+
flinkShadedForceShading = "org.apache.flink:flink-shaded-force-shading:17.0"
17+
flinkMetricsDropwizard = "org.apache.flink:flink-metrics-dropwizard:1.17.0"
1618
flinkConnectorKafka = "org.apache.flink:flink-sql-connector-kafka:1.17.0"
1719
flinkConnectorMySqlCdc = "com.ververica:flink-sql-connector-mysql-cdc:2.3.0"
1820
gson = "com.google.code.gson:gson:2.9.0"
1921
jackson = "com.fasterxml.jackson.core:jackson-core:2.14.1"
20-
jacksonYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.2"
22+
jacksonYaml = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.1"
2123
javaxAnnotationApi = "javax.annotation:javax.annotation-api:1.3.2"
2224
junit = "junit:junit:4.12"
2325
kafkaClients = "org.apache.kafka:kafka-clients:2.7.1"

hoptimator-catalog/build.gradle

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,35 @@ dependencies {
1515
publishing {
1616
repositories {
1717
maven {
18-
url = "https://maven.pkg.github.com/linkedin/Hoptimator"
18+
name 'GitHubPackages'
19+
url = 'https://maven.pkg.github.com/linkedin/Hoptimator'
1920
credentials {
2021
username = System.getenv('GITHUB_ACTOR')
2122
password = System.getenv('GITHUB_TOKEN')
2223
}
2324
}
25+
maven {
26+
name 'LinkedInJFrog'
27+
url 'https://linkedin.jfrog.io/artifactory/hoptimator'
28+
credentials {
29+
username = System.getenv('JFROG_USERNAME')
30+
password = System.getenv('JFROG_API_KEY')
31+
}
32+
}
2433
}
2534
publications {
2635
maven(MavenPublication) {
2736
groupId = 'com.linkedin.hoptimator'
2837
artifactId = 'hoptimator-catalog'
29-
version = System.getenv('GITHUB_REF_NAME')
38+
version = System.getenv('VERSION')
3039
from components.java
3140
}
3241
}
3342
}
3443

35-
tasks.withType(JavaCompile) {
36-
options.compilerArgs << '-Xlint:deprecation'
37-
options.compilerArgs << '-Xlint:unchecked'
44+
java {
45+
withJavadocJar()
46+
withSourcesJar()
3847
}
3948

4049
idea {

hoptimator-catalog/src/main/java/com/linkedin/hoptimator/catalog/ConfigProvider.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ default ConfigProvider with(String key, Function<String, String> valueFunction)
3939
};
4040
}
4141

42+
default ConfigProvider with(Map<String, ?> configs) {
43+
if (configs == null) {
44+
return this;
45+
}
46+
return x -> {
47+
Map<String, String> base = config(x);
48+
Map<String, String> combined = new HashMap<>();
49+
combined.putAll(base);
50+
configs.forEach((k, v) -> {
51+
if (base.containsKey(k)) {
52+
throw new IllegalStateException("Key '" + k + "' previously defined.");
53+
}
54+
combined.put(k, v.toString());
55+
});
56+
return combined;
57+
};
58+
}
59+
4260
default ConfigProvider with(String key, String value) {
4361
return with(key, x -> value);
4462
}

hoptimator-catalog/src/main/java/com/linkedin/hoptimator/catalog/ScriptImplementor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.linkedin.hoptimator.catalog;
22

33
import org.apache.calcite.sql.SqlWriter;
4-
import org.apache.calcite.sql.SqlWriterConfig;
4+
//import org.apache.calcite.sql.SqlWriterConfig;
55
import org.apache.calcite.sql.SqlDataTypeSpec;
66
import org.apache.calcite.sql.SqlRowTypeNameSpec;
77
import org.apache.calcite.sql.SqlBasicTypeNameSpec;
@@ -93,7 +93,9 @@ default String sql() {
9393

9494
/** Render the script as DDL/SQL in the given dialect */
9595
default String sql(SqlDialect dialect) {
96-
SqlWriter w = new SqlPrettyWriter(SqlWriterConfig.of().withDialect(dialect));
96+
SqlWriter w = new SqlPrettyWriter(dialect);
97+
// above is deprecated; replace with:
98+
// SqlWriter w = new SqlPrettyWriter(SqlWriterConfig.of().withDialect(dialect));
9799
implement(w);
98100
return w.toSqlString().getSql()
99101
.replaceAll("\\n", " ").replaceAll(";", ";\n").trim();

hoptimator-cli/build.gradle

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,72 @@ plugins {
33
id 'java'
44
id 'application'
55
id 'idea'
6+
id 'maven-publish'
7+
}
8+
9+
configurations {
10+
integration.extendsFrom implementation
611
}
712

813
dependencies {
914
implementation project(':hoptimator-planner')
1015
implementation project(':hoptimator-catalog')
11-
implementation project(':hoptimator-flink-iterator')
12-
implementation project(':hoptimator-kafka-adapter')
13-
implementation project(':hoptimator-mysql-adapter')
16+
17+
// include adapters for integration tests
18+
integration project(':hoptimator-kafka-adapter')
19+
integration project(':hoptimator-mysql-adapter')
20+
integration libs.flinkCsv
1421

1522
implementation libs.avro
1623
implementation libs.sqlline
1724
implementation libs.slf4jLog4j
1825
implementation libs.flinkClients
1926
implementation libs.flinkTableRuntime
2027
implementation libs.flinkTablePlanner
21-
implementation libs.flinkTableApiJavaBridge
22-
implementation libs.flinkCsv
2328
implementation libs.calciteCore
2429
implementation libs.calciteAvatica
2530

2631
testImplementation libs.junit
2732
testImplementation libs.assertj
2833
}
2934

30-
tasks.withType(JavaCompile) {
31-
options.compilerArgs << '-Xlint:deprecation'
32-
options.compilerArgs << '-Xlint:unchecked'
35+
publishing {
36+
repositories {
37+
maven {
38+
name 'GitHubPackages'
39+
url = 'https://maven.pkg.github.com/linkedin/Hoptimator'
40+
credentials {
41+
username = System.getenv('GITHUB_ACTOR')
42+
password = System.getenv('GITHUB_TOKEN')
43+
}
44+
}
45+
maven {
46+
name 'LinkedInJFrog'
47+
url 'https://linkedin.jfrog.io/artifactory/hoptimator'
48+
credentials {
49+
username = System.getenv('JFROG_USERNAME')
50+
password = System.getenv('JFROG_API_KEY')
51+
}
52+
}
53+
}
54+
publications {
55+
maven(MavenPublication) {
56+
groupId = 'com.linkedin.hoptimator'
57+
artifactId = 'hoptimator-cli'
58+
version = System.getenv('VERSION')
59+
from components.java
60+
}
61+
}
62+
}
63+
64+
java {
65+
withJavadocJar()
66+
withSourcesJar()
3367
}
3468

3569
shadowJar {
70+
configurations = [project.configurations.integration]
71+
3672
// This is required for Flink and Avatica to play nicely
3773
relocate 'com.google', 'org.apache.flink.calcite.shaded.com.google'
3874

hoptimator-cli/run.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#!/bin/bash
22

3-
JAR="./hoptimator-cli-all.jar"
4-
5-
if [[ -f "$JAR" ]]; then
6-
java \
7-
--add-opens java.base/java.lang=ALL-UNNAMED \
8-
--add-opens java.base/java.util=ALL-UNNAMED \
9-
--add-opens java.base/java.time=ALL-UNNAMED \
10-
-jar $JAR --verbose=true "$@"
11-
else
12-
echo "jar file not found; maybe forgot to build?"
13-
fi
3+
java \
4+
--add-opens java.base/java.lang=ALL-UNNAMED \
5+
--add-opens java.base/java.util=ALL-UNNAMED \
6+
--add-opens java.base/java.time=ALL-UNNAMED \
7+
-classpath "/opt/plugins/*/lib/*:./hoptimator-cli-all.jar" \
8+
$JAVA_OPTS \
9+
com.linkedin.hoptimator.HoptimatorCliApp --verbose=true -nn hoptimator "$@"

0 commit comments

Comments
 (0)