Search in sources :

Example 1 with Container

use of com.netflix.titus.grpc.protogen.Container in project titus-control-plane by Netflix.

the class JobTemplateCommand method createServiceJobDescriptor.

private JobDescriptor createServiceJobDescriptor() {
    Container container = createContainer().addAllEntryPoint(asList("sleep", "30")).build();
    ServiceJobSpec jobSpec = ServiceJobSpec.newBuilder().setCapacity(Capacity.newBuilder().setMin(1).setDesired(5).setMax(10).build()).setEnabled(true).setRetryPolicy(RetryPolicy.newBuilder().setDelayed(RetryPolicy.Delayed.newBuilder().setDelayMs(1000).setRetries(3))).build();
    return JobDescriptor.newBuilder().setApplicationName("myServiceApp").setOwner(createUser()).setCapacityGroup("service_workloads").setContainer(container).putAllAttributes(createLabels()).setJobGroupInfo(createJobGroupInfo()).setService(jobSpec).build();
}
Also used : Container(com.netflix.titus.grpc.protogen.Container) ServiceJobSpec(com.netflix.titus.grpc.protogen.ServiceJobSpec)

Example 2 with Container

use of com.netflix.titus.grpc.protogen.Container in project titus-control-plane by Netflix.

the class JobTemplateCommand method createBatchJobDescriptor.

private JobDescriptor createBatchJobDescriptor() {
    Container container = createContainer().addAllEntryPoint(asList("echo", "\"Hello\"")).build();
    BatchJobSpec jobSpec = BatchJobSpec.newBuilder().setRuntimeLimitSec(180).setSize(1).setRetryPolicy(RetryPolicy.newBuilder().setDelayed(RetryPolicy.Delayed.newBuilder().setDelayMs(1000).setRetries(3))).build();
    return JobDescriptor.newBuilder().setApplicationName("myBatchApp").setOwner(createUser()).setCapacityGroup("batch_workloads").setContainer(container).putAllAttributes(createLabels()).setJobGroupInfo(createJobGroupInfo()).setBatch(jobSpec).build();
}
Also used : Container(com.netflix.titus.grpc.protogen.Container) BatchJobSpec(com.netflix.titus.grpc.protogen.BatchJobSpec)

Aggregations

Container (com.netflix.titus.grpc.protogen.Container)2 BatchJobSpec (com.netflix.titus.grpc.protogen.BatchJobSpec)1 ServiceJobSpec (com.netflix.titus.grpc.protogen.ServiceJobSpec)1