Uploading Apps
The following commands require a session
Check the Quickstart guide on how to login.
Managing App Registry¶
Overview¶
The application registry is the platform repository, hosted in the Kelvin Cloud, where all applications are stored once uploaded. In technical terms, it is a docker repository where the application images are stored. From there, these applications can be deployed, downloaded or inspected by other users in the same platform, thus leveraging cooperation and maintainability.
Uploading an App¶
Once the app is created and all its source code developed, it can be uploaded to the platform so that it may be deployed into a Node.
Apps are uploaded with the kelvin appregistry upload command.
The upload command will first build the app and then push it to currently logged docker registry.
- This command takes the following options:
--app-dir, the path to the app folder.
If not specified, the --app-dir option will assume the configuration file's enclosing directory as the app's directory.
Type the following command:
# kelvin appregistry upload --app-dir=<app_dir_path> --verbose
kelvin appregistry upload
For this example we will be uploading the 'qamm-app'.
kelvin appregistry upload --app-dir=./
Success
[kelvin.sdk][2020-04-03 17:51:13][I] Uploading application.
[kelvin.sdk][2020-04-03 17:51:14][I] Building application..
[kelvin.sdk][2020-04-03 17:51:14][I] Transferring and building application image. Please wait..
[kelvin.sdk][2020-04-03 17:51:14][I] Stopping containers of "qamm-app:0.0.1".
[kelvin.sdk][2020-04-03 17:51:14][I] Containers of "qamm-app:0.0.1" successfully stopped.
[kelvin.sdk][2020-04-03 17:51:16][R] Successful login on registry: "titan.kelvininc.com:5000"
[kelvin.sdk][2020-04-03 17:51:16][I] Building new image for "qamm-app:0.0.1".
[kelvin.sdk][2020-04-03 17:51:17][R] Image successfully built: "qamm-app:0.0.1"
[kelvin.sdk][2020-04-03 17:51:17][I] Pushing application content to titan.kelvininc.com:5000
[kelvin.sdk][2020-04-03 17:52:01][R] Application content successfully pushed to titan.kelvininc.com:5000
[kelvin.sdk][2020-04-03 17:52:01][R]
Application successfully uploaded:
Name: qamm-app
Version: 0.0.1
To deploy this application version, run the following command:
kelvin workload deploy --app-name qamm-app --app-version 0.0.1
Deleting an App¶
An app can be deleted from the platform with the kelvin appregistry delete command.
- This command takes the following arguments:
- app-name-with-version, the name and the version of the app to delete. If not version is specified, deletes all versions.
- And the following options:
--yes,-y, if specified, will ignore the destructive warning and proceed with the deletion.
# kelvin appregistry delete <app-name:app-version>
kelvin appregistry delete qamm-app-01
or
kelvin appregistry delete qamm-app-01:0.0.1
Success
[kelvin.sdk][2020-04-03 17:37:12][I] Deleting application: "qamm-app"
[kelvin.sdk][2020-04-03 17:37:12][W]
This operation will delete all versions for the app.
This will also delete all workloads associated with this app.
Are you sure? [y/N] y
[kelvin.sdk][2020-04-03 17:37:15][R] Application successfully deleted: "qamm-app"
Consulting App Registry¶
Listing Apps¶
All the available applications on the platform can be referenced with kelvin appregistry list command:
kelvin appregistry list
Success
[kelvin.sdk][2020-07-28 11:40:36][I] Retrieving apps..
[kelvin.sdk][2020-07-28 11:40:37][I]
*************************** Apps ***************************
+-----------------------------+-----------------------------------+------------+------------+------------------+----------------------------------+
| Name | Title | Platform | Type | Latest Version | Updated |
|-----------------------------+-----------------------------------+------------+------------+------------------+----------------------------------|
| analytics | analytics | python | data_model | 2.0.4 | 2020-07-03 18:42:54.524634+00:00 |
| brito-app | Brito App | platform | bash | 1.0 | 2020-06-18 17:50:39.481658+00:00 |
| even-odd-calculator | even-odd-calculator | python | data_model | 0.0.10 | 2020-07-24 18:23:32.014219+00:00 |
| kcf-app-kelvinshark | Kelvin KelvinShark application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:35.386048+00:00 |
| kcf-app-matlab | Kelvin Matlab application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:40.795427+00:00 |
| kcf-app-randopublisher | Kelvin RandoPublisher application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:45.257109+00:00 |
| kcf-proto-ace | Kelvin Halliburon ACE | cpp | cpp | 2.0.7 | 2020-07-06 21:27:50.012258+00:00 |
| kcf-proto-db2register | Kelvin Totalflow Db2Register | cpp | cpp | 2.0.7 | 2020-07-06 21:27:55.706342+00:00 |
| kcf-proto-delimiterparser | Kelvin Delimiter Parser | cpp | cpp | 2.0.7 | 2020-07-06 21:28:00.586518+00:00 |
| kcf-proto-ethernetip | Kelvin EthernetIP | cpp | cpp | 2.0.7 | 2020-07-06 21:28:06.716453+00:00 |
| kcf-proto-modbus | Kelvin Modbus protocol | cpp | cpp | 2.0.7 | 2020-07-06 21:28:11.380711+00:00 |
| kcf-proto-roc | Kelvin Roc Protocol | cpp | cpp | 2.0.7 | 2020-07-06 21:28:16.532088+00:00 |
| kcf-proto-wits0 | Kelvin WITS0 stream parser | cpp | cpp | 2.0.7 | 2020-07-06 21:28:21.510740+00:00 |
| kelvin-dynacard-forecasting | kelvin-dynacard-forecasting | python | data_model | 1.0.4 | 2020-07-04 16:50:25.486623+00:00 |
| modbus-serial-wl | modbus-serial-wl | python | data_model | 2.0.0 | 2020-07-03 18:36:52.486838+00:00 |
| modbus-simulator | modbus-simulator | python | poller | 0.0.13 | 2020-07-22 18:01:23.696330+00:00 |
| my-app | my-app | python | data_model | 0.0.1 | 2020-07-09 14:27:33.314905+00:00 |
| new-resources | new-resources | python | data_model | 0.0.1 | 2020-07-22 18:43:00.317121+00:00 |
| plunger-simulator | plunger-simulator | python | data_model | 0.0.2 | 2020-07-27 13:48:52.196279+00:00 |
| qamm-sdk-app-00 | qamm-sdk-app-00 | python | data_model | 0.0.4 | 2020-07-23 10:14:35.554853+00:00 |
| random-number-generator | random-number-generator | python | data_model | 0.0.3 | 2020-07-24 14:57:00.185421+00:00 |
| tank-level | tank-level | python | data_model | 0.2.1 | 2020-07-27 20:17:05.450129+00:00 |
+-----------------------------+-----------------------------------+------------+------------+------------------+----------------------------------+
Searching Apps¶
Instead of listing all applications, you can now search for applications based on specific queries with the kelvin appregistry search command:
# kelvin appregistry search <query>
kelvin appregistry search kcf
Success
[kelvin.sdk][2020-07-28 11:42:03][I] Searching applications that match: "kcf"
[kelvin.sdk][2020-07-28 11:42:04][I]
*************************** Apps ***************************
+---------------------------+-----------------------------------+------------+--------+------------------+----------------------------------+
| Name | Title | Platform | Type | Latest Version | Updated |
|---------------------------+-----------------------------------+------------+--------+------------------+----------------------------------|
| kcf-app-kelvinshark | Kelvin KelvinShark application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:35.386048+00:00 |
| kcf-app-matlab | Kelvin Matlab application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:40.795427+00:00 |
| kcf-app-randopublisher | Kelvin RandoPublisher application | cpp | cpp | 2.0.7 | 2020-07-06 21:27:45.257109+00:00 |
| kcf-proto-ace | Kelvin Halliburon ACE | cpp | cpp | 2.0.7 | 2020-07-06 21:27:50.012258+00:00 |
| kcf-proto-db2register | Kelvin Totalflow Db2Register | cpp | cpp | 2.0.7 | 2020-07-06 21:27:55.706342+00:00 |
| kcf-proto-delimiterparser | Kelvin Delimiter Parser | cpp | cpp | 2.0.7 | 2020-07-06 21:28:00.586518+00:00 |
| kcf-proto-ethernetip | Kelvin EthernetIP | cpp | cpp | 2.0.7 | 2020-07-06 21:28:06.716453+00:00 |
| kcf-proto-modbus | Kelvin Modbus protocol | cpp | cpp | 2.0.7 | 2020-07-06 21:28:11.380711+00:00 |
| kcf-proto-roc | Kelvin Roc Protocol | cpp | cpp | 2.0.7 | 2020-07-06 21:28:16.532088+00:00 |
| kcf-proto-wits0 | Kelvin WITS0 stream parser | cpp | cpp | 2.0.7 | 2020-07-06 21:28:21.510740+00:00 |
+---------------------------+-----------------------------------+------------+--------+------------------+----------------------------------+
Details of an App¶
You can reference the details of an application on the platform with the kelvin appregistry show command.
- This command takes the following arguments:
- app-name-with-version, the name and/or the version of the app to consult the details. If not version is specified, shows all app versions.
# kelvin appregistry show <app-name> --app-version=<app-version>
kelvin appregistry show analytics
or
kelvin appregistry show analytics:2.0.4
This command will output the app's basic information and, if available, its versions and workloads.
Success
[kelvin.sdk][2020-07-28 11:42:34][I] Retrieving details for "analytics".
[kelvin.sdk][2020-07-28 11:42:34][I] Retrieving workloads for "analytics".
[kelvin.sdk][2020-07-28 11:42:37][I]
*************************** App info ***************************
created: 2020-07-03 18:42:54.520185+00:00
description: Default description.
entry_point: analytics/analytics.py
latest_version: 2.0.4
name: analytics
platform: python
title: analytics
type: data_model
updated: 2020-07-03 18:42:54.524634+00:00
*************************** App Versions ***************************
+-----------+----------------------------------+
| Version | Updated |
|-----------+----------------------------------|
| 2.0.4 | 2020-07-03 18:42:54.520185+00:00 |
+-----------+----------------------------------+
*************************** Workloads ***************************
+----------------------------------+--------------------+--------------+------------+---------------+-------------------+-------------------------------------------+
| Name | Title | Node Name | App Name | App Version | Workload Status | Last Seen |
|----------------------------------+--------------------+--------------+------------+---------------+-------------------+-------------------------------------------|
| analytics-eed4ded8a3a83a59652655 | analytics Workload | squad4-node1 | analytics | 2.0.4 | Running | 2020-07-28 10:41:34 +0000 (a minute ago) |
+----------------------------------+--------------------+--------------+------------+---------------+-------------------+-------------------------------------------+
Downloading an App from the Registry¶
There are cases where the user may want to access a previously uploaded application for code consulting purposes.
That can be achieved with the kelvin appregistry download command.
- This command takes the following arguments:
- app-name-with-version, the name and version of the app to download.
# kelvin appregistry download <app-name> <app-version>
kelvin appregistry download qamm-app:0.0.1
Success
[kelvin.sdk][2021-01-13 18:30:56][I] Downloading application "qamm-app:1.0.0"
[kelvin.sdk][2021-01-13 18:30:57][R] Successfully logged on registry "demo.kelvininc.com:5000"
[kelvin.sdk][2021-01-13 18:30:57][I] Pulling "qamm-app:1.0.0" from "demo.kelvininc.com"
[elapsed: 00:21] - [Layer: 1.0.0] [Pending..]
[elapsed: 00:21] - [Layer: f22ccc0b8772] [Pending..]
[elapsed: 00:21] - [Layer: 3cf8fb62ba5f] [Pending..]
[elapsed: 00:21] - [Layer: e80c964ece6a] [Pending..]
[elapsed: 00:21] - [Layer: 80b46e7a120a] - [Pull complete]
[elapsed: 00:21] - [Layer: e5bce498d520] - [Pull complete]
[elapsed: 00:21] - [Layer: 251565cb943c] - [Pull complete]
[elapsed: 00:21] - [Layer: 55e018d3c07d] - [Pull complete]
[elapsed: 00:21] - [Layer: b0a15ecb0c88] - [Pull complete]
[elapsed: 00:21] - [Layer: dd63fad9067f] - [Pull complete]
[elapsed: 00:21] - [Layer: cbffdf6d242c] - [Pull complete]
[elapsed: 00:21] - [Layer: 2958f9b136b2] - [Pull complete]
[elapsed: 00:21] - [Layer: c3eb09ea2e81] - [Pull complete]
[kelvin.sdk][2021-01-13 18:31:21][R] Successfully pulled "qamm-app:1.0.0" from "demo.kelvininc.com"
[kelvin.sdk][2021-01-13 18:31:21][R] Application "qamm-app:1.0.0" successfully downloaded to the local registry
[kelvin.sdk][2021-01-13 18:31:21][R] Use `kelvin app images unpack` to extract its contents.
More information on application unpacking:
Check the Unpacking applications.