Search in sources :

Example 1 with DynamicParametersConfigurationParserFactory

use of org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory in project flink by apache.

the class KubernetesSessionClusterEntrypoint method main.

public static void main(String[] args) {
    // startup checks and logging
    EnvironmentInformation.logEnvironmentInfo(LOG, KubernetesSessionClusterEntrypoint.class.getSimpleName(), args);
    SignalHandler.register(LOG);
    JvmShutdownSafeguard.installAsShutdownHook(LOG);
    final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(args, new DynamicParametersConfigurationParserFactory(), KubernetesSessionClusterEntrypoint.class);
    final ClusterEntrypoint entrypoint = new KubernetesSessionClusterEntrypoint(KubernetesEntrypointUtils.loadConfiguration(dynamicParameters));
    ClusterEntrypoint.runClusterEntrypoint(entrypoint);
}
Also used : DynamicParametersConfigurationParserFactory(org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory) Configuration(org.apache.flink.configuration.Configuration) SessionClusterEntrypoint(org.apache.flink.runtime.entrypoint.SessionClusterEntrypoint) ClusterEntrypoint(org.apache.flink.runtime.entrypoint.ClusterEntrypoint)

Example 2 with DynamicParametersConfigurationParserFactory

use of org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory in project flink by apache.

the class YarnApplicationClusterEntryPoint method main.

public static void main(final String[] args) {
    // startup checks and logging
    EnvironmentInformation.logEnvironmentInfo(LOG, YarnApplicationClusterEntryPoint.class.getSimpleName(), args);
    SignalHandler.register(LOG);
    JvmShutdownSafeguard.installAsShutdownHook(LOG);
    Map<String, String> env = System.getenv();
    final String workingDirectory = env.get(ApplicationConstants.Environment.PWD.key());
    Preconditions.checkArgument(workingDirectory != null, "Working directory variable (%s) not set", ApplicationConstants.Environment.PWD.key());
    try {
        YarnEntrypointUtils.logYarnEnvironmentInformation(env, LOG);
    } catch (IOException e) {
        LOG.warn("Could not log YARN environment information.", e);
    }
    final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(args, new DynamicParametersConfigurationParserFactory(), YarnApplicationClusterEntryPoint.class);
    final Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, dynamicParameters, env);
    PackagedProgram program = null;
    try {
        program = getPackagedProgram(configuration);
    } catch (Exception e) {
        LOG.error("Could not create application program.", e);
        System.exit(1);
    }
    try {
        configureExecution(configuration, program);
    } catch (Exception e) {
        LOG.error("Could not apply application configuration.", e);
        System.exit(1);
    }
    YarnApplicationClusterEntryPoint yarnApplicationClusterEntrypoint = new YarnApplicationClusterEntryPoint(configuration, program);
    ClusterEntrypoint.runClusterEntrypoint(yarnApplicationClusterEntrypoint);
}
Also used : DynamicParametersConfigurationParserFactory(org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory) PackagedProgram(org.apache.flink.client.program.PackagedProgram) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration) Configuration(org.apache.flink.configuration.Configuration) IOException(java.io.IOException) FlinkException(org.apache.flink.util.FlinkException) IOException(java.io.IOException)

Example 3 with DynamicParametersConfigurationParserFactory

use of org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory in project flink by apache.

the class YarnJobClusterEntrypoint method main.

// ------------------------------------------------------------------------
// The executable entry point for the Yarn Application Master Process
// for a single Flink job.
// ------------------------------------------------------------------------
public static void main(String[] args) {
    LOG.warn("Job Clusters are deprecated since Flink 1.15. Please use an Application Cluster/Application Mode instead.");
    // startup checks and logging
    EnvironmentInformation.logEnvironmentInfo(LOG, YarnJobClusterEntrypoint.class.getSimpleName(), args);
    SignalHandler.register(LOG);
    JvmShutdownSafeguard.installAsShutdownHook(LOG);
    Map<String, String> env = System.getenv();
    final String workingDirectory = env.get(ApplicationConstants.Environment.PWD.key());
    Preconditions.checkArgument(workingDirectory != null, "Working directory variable (%s) not set", ApplicationConstants.Environment.PWD.key());
    try {
        YarnEntrypointUtils.logYarnEnvironmentInformation(env, LOG);
    } catch (IOException e) {
        LOG.warn("Could not log YARN environment information.", e);
    }
    final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(args, new DynamicParametersConfigurationParserFactory(), YarnJobClusterEntrypoint.class);
    final Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, dynamicParameters, env);
    YarnJobClusterEntrypoint yarnJobClusterEntrypoint = new YarnJobClusterEntrypoint(configuration);
    ClusterEntrypoint.runClusterEntrypoint(yarnJobClusterEntrypoint);
}
Also used : DynamicParametersConfigurationParserFactory(org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory) Configuration(org.apache.flink.configuration.Configuration) IOException(java.io.IOException)

