use of com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration in project concord by walmartlabs.
the class RunnerJobExecutor method getLogLevel.
private static String getLogLevel(RunnerJob job) {
RunnerConfiguration cfg = job.getRunnerCfg();
if (cfg == null) {
return null;
}
String logLevel = cfg.logLevel();
if (logLevel == null) {
return null;
}
return logLevel.toUpperCase();
}
use of com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration in project concord by walmartlabs.
the class Main method main.
public static void main(String[] args) throws Exception {
RunnerConfiguration runnerCfg = readRunnerConfiguration(args);
// create the inject with all dependencies and services available before
// the actual process' working directory is ready. It allows us to load
// all dependencies and have them available in "pre-fork" situations
Injector injector = InjectorFactory.createDefault(runnerCfg);
try {
ProcessConfiguration processCfg = injector.getInstance(ProcessConfiguration.class);
ApiClient apiClient = injector.getInstance(ApiClient.class);
ProcessHeartbeat heartbeat = new ProcessHeartbeat(apiClient, processCfg.instanceId(), runnerCfg.api().maxNoHeartbeatInterval());
heartbeat.start();
Main main = injector.getInstance(Main.class);
main.execute();
System.exit(0);
} catch (MultiException e) {
log.error(e.getMessage());
System.exit(1);
} catch (Throwable t) {
log.error("", t);
System.exit(1);
}
}
use of com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration in project concord by walmartlabs.
the class MainTest method testSegmentedLogging.
@Test
public void testSegmentedLogging() throws Exception {
deploy("logging");
save(ProcessConfiguration.builder().build());
RunnerConfiguration runnerCfg = RunnerConfiguration.builder().logging(LoggingConfiguration.builder().sendSystemOutAndErrToSLF4J(false).build()).build();
byte[] log = run(runnerCfg);
assertLog(log, "^This goes directly into the stdout$");
assertLog(log, ".*This is a processLog entry.*");
}
use of com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration in project concord by walmartlabs.
the class MainTest method testSystemOutRedirectInScripts.
@Test
public void testSystemOutRedirectInScripts() throws Exception {
deploy("systemOutRedirect");
save(ProcessConfiguration.builder().build());
RunnerConfiguration runnerCfg = RunnerConfiguration.builder().logging(LoggingConfiguration.builder().build()).build();
byte[] log = run(runnerCfg);
assertLog(log, "^.*\\|1\\|.*System.out in a script.*");
}
use of com.walmartlabs.concord.runtime.common.cfg.RunnerConfiguration in project concord by walmartlabs.
the class MainTest method testContextInjectorWithSegmentedLogger.
@Test
public void testContextInjectorWithSegmentedLogger() throws Exception {
deploy("injectorTest");
RunnerConfiguration runnerCfg = RunnerConfiguration.builder().logging(LoggingConfiguration.builder().build()).build();
save(ProcessConfiguration.builder().build());
byte[] log = run(runnerCfg);
assertLog(log, Pattern.quote("|0|1|1|0|0||70|2|0|0|0|") + ".*done!.*");
assertLog(log, Pattern.quote("|0|2|1|0|0|"));
}
Aggregations