@Test public void testGpuInstanceAssignment() { List<V1Toleration> tolerations = factory.buildV1Toleration(newGpuJob(), JobGenerator.oneBatchTask()); V1Toleration gpuToleration = tolerations.stream().filter(t -> t.getKey().equals(KubeConstants.TAINT_GPU_INSTANCE)).findFirst().orElse(null); assertThat(gpuToleration).isEqualTo(Tolerations.TOLERATION_GPU_INSTANCE); }
@Override public List<V1Toleration> buildV1Toleration(Job job, Task task) { List<V1Toleration> tolerations = new ArrayList<>(); tolerations.add(Tolerations.TOLERATION_VIRTUAL_KUBLET); tolerations.add(Tolerations.TOLERATION_KUBE_SCHEDULER); tolerations.add(resolveTierToleration(job)); resolveAvailabilityZoneToleration(job).ifPresent(tolerations::add); resolveGpuInstanceTypeToleration(job).ifPresent(tolerations::add); resolveKubeBackendToleration(job).ifPresent(tolerations::add); return tolerations; }
DefaultTaintTolerationFactory implements TaintTolerationFactory { @Override public List<V1Toleration> buildV1Toleration(Job job, Task task) { List<V1Toleration> tolerations = new ArrayList<>(); tolerations.add(Tolerations.TOLERATION_VIRTUAL_KUBLET); tolerations.add(Tolerations.TOLERATION_KUBE_SCHEDULER); tolerations.add(resolveTierToleration(job)); resolveAvailabilityZoneToleration(job).ifPresent(tolerations::add); resolveGpuInstanceTypeToleration(job).ifPresent(tolerations::add); resolveKubeBackendToleration(job).ifPresent(tolerations::add); return tolerations; } }
DefaultTaintTolerationFactory implements TaintTolerationFactory { @Override public List<V1Toleration> buildV1Toleration(Job job, Task task) { List<V1Toleration> tolerations = new ArrayList<>(); tolerations.add(Tolerations.TOLERATION_VIRTUAL_KUBLET); tolerations.add(Tolerations.TOLERATION_KUBE_SCHEDULER); tolerations.add(resolveTierToleration(job)); resolveAvailabilityZoneToleration(job).ifPresent(tolerations::add); resolveGpuInstanceTypeToleration(job).ifPresent(tolerations::add); resolveKubeBackendToleration(job).ifPresent(tolerations::add); return tolerations; } @Inject  DefaultTaintTolerationFactory(DirectKubeConfiguration configuration,
                                         ApplicationSlaManagementService capacityManagement); }
DefaultTaintTolerationFactory implements TaintTolerationFactory { @Override public List<V1Toleration> buildV1Toleration(Job job, Task task) { List<V1Toleration> tolerations = new ArrayList<>(); tolerations.add(Tolerations.TOLERATION_VIRTUAL_KUBLET); tolerations.add(Tolerations.TOLERATION_KUBE_SCHEDULER); tolerations.add(resolveTierToleration(job)); resolveAvailabilityZoneToleration(job).ifPresent(tolerations::add); resolveGpuInstanceTypeToleration(job).ifPresent(tolerations::add); resolveKubeBackendToleration(job).ifPresent(tolerations::add); return tolerations; } @Inject  DefaultTaintTolerationFactory(DirectKubeConfiguration configuration,
                                         ApplicationSlaManagementService capacityManagement); @Override List<V1Toleration> buildV1Toleration(Job job, Task task); }
DefaultTaintTolerationFactory implements TaintTolerationFactory { @Override public List<V1Toleration> buildV1Toleration(Job job, Task task) { List<V1Toleration> tolerations = new ArrayList<>(); tolerations.add(Tolerations.TOLERATION_VIRTUAL_KUBLET); tolerations.add(Tolerations.TOLERATION_KUBE_SCHEDULER); tolerations.add(resolveTierToleration(job)); resolveAvailabilityZoneToleration(job).ifPresent(tolerations::add); resolveGpuInstanceTypeToleration(job).ifPresent(tolerations::add); resolveKubeBackendToleration(job).ifPresent(tolerations::add); return tolerations; } @Inject  DefaultTaintTolerationFactory(DirectKubeConfiguration configuration,
                                         ApplicationSlaManagementService capacityManagement); @Override List<V1Toleration> buildV1Toleration(Job job, Task task);  }