You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/06/10 14:44:02 UTC

[GitHub] [flink] afedulov commented on a diff in pull request #19856: [FLINK-27854][tests] Refactor FlinkImageBuilder and FlinkContainerBuilder

afedulov commented on code in PR #19856:
URL: https://github.com/apache/flink/pull/19856#discussion_r894608652


##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/container/FlinkContainersConfig.java:
##########
@@ -0,0 +1,599 @@
+/*
+ * 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.tests.util.flink.container;
+
+import org.apache.flink.configuration.CheckpointingOptions;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.HighAvailabilityOptions;
+import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.configuration.MemorySize;
+import org.apache.flink.configuration.RestOptions;
+import org.apache.flink.configuration.TaskManagerOptions;
+
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.UUID;
+
+import static org.apache.flink.configuration.HeartbeatManagerOptions.HEARTBEAT_INTERVAL;
+import static org.apache.flink.configuration.HeartbeatManagerOptions.HEARTBEAT_TIMEOUT;
+import static org.apache.flink.configuration.JobManagerOptions.SLOT_REQUEST_TIMEOUT;
+import static org.apache.flink.configuration.MetricOptions.METRIC_FETCHER_UPDATE_INTERVAL;
+
+/** The central configuration holder for Flink container-based test environments. */
+public class FlinkContainersConfig {

Review Comment:
   @PatrickRen thanks for the review.
   I was also a bit undecided about what to do with the `FlinkContainersBuilder`. One factor is that I wanted to keep `FlinkContainerConfig` independent of any Testcontainer-specific classes (`Network`, `GenericContainer`) - the idea is to have it purely as a generalized configuration for Flink containers and not tie it into any particular testing framework implementation.  I removed `setBaseImage` as another generic parameter, but am not convinced that  moving the rest of them to `FlinkContainerConfig` is the right move. 
   
   Another question, if we decide to get rid of `FlinkContainersBuilder`, is where to place all of it's methods. `FlinkContainers` is mainly concerned with the lifecycle management of a the containers and interaction with them (job submission, cleanup etc.) and it is already a sizeable class. From the perspective of separation of concerns it makes sense to me to have a delegate that is responsible purely for the preparational steps that clearly preceded the responsibilities of `FlinkContainers`. Maybe `*Builder` is a confusing name, because it mixes both the builder pattern and the fact that we mean to actually _build_ the containers with Docker.
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org