Example 4 with DynamicParametersConfigurationParserFactory

use of org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory in project flink by apache.

the class YarnSessionClusterEntrypoint method main.

public static void main(String[] args) {
    // startup checks and logging
    EnvironmentInformation.logEnvironmentInfo(LOG, YarnSessionClusterEntrypoint.class.getSimpleName(), args);
    SignalHandler.register(LOG);
    JvmShutdownSafeguard.installAsShutdownHook(LOG);
    Map<String, String> env = System.getenv();
    final String workingDirectory = env.get(ApplicationConstants.Environment.PWD.key());
    Preconditions.checkArgument(workingDirectory != null, "Working directory variable (%s) not set", ApplicationConstants.Environment.PWD.key());
    try {
        YarnEntrypointUtils.logYarnEnvironmentInformation(env, LOG);
    } catch (IOException e) {
        LOG.warn("Could not log YARN environment information.", e);
    }
    final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(args, new DynamicParametersConfigurationParserFactory(), YarnSessionClusterEntrypoint.class);
    final Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, dynamicParameters, env);
    YarnSessionClusterEntrypoint yarnSessionClusterEntrypoint = new YarnSessionClusterEntrypoint(configuration);
    ClusterEntrypoint.runClusterEntrypoint(yarnSessionClusterEntrypoint);
}
Also used : DynamicParametersConfigurationParserFactory(org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory) Configuration(org.apache.flink.configuration.Configuration) IOException(java.io.IOException)

Example 5 with DynamicParametersConfigurationParserFactory

use of org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory in project flink by apache.

the class KubernetesApplicationClusterEntrypoint method main.

public static void main(final String[] args) {
    // startup checks and logging
    EnvironmentInformation.logEnvironmentInfo(LOG, KubernetesApplicationClusterEntrypoint.class.getSimpleName(), args);
    SignalHandler.register(LOG);
    JvmShutdownSafeguard.installAsShutdownHook(LOG);
    final Configuration dynamicParameters = ClusterEntrypointUtils.parseParametersOrExit(args, new DynamicParametersConfigurationParserFactory(), KubernetesApplicationClusterEntrypoint.class);
    final Configuration configuration = KubernetesEntrypointUtils.loadConfiguration(dynamicParameters);
    PackagedProgram program = null;
    try {
        program = getPackagedProgram(configuration);
    } catch (Exception e) {
        LOG.error("Could not create application program.", e);
        System.exit(1);
    }
    try {
        configureExecution(configuration, program);
    } catch (Exception e) {
        LOG.error("Could not apply application configuration.", e);
        System.exit(1);
    }
    final KubernetesApplicationClusterEntrypoint kubernetesApplicationClusterEntrypoint = new KubernetesApplicationClusterEntrypoint(configuration, program);
    ClusterEntrypoint.runClusterEntrypoint(kubernetesApplicationClusterEntrypoint);
}
Also used : DynamicParametersConfigurationParserFactory(org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory) PackagedProgram(org.apache.flink.client.program.PackagedProgram) Configuration(org.apache.flink.configuration.Configuration) ApplicationConfiguration(org.apache.flink.client.deployment.application.ApplicationConfiguration) FlinkException(org.apache.flink.util.FlinkException)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)5 DynamicParametersConfigurationParserFactory (org.apache.flink.runtime.entrypoint.DynamicParametersConfigurationParserFactory)5 IOException (java.io.IOException)3 ApplicationConfiguration (org.apache.flink.client.deployment.application.ApplicationConfiguration)2 PackagedProgram (org.apache.flink.client.program.PackagedProgram)2 FlinkException (org.apache.flink.util.FlinkException)2 ClusterEntrypoint (org.apache.flink.runtime.entrypoint.ClusterEntrypoint)1 SessionClusterEntrypoint (org.apache.flink.runtime.entrypoint.SessionClusterEntrypoint)1