Skip to content

Commit

Permalink
[HWORKS-484] Consecutive python uninstall commands uses incorrect tag (
Browse files Browse the repository at this point in the history
  • Loading branch information
robzor92 authored Apr 4, 2023
1 parent 1464c02 commit 3cd1dc2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,15 @@ private void uninstallLibrary(CondaCommands cc)

File baseDir = new File("/tmp/docker/" + cc.getProjectId().getName());
baseDir.mkdirs();
Project project = projectFacade.findById(cc.getProjectId().getId()).orElseThrow(() -> new ProjectException(
RESTCodes.ProjectErrorCode.PROJECT_NOT_FOUND, Level.FINE, "projectId: " + cc.getProjectId().getId()));
try {
File dockerFile = new File(baseDir, "dockerFile_" + cc.getProjectId().getName());
File home = new File(System.getProperty("user.home"));
FileUtils.copyFileToDirectory(new File(home, ".condarc"), baseDir);
FileUtils.copyDirectoryToDirectory(new File(home, ".pip"), baseDir);
try (BufferedWriter writer = new BufferedWriter(new FileWriter(dockerFile))) {
writer.write("FROM " + projectUtils.getFullDockerImageName(cc.getProjectId(), false) + "\n");
writer.write("FROM " + projectUtils.getFullDockerImageName(project, false) + "\n");
writer.newLine();
writer.write(
"RUN --mount=type=bind,source=.condarc,target=/root/.condarc"
Expand All @@ -519,9 +521,7 @@ private void uninstallLibrary(CondaCommands cc)
throw new UnsupportedOperationException("install type unknown: " + cc.getInstallType());
}
}

Project project = projectFacade.findById(cc.getProjectId().getId()).orElseThrow(() -> new ProjectException(
RESTCodes.ProjectErrorCode.PROJECT_NOT_FOUND, Level.FINE, "projectId: " + cc.getProjectId().getId()));

String nextDockerImageName = getNextDockerImageName(project);

ProcessDescriptor processDescriptor = new ProcessDescriptor.Builder()
Expand Down

0 comments on commit 3cd1dc2

Please sign in to comment.