Skip to content

[FEATURE]Service List #44

@prasadtalasila

Description

@prasadtalasila

Describe the feature

As a user I want to get a list of services provided by a workspace so that the DTaaS front end can display shortcuts to services.

Describe the problems your feature request solves

Currently, the service endpoints for a workspace are hard coded into the DTaaS front end configuration. The following lines of the config has the service endpoints.

    REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
    REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
    REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
    REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',
    REACT_APP_WORKBENCHLINK_LIBRARY_PREVIEW: '/preview/library',
    REACT_APP_WORKBENCHLINK_DT_PREVIEW: '/preview/digitaltwins',

Such a configuration is useful when ml-workspace is used. However, when we want a variety of workspaces which provide different services, we need to have flexible service configuration.

Describe the solution you'd like

A workspace has /services end point which provides the list of services in json object. A sample json object could be

{
  'serviceid' : {
      'name': 'foo',
      'description': 'foo description',
      'endpoint': 'path suffix',
  },
  ....
}

For example, a workspace providing four services

{
  'desktop' : {
      'name': 'Desktop',
      'description': 'Virtual Desktop Environment',
      'endpoint': 'vnc?path=MAIN_USER%2Ftools%2Fvnc%2Fwebsockify',
  },
  'vscode' : {
      'name': 'VS Code',
      'description': 'VS Code IDE',
      'endpoint': 'tools/vscode',
  },
  'notebook' : {
      'name': 'Jupyter Notebook',
      'description': 'Jupyter Notebook',
      'endpoint': '',
  },
  'lab' : {
      'name': 'Jupyter Lab',
      'description': 'Jupyter Lab IDE',
      'endpoint': 'lab',
  },
}

Here MAN_USER is received from the environment variable with dtaas-user as the default username if the MAIN_USER is not specified in the environment variables.

Let the workspace serve this json file with updates for username. The above example can be placed as a template file in the code base.

Use this example poetry project structure and write the necessary code, test, documentation and code quality setup.

Place the code in admin directory (https://github.com/INTO-CPS-Association/workspace/tree/main/workspaces/src/admin).

Describe alternatives you've considered

  • Providing an index.html page for services, but that would help with using a single workspace by a user. It would not help with integration of different workspaces into a single DTaaS installation
  • Keeping same end points for all workspaces but that is proving to be difficult with different technology stacks for workspaces

Additional context

The workspaces are being improved for zero trust implementations. In such a case, users / administrator would need a way to control access to services. These services could be wrapped around web application firewall implementations, or custom wrapper scripts that would link with local OIDC implementations.

There will be DTs running inside workspaces. These DTs can register with the internal service registry so that they can be included in the service list.

Implementation of the zero trust feature is not a priority and service registry is not to be done in completing the feature.

Success Criterion

Describe the final result with the help of a checklist if needed.

Checklist:

  • Latest services JSON can be downloaded by making GET foo.com/user1/services
  • A python FASTAPI server providing serving /services
  • Service available outside of workspace by making necessary changes to nginx configuration
  • The tests for the code pass
  • Documentation Updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions