Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cs/aws migration deploy #3584

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public class BaseWorkspaceService implements WorkspaceService {

@Value("${codeServer.collab.pid}")
private String collabPid;

@Value("${codeServer.codespace.filename}")
private String codespaceFileName;

Expand Down Expand Up @@ -740,6 +741,7 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo,
String[] parts = resource.split(",");
ownerWorkbenchCreateInputsDto.setStorage_capacity(parts[0]);
ownerWorkbenchCreateInputsDto.setMem_guarantee(parts[1]);
ownerWorkbenchCreateInputsDto.setCloudServiceProvider(ConstantsUtility.DHC_CAAS_AWS);
ownerWorkbenchCreateInputsDto.setMem_limit(parts[3]);
double cpuLimit = Double.parseDouble(parts[4].replaceAll("[^0-9.]", ""));
double cpuGuarantee = Double.parseDouble(parts[2].replaceAll("[^0-9.]", ""));
Expand All @@ -750,11 +752,8 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo,
} else {
ownerWorkbenchCreateInputsDto.setProfile("default");
}
if(entity.getData().getProjectDetails().getRecipeDetails().getCloudServiceProvider().equals(CloudServiceProviderEnum.CAAS.name())){
ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValue);
} else {
ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValueAws);
}

ownerWorkbenchCreateInputsDto.setEnvironment(codeServerEnvValueAws);
ownerWorkbenchCreateInputsDto.setPathCheckout(pathCheckout);
if(Objects.nonNull(projectOwner) && Objects.nonNull(workspaceOwner) && projectOwner.getId().equalsIgnoreCase(workspaceOwner.getId())) {
ownerWorkbenchCreateInputsDto.setIsCollaborator("false");
Expand Down Expand Up @@ -811,12 +810,13 @@ public InitializeWorkspaceResponseVO initiateWorkspace(CodeServerWorkspaceVO vo,
}
}
Date initatedOn = new Date();

SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+00:00");
entity.getData().setIntiatedOn(isoFormat.parse(isoFormat.format(new Date())));
// entity.getData().setStatus(ConstantsUtility.CREATEREQUESTEDSTATE);
entity.getData().setStatus(ConstantsUtility.CREATEDSTATE);//added
String recipeId = vo.getProjectDetails().getRecipeDetails().getRecipeId().toString();
String workspaceUrl = this.getWorkspaceUrl(recipeId,ownerwsid,workspaceOwner.getId(),vo.getProjectDetails().getRecipeDetails().getCloudServiceProvider().name());
String workspaceUrl = this.getWorkspaceUrl(recipeId,ownerwsid,workspaceOwner.getId(),ConstantsUtility.DHC_CAAS_AWS);
entity.getData().setWorkspaceUrl(workspaceUrl);
jpaRepo.save(entity);
responseVO.setData(workspaceAssembler.toVo(entity));
Expand Down