Skip to content

Commit

Permalink
Return message for storage backend error
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 0994bc9c11ec0a59988bec59b6b91e46f9ff6d0a
  • Loading branch information
pdesgarets authored and Gitlab-CI committed Dec 4, 2024
1 parent f98b5ad commit f8defd0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public class ContainerDto {
private ContainerStatusDto status = ContainerStatusDto.OK;
private Long deletionTime;
private Boolean needsNewGpu;
private String creationError;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private ContainerDto mapContainerResponseToContainer(ContainerResponse container
// Need to change it if different auth method
containerDto.setPassword(containerResponse.getUserPassword().getPassword());
containerDto.setUsername(containerResponse.getUserPassword().getUsername());
containerDto.setCreationError(containerResponse.getError());
containerDto.setDeletionTime(containerResponse.getDeletionTime());
containerDto.setNeedsNewGpu(course.isPresent() && course.get().getComputeType().isGpu());
return containerDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public class ContainerTestConnectionTask implements Runnable {
@Override

public void run() {
if (!StringUtils.isBlank(containerScheduledDto.getContainerDto().getCreationError())) {
containerScheduledDto.getContainerDto().setStatus(ContainerStatusDto.KO);
containerStorage.addContainer(
containerScheduledDto.getContainerDto(),
containerScheduledDto.getUserId(),
containerScheduledDto.getCourseId()
);
return;
}
boolean succededConnection = testAllConnection();
Long maxConnectionRetry = containerScheduledDto.getContainerDto().getNeedsNewGpu()
? containerTestParameterConfiguration.getNumberOfConnectionRetryForGpu()
Expand Down
1 change: 1 addition & 0 deletions back/src/main/proto/containerService.proto
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ message ContainerResponse {
AuthenticationKeyMethod authenticationKey = 8;
}
int64 deletionTime = 9;
string error = 10;
};


Expand Down

0 comments on commit f8defd0

Please sign in to comment.