czy006 commented on code in PR #3093: URL: https://github.com/apache/flink-cdc/pull/3093#discussion_r1517532665
########## flink-cdc-composer/src/main/java/org/apache/flink/cdc/composer/flink/executors/K8SApplicationComposeExecutor.java: ########## @@ -0,0 +1,88 @@ +/* + * Copyright 2023 Ververica Inc. + * + * Licensed 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.cdc.composer.flink.executors; + +import org.apache.flink.cdc.composer.PipelineComposeExecutor; +import org.apache.flink.cdc.composer.PipelineExecution; +import org.apache.flink.client.deployment.ClusterSpecification; +import org.apache.flink.client.deployment.application.ApplicationConfiguration; +import org.apache.flink.client.program.ClusterClient; +import org.apache.flink.client.program.ClusterClientProvider; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.configuration.DeploymentOptions; +import org.apache.flink.configuration.PipelineOptions; +import org.apache.flink.kubernetes.KubernetesClusterClientFactory; +import org.apache.flink.kubernetes.KubernetesClusterDescriptor; +import org.apache.flink.kubernetes.configuration.KubernetesConfigOptions; +import org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget; + +import org.apache.commons.cli.CommandLine; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +public class K8SApplicationComposeExecutor implements PipelineComposeExecutor { + + private static final Logger LOG = LoggerFactory.getLogger(K8SApplicationComposeExecutor.class); + + @Override + public PipelineExecution.ExecutionInfo deploy( + CommandLine commandLine, Configuration flinkConfig, List<Path> additionalJars) { + LOG.info("Submitting application in 'Flink K8S Application Mode'."); + flinkConfig.set(DeploymentOptions.TARGET, KubernetesDeploymentTarget.APPLICATION.getName()); + List<String> jars = + new ArrayList<>(); + // must be added cdc dist jar by default docker container path + jars.add("local:///opt/flink-cdc/lib/flink-cdc-dist-3.0-SNAPSHOT.jar"); + flinkConfig.set(PipelineOptions.JARS, jars); + // set the default cdc latest docker image + flinkConfig.set(KubernetesConfigOptions.CONTAINER_IMAGE, "flink/flink-cdc:latest"); Review Comment: Yeah, but right now our code has the highest priority. The user can do this by typing conf into the dockerfile or by configuring it through **flink-cdc.yaml**, maybe we should populate it when the user does not configure this value. I found that #2854 supports flinks-config, I don't know if the two need to be related -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
