Create Review VM from the Airlock UI screen
See original GitHub issueDescription
As a TRE Airlock Manager I want to have a button next to the Airlock Request to spin up the Review VM So that I don’t have to remember which workspace and workspace service to create it in and I don’t have to copy SAS URL
Implementation proposal
Configuration
We propose to add an additional nested block to Research Workspace (=base workspace) properties for configuring the Airlock Review VMs.
This could look like this:
{
"id": "<id>",
"templateName": "tre-workspace-base",
"templateVersion": "0.3.28",
"properties": {
"enable_airlock": true,
"airlock_review_config": {
"import": {
"workspace_id": "<guid>", // ID for the already deployed Import Review Workspace to use for reviews
"workspace_service_id": "<guid>", // ID for the already deployed Workspace Service to deploy review VMs to
"user_resource_template_name": "guacamole-azure-import-reviewvm" // the user resource template to create
},
"export": {
"workspace_serivce_id": "<guid>", // ID for the already deployed Workspace Service to deploy review VMs to
"user_resource_template_name": "guacamole-azure-import-reviewvm" // the user resource template to create
},
},
// other properties as normal
},
The export
section does not have workspace_id
because for export it will always be the Research Workspace the data is exported from.
The corresponding resources need to already be deployed before this configuration can be set, which is why we should recommend users to issue an update on an existing resource if they wish to configure Airlock Review.
UI screens
We then propose to add a button / screen on the UI next to the Airlock Review requests (updated in Figma):
The button will be greyed out if the above configuration is not set for the workspace, with a message for the user to ask their TRE admin to configure this for them.
If there already is a review VM created for the request by this user, it could show a link to that created review VM.
If the review VM was created by another user, it could show a message saying that another user is currently reviewing this request. For this, the review_user_resources
field in Airlock Request object is used (see below).
API endpoint
Add a corresponding API endpoint that will create a review User Resource
/api/workspaces/{workspace_id}/requests/{airlock_request_id}/create-review-user-resource
This will accept the Research Workspace ID and Request ID as parameters, from the properties outlined above will determine in which Workspace and Workspace Service to create them in, will create the user resource and return the Operation to watch, which will be tracked in the usual way on the UI.
The API endpoint will also update the Request object with the information on this VM:
{
"id": "45e1d9d8-f669-47bf-b0eb-a11bb34aa456",
"workspaceId": "26f41c2a-2bed-4f78-a745-c41ca8f326fe",
"requestType": "export",
"files": [
{
"name": "research_result.txt",
"size": 7
}
],
"review_user_resources": [
{
"id": "<guid>",
"workspace_id": "<guid>",
"workspace_service_id": "<guid>"
}
],
// other properties as normal
}
Acceptance criteria
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Added proposed UI designs
I would imagine that they’ll be present in the UI - we currently don’t have a way to hide things for create but show only for update. We could do that down the line - but in the near term we would just add some description on the fields to let the user know they’re optional and can be updated later.
Would be reticent to add special code to validate that the IDs are correct - I think we could add a regex in the template to make sure it’s a guid, but not that it relates to a valid resource. That’s up to the TRE admin to get right, and if it’s not right then the error coming back from a review VM creation would tell them about it.