{
+ "userID": 123456,
+ "datasetID": "VNY9UUYo8ZA",
+ "source": "ObjectStore"
+}
Plugins
-The Plugin Server
- +These events do not contain any additional information as the state of the +dataset or object store may have changed by the time the event is processed. +When an event is eventually processed by the relevant lane, that lane is +responsible for validating the status of the dataset before operating on that +dataset.
Plugin Scripts
+Event Types
+Events themselves are not actually 'typed', the type is determined by which +Kafka topic the event message is submitted to.
+Import
- +When a dataset is initially uploaded, events are submitted to the import topic +when an import ready file or a +dataset meta file are put into the object store. This means +that for every upload, 2 import events will be fired.
+The dataset reconciliation lane may also fire import events +if it finds that import-ready files are present in the object store, but install +ready files are not.
+Update Meta
- +Install
+An install event is fired when a install-ready files are put +into the object store.
+Install events may also be fired by the dataset reconciliation +lane if it finds that install-ready files are present in the object store but +the dataset is not yet installed into all of its target systems.
+Check Compatibility
- +Update-Meta
+The update meta event is fired when a dataset meta file is put +into the object store.
+Install Data
+Uninstall
+Uninstall events are fired when a delete flag is put into the +object store for a dataset.
+The uninstall event may also be fired by the dataset +reconciliation lane if the dataset is found to have a delete flag in the +object store, but is not yet uninstalled from one or more of the dataset’s +install targets.
+Hard-Delete
+Hard delete events are fired when objects are actually removed from the object +store by the dataset pruner.
+Share
Uninstall
+Reconciliation
+Event Ordering
+If given a single, isolated VDI instance under no load, events would happen in a +predictable order:
+-
+
-
+
Install Meta
+
+ -
+
Import
+
+ -
+
Install
+
+
In practice, however, multiple VDI instances are running simultaneously which +leads to datasets being replicated over from other instances, and load is +unpredictable, which means events may happen in an unpredictable order.
+To illustrate this: imagine a replicated dataset’s install-ready data is made +available before any other dataset files, in this case, the install-dataset +event may fire before update meta, resulting in the event being rejected due to +missing control records in the install target. Then, when the metadata is +replicated over, the update-meta event will fire after the install was already +attempted.
+To account for the fact that event ordering is unpredictable in practice there +are a few rules in place to prevent unnecessary processing as well as make sure +the few events that are dependent on one another happen in the correct order +relative to one another.
+Additionally, lane operations are idempotent to ensure that if/when events are +processed unnecessarily, the end result is the same.
+Import
+The import event is one of the first events fired for a newly uploaded dataset. +For replicated datasets, however, this event may not be necessary at all.
+To try and avoid doing extra work the import process will be skipped if the +dataset 'directory' in the object store already contains +install ready files and a +dataset manifest file.
+Install Meta
+Along with the import event, the install/update meta event is one of the first +events fired for a new dataset.
+This event being processed is a prerequisite of a dataset being installed into +any target systems. To account for the likelihood that this event will be fired +after an install is attempted in the case of dataset replication, the +update-meta lane fires an additional dataset reconciliation +event to make sure an install event is fired again if one had already been +rejected for the dataset.
+Install Data
+For an install-data event to be processed, an update meta +event must have already been processed to create the control records in the +relevant target systems.
+import → install-meta → install-data →
+Plugins
+VDI plugins are implemented as a collection of scripts in any language executed +by separate service instances that are wrapped by a standard HTTP API. Plugin +services are registered with the primary VDI instance via environment variables.
+The Plugin Server
+ +The plugin server is a small HTTP server exposing 4 RPC-style endpoints that +trigger the execution of one or more scripts that are registered with the plugin +server instance.
+Depending on the endpoint, data may be posted to the plugin to be used by the +plugin script, and data may be returned to VDI to be put into the object store.
+Plugin Scripts
+-
+
- Import +
-
+
The import script accepts the raw upload data and performs syntactic validation +as well as any reformatting necessary to prepare the data for installation.
+
+
-
+
- Update Meta +
-
+
The update meta script is handed the full metadata for a dataset and may be used +to perform custom metadata installation steps beyond those performed by the +VDI service itself.
+
+
-
+
- Check Compatibility +
-
+
The check compatibility script is a pre-install step executed to ensure that the +data in the dataset is compatible with the target system.
+++This script is run as part of the install step immediately before the install +data script itself is run. It has access to the install ready +set of files.
+
+
-
+
- Install Data +
-
+
The install-data script takes the install-ready data and performs the +installation of that data into a target system.
+
+
-
+
- Uninstall +
-
+
The uninstall script is responsible for removing all data for a dataset from a +target system.
+
+
Import Ready Files
In future versions of VDI the raw user upload would be in a separate file
raw-upload.zip
which would be replaced by import-ready.zip
once the upload
-had been sanity and security checked.
Dataset Metadata
from the user and the initial upload process.Dataset Metadata
Visibility
A visibility indicator for a dataset that controls who can see the dataset by default, once installed.