Skip to content

Upload datasets using the Sync Service

You can use the QDL Sync Service to upload standardized datasets (e.g. Quantify, QMI, etc.). To work correctly, the QDL Sync Service only needs to be configured. For instance, the plugin for Quantify would poll the Quantify Data Store and maps Quantify datasets to QDL datasets and additionally extracts any metadata from HDF5 files within the Quantify dataset. But the plugin for QCodes would scan a local directory for QCodes databases, and query those databases for datasets and maps those to QDL datasets. The convenience of the QDL Sync Service is that it does not disturb your existing setup.

Installation

Windows, macOS, Ubuntu, and Debian platforms are supported, for which the Sync Service installer can be found here.

Windows
  1. Open the installer.
  2. Follow the installation instructions.
  3. Uninstallation can be done like any other Windows program.

Note

Each user needs to install the sync serivce separately.

Mac
  1. Open the installer.
  2. Note that you will be stopped to install the application, because Mac cannot verify the installer. Click 'Done'. You now need to go to 'System settings' -> 'Privacy & Security' and scroll down to the 'Security' paragraph, click 'Open Anyway' and log in with local admin credentials to allow the installation.
  3. Follow the installation instructions.
  4. To uninstall, go to the application folder and double-click the uninstaller script. Note that you will need admin privileges. A terminal window will open and prompt you for your password. If successful, the message "Uninstallation successful!" will be printed in the console.
Linux
  1. Run the following command from the download location:

    sudo dpkg --install ./qdl-sync-service-<VERSION>.deb
    
  2. Compared to the other platforms, the Sync Service has to be manually started (and terminated):

    systemctl --user enable qdl-sync-service
    systemctl --user start qdl-sync-service
    
  3. To stop or restart the QDL Sync Service:

    systemctl --user stop qdl-sync-service
    systemctl --user restart qdl-sync-service
    
  4. To uninstall, run the following command:

    sudo dpkg --purge qdl
    

    If successful, the message "Uninstallation successful!" will be printed in the console.

  5. Terminate the service:

    systemctl --user stop qdl-sync-service
    systemctl --user disable qdl-sync-service
    

Note

The installation is done system-wide, but each user needs to start and terminate the Sync Service.

Python

If none of the above installers for your platform work for whatever reason (or you prefer not to install the Sync Service as an application running as a background service), it is also possible to install the QDL Sync Service from the python package. You can install the QDL Sync Service as a 'CLI tool', e.g. using uv (pipx also works):

uv tool install qdl-sync-service --index-url https://gitlab.com/api/v4/projects/66914457/packages/pypi/simple

Moreover, you can use uv to upgrade the QDL Sync Service by:

uv tool upgrade qdl-sync-service

Now you can run the QDL Sync Service (called qdl-sync-service) in the terminal:

% qdl-sync-service
INFO:     Started server process [11937]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:5500 (Press CTRL+C to quit)
Note that you will see all the log statements of the QDL Sync Service. If you close the terminal window, the Sync Service will stop running. You can run the QDL Sync Service in the background using OS specific tools (systemctl for Linux, Task manager or NSSM for Windows and launchctl for Mac).

Configure Sync Service to sync data to QDL

You can start configuring when the Sync Service is installed and running. The following four items need to be configured:

  • type, which type of data needs to be uploaded. This can be QMI (qmi), Quantify (quantify, work in progress), QCodes (qcodes, work in progres)
  • scope uid, the scope the data needs to be uploads to
  • data location, the root directory the measurement data is stored
  • version, the version of the plugin to use, see here. The version consts of three digits separated by a dot, e.g. 2.0.0. Often, the latest version available can be used.

Using the QDL CLI, the sync can be created by:

qdl sync create <type> <scope_uid> <data_location> <version>

The configuration of the sync will be printed, but the configuration can always be reviewed by:

qdl sync status

Sync service configuration:
sync interval:                                            0.1s
Data source configuration:
scope uid:                                         <scope_uid>
type:                                                   <type>
data location:                                 <data_location>
status:                                               disabled
version:                                             <version>
scan interval:                                            0.1s

Note that the status of the Sync Service is disabled by default after the sync is created.

Automated addition of attributes

The last step to consider is which attributes need to be automatically added to datasets. The plugin tries to extract all attributes (key/value pairs) from the data source type. However, the Sync Service decides which of those attributes get added to the dataset. The Sync Service decides this based on which attribute keys are provided in $HOME/.qdl/attributes.qdl. This file has a list of attribute keys:

sample
setup
measured_variable
etc

If the attribute key is collected by the sync plugin and listed here it will be added to the dataset. If not, the attribute is not added to the dataset.

Note that the attribute keys should also be allowed by the schema of the scope or the list of allowed dataset attributes as defined here.

Starting the sync proces

When everything is configured, the Sync Service can be started using:

qdl sync plugin start

The Sync Service will start and monitor the plugin. Note that when the attributes.qdl list needs to be adjusted, you need to restart the plugin:

qdl sync plugin stop

...
# change the attributes in attributes.qdl
...

qdl sync plugin start

When the version, data location, scope uid, type or sync interval needs to change, this can be done using:

qdl sync update [-u <scope_uid>] [-s <sync_interval>] [-d <data_location>] [-v version]

The Sync Service will continuously poll the data location for new datasets. Moreover, if any file gets modified or added to an existing dataset, the Sync Service will update/upload the dataset again.