use of com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor in project titus-control-plane by Netflix.
the class KubeAndJobServiceSyncStatusWatcher method enterActiveMode.
@Activator
public Observable<Void> enterActiveMode() {
try {
kubeApiFacade.getPodInformer().addEventHandler(new ResourceEventHandler<V1Pod>() {
@Override
public void onAdd(V1Pod obj) {
capturedState.put(obj.getMetadata().getName(), new TaskHolder(obj, false));
}
@Override
public void onUpdate(V1Pod oldObj, V1Pod newObj) {
capturedState.put(newObj.getMetadata().getName(), new TaskHolder(newObj, false));
}
@Override
public void onDelete(V1Pod obj, boolean deletedFinalStateUnknown) {
capturedState.put(obj.getMetadata().getName(), new TaskHolder(obj, true));
}
});
ScheduleDescriptor scheduleDescriptor = ScheduleDescriptor.newBuilder().withName(KubeAndJobServiceSyncStatusWatcher.class.getSimpleName()).withDescription("Compare Kube pod state with Titus job service").withInitialDelay(Duration.ofSeconds(60)).withInterval(Duration.ofSeconds(10)).withTimeout(Duration.ofSeconds((60))).build();
this.schedulerRef = titusRuntime.getLocalScheduler().schedule(scheduleDescriptor, this::process, ExecutorsExt.namedSingleThreadExecutor(KubeAndJobServiceSyncStatusWatcher.class.getSimpleName()));
} catch (Exception e) {
return Observable.error(e);
}
return Observable.empty();
}
use of com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor in project titus-control-plane by Netflix.
the class DefaultRelocationWorkflowExecutor method activate.
@Override
public void activate() {
ScheduleDescriptor relocationScheduleDescriptor = ScheduleDescriptor.newBuilder().withName("relocationWorkflow").withDescription("Task relocation scheduler").withInitialDelay(Duration.ZERO).withInterval(Duration.ofMillis(configuration.getRelocationScheduleIntervalMs())).withTimeout(Duration.ofMillis(configuration.getRelocationTimeoutMs())).withRetryerSupplier(() -> Retryers.exponentialBackoff(1, 5, TimeUnit.MINUTES)).build();
this.localSchedulerDisposable = titusRuntime.getLocalScheduler().schedule(relocationScheduleDescriptor, this::nextRelocationStep, true);
}
use of com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor in project titus-control-plane by Netflix.
the class DefaultNodeConditionController method activate.
@Override
public void activate() {
logger.info("Activating DefaultNodeConditionController");
ScheduleDescriptor nodeConditionControlLoopSchedulerDescriptor = ScheduleDescriptor.newBuilder().withName("nodeConditionCtrl").withDescription("Node Condition control loop").withInitialDelay(Duration.ZERO).withInterval(Duration.ofMillis(configuration.getNodeConditionControlLoopIntervalMs())).withTimeout(Duration.ofMillis(configuration.getNodeConditionControlLoopTimeoutMs())).withRetryerSupplier(() -> Retryers.exponentialBackoff(1, 5, TimeUnit.MINUTES)).build();
this.scheduleReference = titusRuntime.getLocalScheduler().scheduleMono(nodeConditionControlLoopSchedulerDescriptor, this::handleNodesWithBadCondition, Schedulers.parallel());
}
use of com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor in project titus-control-plane by Netflix.
the class ArchivedTasksGc method enterActiveMode.
@Activator
public void enterActiveMode() {
ScheduleDescriptor scheduleDescriptor = ScheduleDescriptor.newBuilder().withName("gcArchivedTasks").withDescription("GC oldest archived pasts once the criteria is met").withInitialDelay(Duration.ofMillis(configuration.getGcInitialDelayMs())).withInterval(Duration.ofMillis(configuration.getGcIntervalMs())).withTimeout(Duration.ofMillis(configuration.getGcTimeoutMs())).build();
this.schedulerRef = titusRuntime.getLocalScheduler().schedule(scheduleDescriptor, e -> gc(), ExecutorsExt.namedSingleThreadExecutor(ArchivedTasksGc.class.getSimpleName()));
}
use of com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor in project titus-control-plane by Netflix.
the class DefaultKubeJobManagementReconciler method enterActiveMode.
@Activator
public void enterActiveMode() {
ScheduleDescriptor scheduleDescriptor = ScheduleDescriptor.newBuilder().withName("reconcileNodesAndPods").withDescription("Reconcile nodes and pods").withInitialDelay(Duration.ofMillis(backendConfiguration.getReconcilerInitialDelayMs())).withInterval(Duration.ofMillis(backendConfiguration.getReconcilerIntervalMs())).withTimeout(Duration.ofMinutes(5)).build();
this.schedulerRef = titusRuntime.getLocalScheduler().schedule(scheduleDescriptor, e -> reconcile(), ExecutorsExt.namedSingleThreadExecutor(DefaultKubeJobManagementReconciler.class.getSimpleName()));
}
Aggregations