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

From MOD Wiki
Jump to navigation Jump to search
(Created page with "== 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 fr...")
 
 
(32 intermediate revisions by 3 users not shown)
Line 18: Line 18:
 
== Compile and Publish ==
 
== Compile and Publish ==
  
=== MOD command line interface (modcli) ===
+
=== MOD command line interface ===
First you'll need install a small python tool that will communicate with the cloud API and ease the process of building and publishing your plugin. Simply follow the instructions from the [https://github.com/moddevices/mod-devel-cli mod-devel-cli] project.
 
  
Once installed you can check the status:
+
For building and publishing a plugin in the cloud, the modcli is used. This is a small python tool that will communicate with the cloud API.
 +
To build and publish a plugin the following steps are needed:
 +
* Install the mod command line interface(modcli). This is a small python tool that will communicate with the cloud API.
 +
* Prepare a descriptor file that is needed by the modcli.
 +
* Use the modcli for to compile and publish the plugin in cloud.
  
<source lang="console">
+
Please see [[MOD command line interface]], for detailed information about the descriptor file and on how to use the modcli for publishing plugins to LABS.
$ modcli status
+
 
Active environment: labs
+
== Changing your Duo to point to the labs API ==
Authenticated in [labs]: No
+
 
Registered environments: ['dev', 'labs']
+
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 ===
 +
 
 +
<source lang="bash">
 +
pc$ ssh root@192.168.51.1
 +
</source>
 +
 
 +
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 ===
 +
 
 +
<source lang="bash">
 +
duo$ mount / -o remount,rw
 +
</source>
 +
 
 +
=== Edit API addresses ===
 +
 
 +
First lets backup the original file so you can restore the factory values later.
 +
 
 +
<source lang="bash">
 +
duo$ cp /etc/mod-api-addresses /etc/mod-api-addresses.bkp
 +
</source>
 +
 
 +
Edit file <code>/etc/mod-api-addresses</code> to look like:
 +
 
 +
<source lang="text">
 +
export MOD_CLOUD_HTTP_ADDRESS="https://api-labs.moddevices.com/v2"
 +
export MOD_PEDALBOARDS_HTTP_ADDRESS="https://pedalboards-labs.moddevices.com"
 
</source>
 
</source>
  
If your active environment is not ''labs' then you have to change it:
+
=== Restart mod-ui ===
  
<source lang="console">
+
<source lang="bash">
$ modcli set_active_env labs
+
duo$ systemctl restart mod-ui
Current environment set to: labs
 
 
</source>
 
</source>
  
Next you need to authenticate. The modcli tool will authenticate using SSO against [[https://forum.moddevices.com MOD Forum]]. So make sure you register for an account first. Then:
+
You are done. Exit the Duo with
  
<source lang="console">
+
<source lang="bash">
$ modcli auth login_sso
+
duo$ exit
SSO login requires you have a valid account in MOD Forum (https://forum.moddevices.com).
 
If your browser has an active session the credentials will be used for this login. Confirm? [y/N]: y
 
Logging in to [labs]...
 
You're now logged in as [xxx] in [labs].
 
 
</source>
 
</source>
  
=== Getting ready to publish ===
+
=== Open Plugin Store ===
  
Now you need to create a
+
Now if you open the Plugin Store in your MOD UI (http://modduo.localhost) you should see the plugins from the labs environment.

Latest revision as of 15:19, 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

For building and publishing a plugin in the cloud, the modcli is used. This is a small python tool that will communicate with the cloud API. To build and publish a plugin the following steps are needed:

  • Install the mod command line interface(modcli). This is a small python tool that will communicate with the cloud API.
  • Prepare a descriptor file that is needed by the modcli.
  • Use the modcli for to compile and publish the plugin in cloud.

Please see MOD command line interface, for detailed information about the descriptor file and on how to use the modcli for publishing plugins to LABS.

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.