class TensorBoardComponent extends AbstractComponent {

  @Override
  public Component createComponent() throws IOException {
    TensorFlowRunJobParameters tensorFlowParams =
        (TensorFlowRunJobParameters) this.parameters;

    Objects.requireNonNull(tensorFlowParams.getTensorboardResource(),
        "TensorBoard resource must not be null!");

    Component component = new Component();
    component.setName(role.getComponentName());
    component.setNumberOfContainers(1L);
    component.setRestartPolicy(RestartPolicyEnum.NEVER);
    component.setResource(SubmarineResourceUtils.convertYarnResourceToServiceResource(
        tensorFlowParams.getTensorboardResource()));

    if (tensorFlowParams.getTensorboardDockerImage() != null) {
      component.setArtifact(
          DockerUtilities.getDockerArtifact(tensorFlowParams.getTensorboardDockerImage()));
    }

    TensorFlowCommons.addCommonEnvironments(component, role);
    generateLaunchCommand(component);

    tensorboardLink = "http://" + YarnServiceUtils.getDNSName(
        parameters.getName(),
        role.getComponentName() + "-" + 0, TensorFlowCommons.getUserName(),
        TensorFlowCommons.getDNSDomain(yarnConfig), DEFAULT_PORT);
    LOG.info("Link to tensorboard:" + tensorboardLink);

    return component;
  }

  public  TensorBoardComponent(FileSystemOperations fsOperations,
                              RemoteDirectoryManager remoteDirectoryManager,
                              RunJobParameters parameters,
                              TensorFlowLaunchCommandFactory launchCommandFactory,
                              Configuration yarnConfig);

}