Search in sources :

Example 1 with DsPath

use of io.hops.hopsworks.api.project.util.DsPath in project hopsworks by logicalclocks.

the class TensorBoardResource method startTensorBoard.

@ApiOperation(value = "Start a new TensorBoard", response = TensorBoardDTO.class)
@POST
@Produces(MediaType.APPLICATION_JSON)
@AllowedProjectRoles({ AllowedProjectRoles.DATA_OWNER, AllowedProjectRoles.DATA_SCIENTIST })
@JWTRequired(acceptedTokens = { Audience.API }, allowedUserRoles = { "HOPS_ADMIN", "HOPS_USER" })
public Response startTensorBoard(@Context SecurityContext sc, @Context UriInfo uriInfo) throws DatasetException, ProjectException, TensorBoardException, UnsupportedEncodingException, ServiceDiscoveryException {
    DsPath dsPath = pathValidator.validatePath(this.project, "Experiments/" + experimentId);
    String fullPath = dsPath.getFullPath().toString();
    Users user = jWTHelper.getUserPrincipal(sc);
    TensorBoardDTO tensorBoardDTO = tensorBoardController.startTensorBoard(experimentId, project, user, fullPath);
    waitForTensorBoardLoaded(tensorBoardDTO);
    UriBuilder builder = uriInfo.getAbsolutePathBuilder();
    return Response.created(builder.build()).entity(tensorBoardDTO).build();
}
Also used : TensorBoardDTO(io.hops.hopsworks.common.dao.tensorflow.config.TensorBoardDTO) DsPath(io.hops.hopsworks.api.project.util.DsPath) Users(io.hops.hopsworks.persistence.entity.user.Users) UriBuilder(javax.ws.rs.core.UriBuilder) POST(javax.ws.rs.POST) Produces(javax.ws.rs.Produces) JWTRequired(io.hops.hopsworks.jwt.annotation.JWTRequired) ApiOperation(io.swagger.annotations.ApiOperation) AllowedProjectRoles(io.hops.hopsworks.api.filter.AllowedProjectRoles)

Example 2 with DsPath

use of io.hops.hopsworks.api.project.util.DsPath in project hopsworks by logicalclocks.

the class EnvironmentResource method getYmlPath.

private String getYmlPath(String path) throws DatasetException, ProjectException, UnsupportedEncodingException {
    if (Strings.isNullOrEmpty(path)) {
        return null;
    }
    DsPath ymlPath = pathValidator.validatePath(this.project, path);
    ymlPath.validatePathExists(inodeController, false);
    org.apache.hadoop.fs.Path fullPath = ymlPath.getFullPath();
    return fullPath.toString();
}
Also used : DsPath(io.hops.hopsworks.api.project.util.DsPath)

Aggregations

DsPath (io.hops.hopsworks.api.project.util.DsPath)2 AllowedProjectRoles (io.hops.hopsworks.api.filter.AllowedProjectRoles)1 TensorBoardDTO (io.hops.hopsworks.common.dao.tensorflow.config.TensorBoardDTO)1 JWTRequired (io.hops.hopsworks.jwt.annotation.JWTRequired)1 Users (io.hops.hopsworks.persistence.entity.user.Users)1 ApiOperation (io.swagger.annotations.ApiOperation)1 POST (javax.ws.rs.POST)1 Produces (javax.ws.rs.Produces)1 UriBuilder (javax.ws.rs.core.UriBuilder)1