You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gy...@apache.org on 2024/06/28 10:31:35 UTC
(flink-kubernetes-operator) branch main updated: [FLINK-35649] Bump Flink version to 1.19.1 in k8s-operator
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
The following commit(s) were added to refs/heads/main by this push:
new 7b015531 [FLINK-35649] Bump Flink version to 1.19.1 in k8s-operator
7b015531 is described below
commit 7b01553101875ca669447335e4ff5d3be40eada1
Author: Ferenc Csaky <fe...@pm.me>
AuthorDate: Fri Jun 28 12:31:31 2024 +0200
[FLINK-35649] Bump Flink version to 1.19.1 in k8s-operator
---
.github/workflows/ci.yml | 9 +--
flink-autoscaler-plugin-jdbc/pom.xml | 6 ++
.../runtime/rest/messages/job/JobDetailsInfo.java | 2 +-
flink-kubernetes-operator/pom.xml | 6 ++
.../savepoints/SavepointTriggerRequestBody.java | 90 ---------------------
.../stop/StopWithSavepointRequestBody.java | 91 ----------------------
.../autoscaler/KubernetesScalingRealizerTest.java | 4 +
.../StandaloneKubernetesJobManagerFactoryTest.java | 4 +-
pom.xml | 2 +-
9 files changed, 22 insertions(+), 192 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3c4e979f..f317fc58 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,13 +47,8 @@ jobs:
${{ runner.os }}-maven-
- name: Build with Maven
run: |
- set -o pipefail; mvn -B clean install javadoc:javadoc -Pgenerate-docs | tee ./mvn.log; set +o pipefail
- if [[ $(cat ./mvn.log | grep -E -v '(flink-runtime-.*.jar, flink-kubernetes-operator-.*.jar)|(flink-kubernetes-operator-.*.jar, flink-runtime-.*.jar) define 3 overlapping classes' | grep -E -v '(flink-runtime-.*.jar, flink-autoscaler-.*.jar)|(flink-autoscaler-.*.jar, flink-runtime-.*.jar) define 1|2 overlapping classes' | grep -c "overlapping classes" -) -gt 0 ]];then
- echo "Found overlapping classes: "
- cat ./mvn.log | grep "overlapping classes"
- exit 1
- fi
- if [[ $(git diff HEAD | wc -l) -gt 0 ]];then
+ mvn -B clean install javadoc:javadoc -Pgenerate-docs
+ if [[ $(git diff HEAD | wc -l) -gt 0 ]]; then
echo "Please generate the java doc via 'mvn clean install -DskipTests -Pgenerate-docs' again"
exit 1
fi
diff --git a/flink-autoscaler-plugin-jdbc/pom.xml b/flink-autoscaler-plugin-jdbc/pom.xml
index 57bfdedc..90add9dd 100644
--- a/flink-autoscaler-plugin-jdbc/pom.xml
+++ b/flink-autoscaler-plugin-jdbc/pom.xml
@@ -104,6 +104,12 @@ under the License.
</exclusions>
</dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.17.0</version>
+ </dependency>
+
<!-- Derby tests -->
<dependency>
<groupId>org.apache.derby</groupId>
diff --git a/flink-autoscaler/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java b/flink-autoscaler/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
index c6a16e67..8df91424 100644
--- a/flink-autoscaler/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
+++ b/flink-autoscaler/src/main/java/org/apache/flink/runtime/rest/messages/job/JobDetailsInfo.java
@@ -45,7 +45,7 @@ import java.util.Collection;
import java.util.Map;
import java.util.Objects;
-/** Copied from Flink. Should be removed once the client dependency is upgraded to 1.18. */
+/** Copied from Flink. Should be removed once the client dependency is upgraded to 1.20. */
/** The difference compared to 1.18 is that slot sharing group is optional here. */
public class JobDetailsInfo implements ResponseBody {
diff --git a/flink-kubernetes-operator/pom.xml b/flink-kubernetes-operator/pom.xml
index d6d56740..21902e37 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -251,6 +251,12 @@ under the License.
<exclude>META-INF/**/module-info.class</exclude>
</excludes>
</filter>
+ <filter>
+ <artifact>org.apache.flink:flink-kubernetes</artifact>
+ <excludes>
+ <exclude>META-INF/versions/**/com/fasterxml/jackson/core/io/doubleparser/**</exclude>
+ </excludes>
+ </filter>
</filters>
<artifactSet>
<includes combine.children="append">
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/SavepointTriggerRequestBody.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/SavepointTriggerRequestBody.java
deleted file mode 100644
index edb19738..00000000
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/SavepointTriggerRequestBody.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.runtime.rest.messages.job.savepoints;
-
-import org.apache.flink.core.execution.SavepointFormatType;
-import org.apache.flink.runtime.rest.messages.RequestBody;
-import org.apache.flink.runtime.rest.messages.TriggerId;
-
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
-
-import javax.annotation.Nullable;
-
-import java.util.Optional;
-
-/** {@link RequestBody} to trigger savepoints. */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class SavepointTriggerRequestBody implements RequestBody {
-
- public static final String FIELD_NAME_TARGET_DIRECTORY = "target-directory";
-
- private static final String FIELD_NAME_CANCEL_JOB = "cancel-job";
-
- private static final String FIELD_NAME_TRIGGER_ID = "triggerId";
- private static final String FIELD_NAME_FORMAT_TYPE = "formatType";
-
- @JsonProperty(FIELD_NAME_TARGET_DIRECTORY)
- @Nullable
- private final String targetDirectory;
-
- @JsonProperty(FIELD_NAME_CANCEL_JOB)
- private final boolean cancelJob;
-
- @JsonProperty(FIELD_NAME_TRIGGER_ID)
- @Nullable
- private final TriggerId triggerId;
-
- @JsonProperty(FIELD_NAME_FORMAT_TYPE)
- @Nullable
- private final SavepointFormatType formatType;
-
- @JsonCreator
- public SavepointTriggerRequestBody(
- @Nullable @JsonProperty(FIELD_NAME_TARGET_DIRECTORY) final String targetDirectory,
- @Nullable @JsonProperty(FIELD_NAME_CANCEL_JOB) final Boolean cancelJob,
- @Nullable @JsonProperty(FIELD_NAME_FORMAT_TYPE) final SavepointFormatType formatType,
- @Nullable @JsonProperty(FIELD_NAME_TRIGGER_ID) TriggerId triggerId) {
- this.targetDirectory = targetDirectory;
- this.cancelJob = cancelJob != null ? cancelJob : false;
- this.triggerId = triggerId;
- this.formatType = formatType;
- }
-
- @JsonIgnore
- public Optional<String> getTargetDirectory() {
- return Optional.ofNullable(targetDirectory);
- }
-
- @JsonIgnore
- public Optional<TriggerId> getTriggerId() {
- return Optional.ofNullable(triggerId);
- }
-
- public boolean isCancelJob() {
- return cancelJob;
- }
-
- @JsonIgnore
- public SavepointFormatType getFormatType() {
- return formatType;
- }
-}
diff --git a/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/stop/StopWithSavepointRequestBody.java b/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/stop/StopWithSavepointRequestBody.java
deleted file mode 100644
index 45df5e12..00000000
--- a/flink-kubernetes-operator/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/stop/StopWithSavepointRequestBody.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.runtime.rest.messages.job.savepoints.stop;
-
-import org.apache.flink.core.execution.SavepointFormatType;
-import org.apache.flink.runtime.rest.messages.RequestBody;
-import org.apache.flink.runtime.rest.messages.TriggerId;
-
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
-import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
-
-import javax.annotation.Nullable;
-
-import java.util.Optional;
-
-/** {@link RequestBody} for stopping a job with a savepoint. */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class StopWithSavepointRequestBody implements RequestBody {
-
- public static final String FIELD_NAME_TARGET_DIRECTORY = "targetDirectory";
-
- public static final String FIELD_NAME_FORMAT_TYPE = "formatType";
-
- private static final String FIELD_NAME_DRAIN = "drain";
-
- private static final String FIELD_NAME_TRIGGER_ID = "triggerId";
-
- @JsonProperty(FIELD_NAME_TARGET_DIRECTORY)
- @Nullable
- private final String targetDirectory;
-
- @JsonProperty(FIELD_NAME_DRAIN)
- private final boolean drain;
-
- @JsonProperty(FIELD_NAME_TRIGGER_ID)
- @Nullable
- private final TriggerId triggerId;
-
- @JsonProperty(FIELD_NAME_FORMAT_TYPE)
- @Nullable
- private final SavepointFormatType formatType;
-
- @JsonCreator
- public StopWithSavepointRequestBody(
- @Nullable @JsonProperty(FIELD_NAME_TARGET_DIRECTORY) final String targetDirectory,
- @Nullable @JsonProperty(FIELD_NAME_DRAIN) final Boolean drain,
- @Nullable @JsonProperty(FIELD_NAME_FORMAT_TYPE) final SavepointFormatType formatType,
- @Nullable @JsonProperty(FIELD_NAME_TRIGGER_ID) TriggerId triggerId) {
- this.targetDirectory = targetDirectory;
- this.drain = drain != null ? drain : false;
- this.triggerId = triggerId;
- this.formatType = formatType;
- }
-
- @JsonIgnore
- public Optional<String> getTargetDirectory() {
- return Optional.ofNullable(targetDirectory);
- }
-
- public boolean shouldDrain() {
- return drain;
- }
-
- @JsonIgnore
- public Optional<TriggerId> getTriggerId() {
- return Optional.ofNullable(triggerId);
- }
-
- @JsonIgnore
- public SavepointFormatType getFormatType() {
- return formatType;
- }
-}
diff --git a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesScalingRealizerTest.java b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesScalingRealizerTest.java
index 994732ab..4a60cf7e 100644
--- a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesScalingRealizerTest.java
+++ b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/autoscaler/KubernetesScalingRealizerTest.java
@@ -18,6 +18,7 @@
package org.apache.flink.kubernetes.operator.autoscaler;
import org.apache.flink.autoscaler.tuning.ConfigChanges;
+import org.apache.flink.configuration.GlobalConfiguration;
import org.apache.flink.configuration.MemorySize;
import org.apache.flink.configuration.PipelineOptions;
import org.apache.flink.configuration.TaskManagerOptions;
@@ -35,6 +36,9 @@ public class KubernetesScalingRealizerTest {
@Test
public void testApplyOverrides() {
+ // Required to keep the test config context on legacy Flink YAML converters.
+ GlobalConfiguration.setStandardYaml(false);
+
KubernetesJobAutoScalerContext ctx =
TestingKubernetesAutoscalerUtils.createContext("test", null);
diff --git a/flink-kubernetes-standalone/src/test/java/org/apache/flink/kubernetes/operator/kubeclient/factory/StandaloneKubernetesJobManagerFactoryTest.java b/flink-kubernetes-standalone/src/test/java/org/apache/flink/kubernetes/operator/kubeclient/factory/StandaloneKubernetesJobManagerFactoryTest.java
index a1514925..650dec0e 100644
--- a/flink-kubernetes-standalone/src/test/java/org/apache/flink/kubernetes/operator/kubeclient/factory/StandaloneKubernetesJobManagerFactoryTest.java
+++ b/flink-kubernetes-standalone/src/test/java/org/apache/flink/kubernetes/operator/kubeclient/factory/StandaloneKubernetesJobManagerFactoryTest.java
@@ -136,7 +136,7 @@ public class StandaloneKubernetesJobManagerFactoryTest extends ParametersTestBas
assertEquals(1, podSpec.getContainers().size());
assertEquals(TestUtils.SERVICE_ACCOUNT, podSpec.getServiceAccountName());
// Config and secret volumes
- assertEquals(3, podSpec.getVolumes().size());
+ assertEquals(4, podSpec.getVolumes().size());
final Container mainContainer = podSpec.getContainers().get(0);
assertEquals(Constants.MAIN_CONTAINER_NAME, mainContainer.getName());
@@ -184,7 +184,7 @@ public class StandaloneKubernetesJobManagerFactoryTest extends ParametersTestBas
assertEquals(
String.valueOf(TestUtils.JOB_MANAGER_MEMORY_MB), limits.get("memory").getAmount());
- assertEquals(3, mainContainer.getVolumeMounts().size());
+ assertEquals(4, mainContainer.getVolumeMounts().size());
}
@Test
diff --git a/pom.xml b/pom.xml
index 734e8efa..eebbc86f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,7 @@ under the License.
<lombok.version>1.18.30</lombok.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-io.version>2.11.0</commons-io.version>
- <flink.version>1.18.1</flink.version>
+ <flink.version>1.19.1</flink.version>
<slf4j.version>1.7.36</slf4j.version>
<log4j.version>2.17.1</log4j.version>