Skip to content

Adding concept of actions #1150

Open
Open
@nitrosx

Description

@nitrosx

Summary

Implement the concept of actions.

Concept Definition

An action is literally an syncronous action that can be performed on the datasets currently placed in the cart or on a single dataset.

Details

An action can be defined for the cart or for any individual dataset.
An action can redirect the user to an external service or create an asynchronous job or a passive job.
In the definition, the action should contain its type, if it is available in cart and/or in datasets and if needs to be logged.
A collection should be created in mongodb to allow logging.

Examples

If we would like to define the following actions:

  1. Archive: create a job and submit a message to rabbitmq server rabbit.our.institution on topic archive for the datasets in the cart
  2. Retrieve: create a job and submit a message to rabbitmq server rabbit.our.institution on topic retrieve for the datasets in the cart
  3. Get Notebook: redirect user to external microservice with URL notebook.our.institution that should prepopulate a jupyter notebook and push it to the user machine using http download. This action is available both in cart and at the dataset level.
  4. Analyze: create a job with the analysis request. An external service will query at scheduled time for this jobs to start the analysis on an external infrastructure.

In order to define such actions, the frontend configuration file should contains the following section:

actions : [
 {
  id: 'a5f43a5e-26e3-11ee-870c-3b096f8c3106',
  machine_name: 'archive_job_1',
  displayed_name: 'Archive',
  icon: 'icons/archive.png',
  type: 'rabbitmq_job',
  parameters: {
   server: 'rabbit.our.institution',
   topic: 'archive',
  },
  availability: {
   cart: true,
   dataset: false,
  },
  log: true,
 },
 {
  id: '02999218-26e4-11ee-8bef-7324e23d8360',
  machine_name: 'retrieve_job_1',
  displayed_name: 'Retrieve',
  icon: 'icons/retrieve.png',
  type: 'rabbitmq_job',
  parameters: {
   server: 'rabbit.our.institution',
   topic: 'retrieve',
  },
  availability: {
   cart: true,
   dataset: false,
  },
  log: true,
 },
 {
  id: '15ea1338-26e4-11ee-a932-d77973d535cb',
  machine_name: 'jupyter_job_1',
  displayed_name: 'Get Notebook',
  icon: 'icons/notebook.png',
  type: 'redirect',
  parameters: {
   server: 'notebook.our.institution',
  },
  availability: {
   cart: true,
   dataset: true,
  },
  log: true,
 },
 {
  id: '15ea1338-26e4-11ee-a932-d77973d535cb',
  machine_name: 'analysis_job_1',
  common_name: 'Run analysis',
  icon: 'icons/analysis.png',
  type: 'passive_job',
  conditions: {
   <dataset_conditions_for availability>
  },
  parameters: {
   key_1: 'value_1',
   ...
  },
  availability: {
   cart: false,
   dataset: true,
  },
  log: true,
 }
]

this results with the following actions and icons in cart:

  • Archive
  • Retrieve
  • Get notebook

while on the datasets details page, there will be the following actions:

  • Get notebook
  • Run analysis

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions