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

From MOD Wiki
Jump to navigation Jump to search
Line 100: Line 100:
 
</source>
 
</source>
  
At the end you'll see a process url. Open it in your browser and you'll see this:
+
At the end you'll see a process url. You can load it with curl:
  
<source lang="javascript">
+
<source lang="console">
{
+
$ curl "https://pipeline-labs.moddevices.com/bundle/xxx/?pretty=true"
"created": "2018-10-21T02:05:25.995000",
 
"data": {
 
  "architectures": [
 
  "duo"
 
  ],
 
  "builder_version": "0",
 
  "bundles": [
 
  {
 
    "mod_license": "free",
 
    "name": "eg-amp.lv2",
 
    "release_number": 6
 
  },
 
  {
 
    "mod_license": "free",
 
    "name": "eg-fifths.lv2",
 
    "release_number": 6
 
  },
 
  {
 
    "image_required": "1.5.0",
 
    "mod_license": "free",
 
    "name": "eg-metro.lv2",
 
    "release_number": 6,
 
    "stable": true
 
  },
 
  {
 
    "mod_license": "free",
 
    "name": "eg-midigate.lv2",
 
    "release_number": 6
 
  },
 
  {
 
    "mod_license": "free",
 
    "name": "eg-sampler.lv2",
 
    "release_number": 6
 
  },
 
  {
 
    "mod_license": "free",
 
    "name": "eg-scope.lv2",
 
    "release_number": 6
 
  }
 
  ],
 
  "developer": "David Robillard",
 
  "project": "LV2 Examples"
 
},
 
"href": "https://pipeline-labs.moddevices.com/bundle/xxx/",
 
"id": "xxx",
 
"logs_href": "https://pipeline-labs.moddevices.com/bundle/xxx/logs/",
 
"phases": {
 
  "source_verification": [
 
  {
 
    "created": "2018-10-21T02:05:26.452000",
 
    "href": "https://pipeline-labs.moddevices.com/bundle/jobs/source_verification/xxx/",
 
    "id": "xxx",
 
    "last_updated": "2018-10-21T02:05:26.452000",
 
    "logs_href": "https://pipeline-labs.moddevices.com/bundle/jobs/source_verification/xxx/logs/",
 
    "status": "new"
 
  }
 
  ]
 
},
 
"report_href": "https://pipeline-labs.moddevices.com/bundle/xxx/report/",
 
"source-href": "https://pipeline-labs.moddevices.com/bundle/xxx/source/",
 
"status": "source_verification"
 
}
 
 
</source>
 
</source>
  
That is the publishing process that is being processed by the cloud. Keep refreshing it until the status changes to <code>finished</code> or <code>error</code>.
+
That's the publishing process that has been created in the cloud. Keep refreshing it until the status changes to <code>finished</code> or <code>error</code>.
 
You can check the logs opening the logs_href URL in case there any issues. Once the status changes to <code>finished</code> the plugin is available in the labs cloud API.
 
You can check the logs opening the logs_href URL in case there any issues. Once the status changes to <code>finished</code> the plugin is available in the labs cloud API.
  

Revision as of 02:19, 21 October 2018

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 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 mod-devel-cli project.

Once installed you can check the status:

$ modcli status
Active environment: labs
Authenticated in [labs]: No
Registered environments: ['dev', 'labs']

If your active environment is not labs' then you have to change it:

$ modcli set_active_env labs
Current environment set to: labs

Next you need to authenticate. The modcli tool will authenticate using SSO against [MOD Forum]. So make sure you register for an account first. Then:

$ modcli auth login_sso
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].

Getting ready to publish

For this tutorial we'll build the [lv2 examples] from [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 lv2-examples then your package folder should be named lv2-examples and there must be a .mk file named lv2-examples.mk inside that folder.

Now create a new descriptor file named lv2-example.json inside your package folder with contents:

{
    "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"
}

In that descriptor you have to define:

  • bundles - The list of bundles that will be published after the source code is compiled
  • project - The project name
  • developer - The name of the developer
  • buildroot_pkg - The name of your buildroot package (it has to match the .mk filename)
  • project_url - The url of the project

For each bundle in the bundle list you can define:

  • name - The bundle name (it has to match the folder name of the bundle in the compilation output)
  • stable - When set to false the plugins of the bundle will be considered being in BETA (if not defined it's assumed to be false)
  • image_required - Define a minimum version of the MOD Image that your bundle requires (if not defined it's assumed to be 1.0.0)

Publishing

Once you're 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"