diff --git a/hopsworks-common/src/main/java/io/hops/hopsworks/common/dao/tensorflow/config/TensorBoardProcessMgr.java b/hopsworks-common/src/main/java/io/hops/hopsworks/common/dao/tensorflow/config/TensorBoardProcessMgr.java index a726064596..671ccef18d 100644 --- a/hopsworks-common/src/main/java/io/hops/hopsworks/common/dao/tensorflow/config/TensorBoardProcessMgr.java +++ b/hopsworks-common/src/main/java/io/hops/hopsworks/common/dao/tensorflow/config/TensorBoardProcessMgr.java @@ -143,19 +143,17 @@ public TensorBoardDTO startTensorBoard(Project project, Users user, HdfsUsers hd while(retries > 0) { - if(retries == 0) { - throw new IOException("Failed to start TensorBoard for project=" + project.getName() + ", user=" - + user.getUid()); - } + try { - // use pidfile to kill any running servers - port = ThreadLocalRandom.current().nextInt(40000, 59999); + if(retries == 0) { + throw new IOException("Failed to start TensorBoard for project=" + project.getName() + ", user=" + + user.getUid()); + } - String[] command = new String[]{"/usr/bin/sudo", prog, "start", hdfsUser.getName(), hdfsLogdir, - tbPath, port.toString(), anacondaEnvironmentPath, settings.getHadoopVersion(), certsPath, - settings.getJavaHome()}; + // use pidfile to kill any running servers + port = ThreadLocalRandom.current().nextInt(40000, 59999); - ProcessDescriptor processDescriptor = new ProcessDescriptor.Builder() + ProcessDescriptor processDescriptor = new ProcessDescriptor.Builder() .addCommand("/usr/bin/sudo") .addCommand(prog) .addCommand("start") @@ -169,9 +167,8 @@ public TensorBoardDTO startTensorBoard(Project project, Users user, HdfsUsers hd .addCommand(settings.getJavaHome()) .ignoreOutErrStreams(true) .build(); - LOGGER.log(Level.FINE, processDescriptor.toString()); - - try { + LOGGER.log(Level.FINE, processDescriptor.toString()); + ProcessResult processResult = osProcessExecutor.execute(processDescriptor); if (!processResult.processExited()) { throw new IOException("Tensorboard start process timed out!"); @@ -192,7 +189,7 @@ public TensorBoardDTO startTensorBoard(Project project, Users user, HdfsUsers hd try { host = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException ex) { - Logger.getLogger(TensorBoardProcessMgr.class.getName()).log(Level.SEVERE, null, ex); + LOGGER.log(Level.SEVERE, null, ex); } tensorBoardDTO.setEndpoint(host + ":" + port); tensorBoardDTO.setPid(pid); @@ -262,7 +259,6 @@ public int killTensorBoard(BigInteger pid) { ProcessResult processResult = osProcessExecutor.execute(processDescriptor); if (!processResult.processExited()) { LOGGER.log(Level.SEVERE,"Failed to kill TensorBoard"); - exitValue = 2; } exitValue = processResult.getExitCode(); } catch (IOException ex) { @@ -278,7 +274,7 @@ public int killTensorBoard(BigInteger pid) { * @return */ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) - public int killTensorBoard(TensorBoard tb) throws ServiceException { + public int killTensorBoard(TensorBoard tb) { String prog = settings.getHopsworksDomainDir() + "/bin/tensorboard.sh"; int exitValue; @@ -295,10 +291,8 @@ public int killTensorBoard(TensorBoard tb) throws ServiceException { ProcessResult processResult = osProcessExecutor.execute(processDescriptor); if (!processResult.processExited()) { LOGGER.log(Level.SEVERE, "Failed to kill TensorBoard, process time-out"); - exitValue = 2; } exitValue = processResult.getExitCode(); - cleanupLocalTBDir(tb); } catch (IOException ex) { exitValue=2; LOGGER.log(Level.SEVERE,"Failed to kill TensorBoard" , ex); diff --git a/hopsworks-common/src/main/java/io/hops/hopsworks/common/security/CertificateMaterializer.java b/hopsworks-common/src/main/java/io/hops/hopsworks/common/security/CertificateMaterializer.java index 2d684a4958..64c73d82c3 100644 --- a/hopsworks-common/src/main/java/io/hops/hopsworks/common/security/CertificateMaterializer.java +++ b/hopsworks-common/src/main/java/io/hops/hopsworks/common/security/CertificateMaterializer.java @@ -1124,7 +1124,6 @@ private boolean removeRemoteInternal(MaterialKey key, String remoteDirectory, bo remoteMaterialReferencesFacade.delete(materialRef.getIdentifier()); deletedMaterial = true; } else { - materialRef.decrementReferences(); remoteMaterialReferencesFacade.update(materialRef); } } else { diff --git a/hopsworks-ear/test/spec/projects_spec.rb b/hopsworks-ear/test/spec/projects_spec.rb index 1059ee61a2..dc52239fd9 100644 --- a/hopsworks-ear/test/spec/projects_spec.rb +++ b/hopsworks-ear/test/spec/projects_spec.rb @@ -90,11 +90,7 @@ project_id = json_body[:projectId] get "#{ENV['HOPSWORKS_API']}/project/#{project_id}/dataset/getContent" expect_status(200) - jupyter = json_body.detect { |e| e[:name] == "Jupyter" } notebook = json_body.detect { |e| e[:name] == "notebook" } - expect(jupyter[:description]).to eq ("Contains Jupyter notebooks.") - expect(jupyter[:permission]).to eq ("rwxrwx--T") - expect(jupyter[:owner]).to eq ("#{@user[:fname]} #{@user[:lname]}") expect(notebook[:description]).to eq ("Contains Zeppelin notebooks.") expect(notebook[:permission]).to eq ("rwxrwx--T") expect(notebook[:owner]).to eq ("#{@user[:fname]} #{@user[:lname]}")