Search in sources :

Example 1 with SingularityExecutorCleanupStatistics

use of com.hubspot.singularity.executor.SingularityExecutorCleanupStatistics in project Singularity by HubSpot.

the class SingularityExecutorCleanupRunner method main.

public static void main(String... args) {
    final long start = System.currentTimeMillis();
    try {
        final Injector injector = Guice.createInjector(Stage.PRODUCTION, new SingularityRunnerBaseModule(SingularityExecutorCleanupConfiguration.class, ImmutableSet.of(SingularityS3Configuration.class, SingularityExecutorConfiguration.class)), new SingularityExecutorModule(), new SingularityExecutorCleanupModule(), new SingularityClientModule(), new SingularityMesosClientModule());
        final SingularityExecutorCleanupRunner runner = injector.getInstance(SingularityExecutorCleanupRunner.class);
        LOG.info("Starting cleanup");
        final SingularityExecutorCleanupStatistics statistics = runner.cleanup();
        LOG.info("Finished with {} after {}", statistics, JavaUtils.duration(start));
        System.exit(0);
    } catch (Throwable t) {
        LOG.error("Finished after {} with error", JavaUtils.duration(start), t);
        System.exit(1);
    }
}
Also used : SingularityExecutorCleanupConfiguration(com.hubspot.singularity.executor.cleanup.config.SingularityExecutorCleanupConfiguration) SingularityClientModule(com.hubspot.singularity.client.SingularityClientModule) Injector(com.google.inject.Injector) SingularityRunnerBaseModule(com.hubspot.singularity.runner.base.config.SingularityRunnerBaseModule) SingularityExecutorCleanupModule(com.hubspot.singularity.executor.cleanup.config.SingularityExecutorCleanupModule) SingularityExecutorCleanupStatistics(com.hubspot.singularity.executor.SingularityExecutorCleanupStatistics) SingularityExecutorModule(com.hubspot.singularity.executor.config.SingularityExecutorModule) SingularityMesosClientModule(com.hubspot.mesos.client.SingularityMesosClientModule)

Example 2 with SingularityExecutorCleanupStatistics

use of com.hubspot.singularity.executor.SingularityExecutorCleanupStatistics in project Singularity by HubSpot.

the class SingularityExecutorCleanupRunner method cleanup.

public SingularityExecutorCleanupStatistics cleanup() {
    SingularityExecutorCleanupStatistics cleanupStatistics = cleanup.clean();
    fileHelper.writeObject(cleanupStatistics, Paths.get(cleanupConfiguration.getExecutorCleanupResultsDirectory()).resolve(String.format("%s%s", System.currentTimeMillis(), cleanupConfiguration.getExecutorCleanupResultsSuffix())), LOG);
    return cleanupStatistics;
}
Also used : SingularityExecutorCleanupStatistics(com.hubspot.singularity.executor.SingularityExecutorCleanupStatistics)

Aggregations

SingularityExecutorCleanupStatistics (com.hubspot.singularity.executor.SingularityExecutorCleanupStatistics)2 Injector (com.google.inject.Injector)1 SingularityMesosClientModule (com.hubspot.mesos.client.SingularityMesosClientModule)1 SingularityClientModule (com.hubspot.singularity.client.SingularityClientModule)1 SingularityExecutorCleanupConfiguration (com.hubspot.singularity.executor.cleanup.config.SingularityExecutorCleanupConfiguration)1 SingularityExecutorCleanupModule (com.hubspot.singularity.executor.cleanup.config.SingularityExecutorCleanupModule)1 SingularityExecutorModule (com.hubspot.singularity.executor.config.SingularityExecutorModule)1 SingularityRunnerBaseModule (com.hubspot.singularity.runner.base.config.SingularityRunnerBaseModule)1