Difference between revisions of "Draft: Publish Plugin to Cloud - Labs"

From MOD Wiki
Jump to navigation Jump to search
Line 21: Line 21:
 
First you'll need install the a small python tool that will communicate with the cloud API and ease the process of building and publishing your plugin.
 
First you'll need install the a small python tool that will communicate with the cloud API and ease the process of building and publishing your plugin.
 
Please see [[MOD command line interface]], for information regarding the installation and how to use it to publish plugins to LABS.
 
Please see [[MOD command line interface]], for information regarding the installation and how to use it to publish plugins to LABS.
 
=== Getting ready to publish ===
 
 
For this tutorial we'll build the [https://github.com/drobilla/lv2 lv2 examples] from [https://github.com/moddevices/mod-plugin-builder/tree/master/plugins/package/lv2-examples here].
 
 
Now you need to create a project descriptor file so the cloud knows how to compile and publish your plugin. If you followed the tutorials on creating a plugin and deploying to your Duo you must have a buildroot .mk file in a folder. If your project is called <code>lv2-examples</code> then your package folder should be named <code>lv2-examples</code> and there must be a .mk file named <code>lv2-examples.mk</code> inside that folder.
 
 
Now create a new descriptor file named <code>lv2-example.json</code> inside your package folder with contents:
 
 
<source lang="javascript">
 
{
 
    "bundles": [
 
        { "name": "eg-amp.lv2" },
 
        { "name": "eg-fifths.lv2" },
 
        { "name": "eg-metro.lv2", "stable": true, "image_required": "1.5.0" },
 
        { "name": "eg-midigate.lv2" },
 
        { "name": "eg-sampler.lv2" },
 
        { "name": "eg-scope.lv2" }
 
    ],
 
    "project": "LV2 Examples",
 
    "developer": "David Robillard",
 
    "buildroot_pkg": "lv2-examples",
 
    "project_url": "https://github.com/drobilla/lv2"
 
}
 
</source>
 
 
In that descriptor you have to define:
 
* <code>bundles</code> - The list of bundles that will be published after the source code is compiled
 
* <code>project</code> - The project name
 
* <code>developer</code> - The name of the developer
 
* <code>buildroot_pkg</code> - The name of your buildroot package (it has to match the .mk filename)
 
* <code>project_url</code> - The url of the project
 
 
For each bundle in the bundle list you can define:
 
* <code>name</code> - The bundle name (it has to match the folder name of the bundle in the compilation output)
 
* <code>stable</code> - When set to false the plugins of the bundle will be considered being in BETA (if not defined it's assumed to be <code>false</code>)
 
* <code>image_required</code> - Define a minimum version of the MOD Image that your bundle requires (if not defined it's assumed to be <code>1.0.0</code>)
 
  
 
=== Publishing ===
 
=== Publishing ===

Revision as of 14:54, 24 September 2020

Introduction

Every MOD Duo has a Plugin Store which is connected to the cloud API. So when a new plugin is published by the MOD Team any user can install it directly from the MOD UI. As part of the MOD Labs initiative a new environment has been created to allow developers to publish their creations so MOD Duo users can also install and use them.

This article will explain how developers can publish plugins in the labs cloud environment and also how users can change their Duo configuration to consume them.

Basics

In order to create a plugin you have to:

  • Develop the source code of an LV2 plugin
  • Add a GUI
  • Compile it
  • Publish to your Duo (locally)

If you're not familiar with some of the steps above you can look at How To Build and Deploy LV2 Plugin to MOD Duo.

Compile and Publish

MOD command line interface (modcli)

First you'll need install the a small python tool that will communicate with the cloud API and ease the process of building and publishing your plugin. Please see MOD command line interface, for information regarding the installation and how to use it to publish plugins to LABS.

Publishing

Now you're ready to publish:

$ modcli bundle publish lv2-example.json
Submitting release process for project ./lv2-examples.json using file lv2-examples.tar.gz
URL: https://pipeline-labs.moddevices.com/bundle
Release process created: xxx
Uploading buildroot package lv2-examples.tar.gz ...
Checksum match ok!
Cleaning up...
Process url: https://pipeline-labs.moddevices.com/bundle/xxx/?pretty=true
Done

At the end you'll see a process url. You can load it with curl:

$ curl "https://pipeline-labs.moddevices.com/bundle/xxx/?pretty=true"

That's the publishing process that has been created in the cloud. Keep refreshing it until the status changes to finished or error. You can check the logs opening the logs_href URL in case there any issues. Once the status changes to finished the plugin is available in the labs cloud API.

To verify the published bundles you can call the cloud API:

$ curl "https://api-labs.moddevices.com/v2/lv2/plugins?pretty=true&budle_name=eg-amp.lv2"

Changing your Duo to point to the labs API

Any user interested in using your published plugin can point their MOD Duo to the labs environment.

Important Note: by following the steps below your device will only see the plugins published in labs. After installing plugins from labs you have to revert the changes to point to the original production environment. Any plugin installed will continue to exist even after changing the environment in your device.

Steps are:

SSH to your Duo

pc$ ssh root@192.168.51.1

The default root password is mod. The prompt pc$ means you have to type the following on the command line of your computer. Then duo$ indicates the following must be typed while logged in on the Duo.

Remount / in RW mode

duo$ mount / -o remount,rw

Edit API addresses

First lets backup the original file so you can restore the factory values later.

duo$ cp /etc/mod-api-addresses /etc/mod-api-addresses.bkp

Edit file /etc/mod-api-addresses to look like:

export MOD_CLOUD_HTTP_ADDRESS="https://api-labs.moddevices.com/v2"
export MOD_PEDALBOARDS_HTTP_ADDRESS="https://pedalboards-labs.moddevices.com"

Restart mod-ui

duo$ systemctl restart mod-ui

You are done. Exit the Duo with

duo$ exit

Open Plugin Store

Now if you open the Plugin Store in your MOD UI (http://modduo.localhost) you should see the plugins from the labs environment.