thin-edge / tedge-container-plugin

thin-edge.io community plugin to manage containers and container groups (aka docker compose)
MIT License
6 stars 4 forks source link

UI plugin is not selectable/installable after uploading on c8y >= 10.17 #20

Closed reubenmiller closed 1 year ago

reubenmiller commented 1 year ago

Newer versions of Cumulocity IoT (>=10.17) seem to have a slight schema change to the manifest file (or the build process is doing something wrong), which results in the plugin not being properly recognized/installable after being uploaded.

Workaround

  1. Upload the UI zip file as an extension
  2. Modify the application information using the following cli command (using https://goc8ycli.netlify.app/)
c8y applications update --id tedge-container-plugin-ui --template '
{
  "manifest": {
    "author": "Felix Schaede",
    "name": "tedge-container-plugin-ui",
    "version": "0.0.3",
    "description": "Adds tab to manage docker containers to a device",
    "license": "Apache 2.0",
    "keywords": [
      "Cumulocity",
      "Plugin",
      "Widget"
    ],
    "contextPath": "tedge-container-plugin-ui",
    "key": "tedge-container-plugin-ui-key",
    "globalTitle": "Thin-edge Docker UI",
    "tabsHorizontal": true,
    "isPackage": true,
    "noAppSwitcher": true,
    "package": "plugin",
    "requiredPlatformVersion": ">=1016.0.0",
    "exports": [
      {
        "name": "Container Info Tab",
        "module": "ContainerInfoModule",
        "path": "./src/container-info/container-info.module.ts",
        "description": "Adds a tab to a container service to display all relevant container information."
      },
      {
        "name": "Container Management Tab",
        "module": "ContainerManagementModule",
        "path": "./src/container-management/container-management.module.ts",
        "description": "Adds a tab to a device to monitor the installed containers"
      },
      {
        "name": "Container Group Management Tab",
        "module": "GroupManagementModule",
        "path": "./src/group-management/group-management.module.ts",
        "description": "Adds a tab to the device to monitor container groups (aka. docker compose)."
      }
    ],
    "remotes": {
      "container-plugin": [
        "ContainerManagementModule"
      ],
      "Group-plugin": [
        "GroupManagementModule"
      ],
      "Container-Info-plugin": [
        "ContainerInfoModule"
      ]
    }
  }
}
'

Alternatively, if you have cloned the tedge-container-plugin project already you can use the ui/package.json file directly in a jsonnet template when using go-c8y-cli.

c8y applications update \
    --id tedge-container-plugin-ui \
    --template "{manifest: (import 'ui/package.json').c8y.application}" \
    --dry
jvanderl commented 1 year ago

Had this issue on a 10.17 edge server as well. Workaround results in plugins being recognized so they can be added to a copy of the device manager. Excellent stuff Reuben!

reubenmiller commented 1 year ago

Closing as the issue seems to be fixed in Cumulocity 10.18.