Barts-Life-Science / AzureTRE

An accelerator to help organizations build Trusted Research Environments on Azure.
https://microsoft.github.io/AzureTRE
MIT License
0 stars 0 forks source link

Populate the Base workspace object with template information at creation time, to hold version data #188

Open TonyWildish-BH opened 1 week ago

TonyWildish-BH commented 1 week ago

The Base workspace template is defined by a JSON object. This needs to be extended to hold information about all the workspace services and their user resources, specifically to list which versions are available to the workspace.

Something like this, though the details are up for grabs:

{
  "Guacamole": {
      "versions": [
        { "1.0.0": False },
        { "1.2.0": True },
        { "2.0.0": False },
      ],
      "user-resources": {
        "Guacamole Linux VM": {
            "versions": [
              { "2.0.2": True },
              { "2.1.0": True }
            ]
        },
        "Guacamole Windows VM": {
        }
    }
  ...
}

The essential points are:

For child resources, there are no sub-children, so the structure could be simplified by not having the "versions" key, and lifting the list of versions up a level.

The "versions" sub-structure should have entries in order. String-sorting may not work, since the version number has MAJOR.MINOR.PATCH structure.

The information to fill this structure comes from the list of registered templates in CosmosDB.

TonyWildish-BH commented 6 days ago

N.B., eventually, we will need two boolean flags per version, one for the TRE Admin and one for the Workspace Admin. The Workspace Admin will be able to change their flag only if the TRE Admin has enabled that version for a workspace (see the Service Catalogue slide deck we discussed recently).

This suggests that the version array should look something like this, instead:

      "versions": [
        { "1.0.0": [ False, False ] },
        { "1.2.0": [ True, True ] },
        { "2.0.0": [ True, False ] },
      ],

where, for example, the TRE Admin manipulates the first element, and the Workspace Admin manipulates the second element. So in this example, version 1.0.0 is disabled, and only the TRE Admin can enable it. Version 1.2.0 is enabled, and either role can enable/disable it. Version 2.0.0 is allowed by the TRE Admin, but the Workspace Admin has not enabled it for their project.