This is an automated email from the ASF dual-hosted git repository. gyfora pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
commit d9dae4576168eca486e1d0ee006a714186edbada Author: Gyula Fora <[email protected]> AuthorDate: Mon Jun 5 09:11:51 2023 +0200 [build] Remove extra reshading of Flink Kubernetes --- Dockerfile | 8 ++--- docker-entrypoint.sh | 4 +-- examples/basic.yaml | 1 + flink-kubernetes-operator/pom.xml | 7 ++++- flink-kubernetes-standalone/pom.xml | 59 ------------------------------------- 5 files changed, 13 insertions(+), 66 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8e7d1c3..0d4a9fc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN cd /app/tools/license; mkdir jars; cd jars; \ cp /app/flink-kubernetes-operator/target/flink-kubernetes-operator-*-shaded.jar . && \ cp /app/flink-kubernetes-operator-autoscaler/target/flink-kubernetes-operator-autoscaler-*.jar . && \ cp /app/flink-kubernetes-webhook/target/flink-kubernetes-webhook-*-shaded.jar . && \ - cp /app/flink-kubernetes-standalone/target/flink-kubernetes-standalone-*-shaded.jar . && \ + cp /app/flink-kubernetes-standalone/target/flink-kubernetes-standalone-*.jar . && \ cp -r /app/flink-kubernetes-operator/target/plugins ./plugins && \ cd ../ && ./collect_license_files.sh ./jars ./licenses-output @@ -41,7 +41,7 @@ ENV OPERATOR_VERSION=1.6-SNAPSHOT ENV OPERATOR_JAR=flink-kubernetes-operator-$OPERATOR_VERSION-shaded.jar ENV AUTOSCALER_JAR=flink-kubernetes-operator-autoscaler-$OPERATOR_VERSION.jar ENV WEBHOOK_JAR=flink-kubernetes-webhook-$OPERATOR_VERSION-shaded.jar -ENV FLINK_KUBERNETES_SHADED_JAR=flink-kubernetes-standalone-$OPERATOR_VERSION-shaded.jar +ENV KUBERNETES_STANDALONE_JAR=flink-kubernetes-standalone-$OPERATOR_VERSION.jar ENV OPERATOR_LIB=$FLINK_HOME/operator-lib RUN mkdir -p $OPERATOR_LIB @@ -53,7 +53,7 @@ RUN groupadd --system --gid=9999 flink && \ COPY --from=build /app/flink-kubernetes-operator/target/$OPERATOR_JAR . COPY --from=build /app/flink-kubernetes-operator-autoscaler/target/$AUTOSCALER_JAR . COPY --from=build /app/flink-kubernetes-webhook/target/$WEBHOOK_JAR . -COPY --from=build /app/flink-kubernetes-standalone/target/$FLINK_KUBERNETES_SHADED_JAR . +COPY --from=build /app/flink-kubernetes-standalone/target/$KUBERNETES_STANDALONE_JAR . COPY --from=build /app/flink-kubernetes-operator/target/plugins $FLINK_HOME/plugins COPY --from=build /app/tools/license/licenses-output/NOTICE . COPY --from=build /app/tools/license/licenses-output/licenses ./licenses @@ -63,7 +63,7 @@ RUN chown -R flink:flink $FLINK_HOME && \ chown flink:flink $OPERATOR_JAR && \ chown flink:flink $AUTOSCALER_JAR && \ chown flink:flink $WEBHOOK_JAR && \ - chown flink:flink $FLINK_KUBERNETES_SHADED_JAR && \ + chown flink:flink $KUBERNETES_STANDALONE_JAR && \ chown flink:flink /docker-entrypoint.sh ARG SKIP_OS_UPDATE=true diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 71ab065d..5b215bee 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -29,12 +29,12 @@ if [ "$1" = "help" ]; then elif [ "$1" = "operator" ]; then echo "Starting Operator" - exec java -cp "./$FLINK_KUBERNETES_SHADED_JAR:./$OPERATOR_JAR:./$AUTOSCALER_JAR:$OPERATOR_LIB/*" $LOG_CONFIG $JVM_ARGS org.apache.flink.kubernetes.operator.FlinkOperator + exec java -cp "./$KUBERNETES_STANDALONE_JAR:./$OPERATOR_JAR:./$AUTOSCALER_JAR:$OPERATOR_LIB/*" $LOG_CONFIG $JVM_ARGS org.apache.flink.kubernetes.operator.FlinkOperator elif [ "$1" = "webhook" ]; then echo "Starting Webhook" # Adds the operator shaded jar on the classpath when the webhook starts - exec java -cp "./$FLINK_KUBERNETES_SHADED_JAR:./$OPERATOR_JAR:./$WEBHOOK_JAR:$OPERATOR_LIB/*" $LOG_CONFIG $JVM_ARGS org.apache.flink.kubernetes.operator.admission.FlinkOperatorWebhook + exec java -cp "./$KUBERNETES_STANDALONE_JAR:./$OPERATOR_JAR:./$WEBHOOK_JAR:$OPERATOR_LIB/*" $LOG_CONFIG $JVM_ARGS org.apache.flink.kubernetes.operator.admission.FlinkOperatorWebhook fi args=("${args[@]}") diff --git a/examples/basic.yaml b/examples/basic.yaml index 66153d15..24788b79 100644 --- a/examples/basic.yaml +++ b/examples/basic.yaml @@ -22,6 +22,7 @@ metadata: name: basic-example spec: image: flink:1.17 + mode: standalone flinkVersion: v1_17 flinkConfiguration: taskmanager.numberOfTaskSlots: "2" diff --git a/flink-kubernetes-operator/pom.xml b/flink-kubernetes-operator/pom.xml index 735dfacb..99f74baf 100644 --- a/flink-kubernetes-operator/pom.xml +++ b/flink-kubernetes-operator/pom.xml @@ -72,6 +72,12 @@ under the License. </dependency> <!-- Flink --> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-kubernetes</artifactId> + <version>${flink.version}</version> + </dependency> + <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-clients</artifactId> @@ -94,7 +100,6 @@ under the License. <groupId>org.apache.flink</groupId> <artifactId>flink-kubernetes-standalone</artifactId> <version>${project.version}</version> - <classifier>shaded</classifier> <scope>provided</scope> </dependency> diff --git a/flink-kubernetes-standalone/pom.xml b/flink-kubernetes-standalone/pom.xml index 7bfcc3ca..868eaf2d 100644 --- a/flink-kubernetes-standalone/pom.xml +++ b/flink-kubernetes-standalone/pom.xml @@ -34,27 +34,16 @@ under the License. <packaging>jar</packaging> <dependencies> - <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-kubernetes</artifactId> <version>${flink.version}</version> </dependency> - <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from - flink-kubernetes was relocated we have to bundle a relocated new version --> - <dependency> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> - <!-- Cannot upgrade to 2.0 due to flink incompatibility --> - <version>1.33</version> - </dependency> - <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-clients</artifactId> <version>${flink.version}</version> - <scope>provided</scope> </dependency> <!-- Test --> @@ -85,52 +74,4 @@ under the License. <scope>test</scope> </dependency> </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>3.3.0</version> - <executions> - <execution> - <id>shade-flink-operator</id> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadedArtifactAttached>true</shadedArtifactAttached> - <shadedClassifierName>shaded</shadedClassifierName> - <artifactSet> - <includes combine.children="append"> - <include>org.apache.flink:flink-kubernetes</include> - <include>org.yaml:snakeyaml</include> - </includes> - </artifactSet> - <relocations> - <!-- FLINK-29384, Since the transitive snakeyaml that we are filtering out from - flink-kubernetes was relocated we have to bundle a relocated new version --> - <relocation> - <pattern>org.yaml.snakeyaml</pattern> - <shadedPattern>org.apache.flink.kubernetes.shaded.org.yaml.snakeyaml</shadedPattern> - </relocation> - </relocations> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/DEPENDENCIES</exclude> - <exclude>META-INF/LICENSE</exclude> - <exclude>META-INF/MANIFEST.MF</exclude> - <exclude>org/apache/flink/kubernetes/shaded/org/yaml/snakeyaml/**</exclude> - </excludes> - </filter> - </filters> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> </project>
