From c5dcf8ac0b252bb47a06a40334c342451d5a7c09 Mon Sep 17 00:00:00 2001 From: Smruti Ranjan Senapati Date: Fri, 28 Apr 2023 09:10:18 +0530 Subject: [PATCH] fix(explain): verbose examples for explain command --- riocli/apply/explain.py | 4 +- riocli/apply/manifests/04-build-catkin.yaml | 19 - riocli/apply/manifests/05-build-docker.yaml | 19 - .../apply/manifests/06-build-docker-ros.yaml | 16 - .../manifests/07-device-preinstalled.yaml | 10 - riocli/apply/manifests/08-device-docker.yaml | 10 - .../manifests/09-cloud-routed-network.yaml | 41 -- .../manifests/10-device-routed-network.yaml | 10 - .../manifests/11-cloud-native-network.yaml | 11 - .../manifests/12-device-native-network.yaml | 10 - .../13-device-package-with-rosbag.yaml | 32 -- .../14-cloud-package-with-rosbag.yaml | 40 -- ...device-deployment-no-override-options.yaml | 25 - ...vice-deployment-with-override-options.yaml | 33 -- ...ice-deployment-with-on-demand-options.yaml | 27 - riocli/apply/manifests/build.yaml | 84 +++ .../manifests/deployment-nonros-cloud.yaml | 35 ++ .../manifests/deployment-nonros-device.yaml | 26 + .../apply/manifests/deployment-ros-cloud.yaml | 90 ++++ .../deployment-ros-device-no-rosbag.yaml | 36 ++ .../deployment-ros-device-rosbag.yaml | 96 ++++ riocli/apply/manifests/deployment.yaml | 279 +++++++++- riocli/apply/manifests/device-docker.yaml | 14 + riocli/apply/manifests/device-hybrid.yaml | 17 + .../apply/manifests/device-preinstalled.yaml | 14 + .../manifests/device-with-both-runtimes.yaml | 13 - riocli/apply/manifests/device.yaml | 45 ++ riocli/apply/manifests/disk.yaml | 7 +- riocli/apply/manifests/managedservice.yaml | 7 +- .../apply/manifests/network-native-cloud.yaml | 14 + .../manifests/network-native-device.yaml | 14 + .../apply/manifests/network-routed-cloud.yaml | 14 + .../manifests/network-routed-device.yaml | 14 + riocli/apply/manifests/network.yaml | 60 +++ .../apply/manifests/package-nonros-cloud.yaml | 77 +++ .../manifests/package-nonros-device.yaml | 52 ++ riocli/apply/manifests/package-ros-cloud.yaml | 145 +++++ .../package-ros-device-no-rosbag.yaml | 76 +++ .../manifests/package-ros-device-rosbag.yaml | 132 +++++ riocli/apply/manifests/package.yaml | 495 ++++++++++++++++-- riocli/apply/manifests/project.yaml | 4 +- riocli/apply/manifests/secret-docker.yaml | 14 + riocli/apply/manifests/secret.yaml | 32 +- .../{static-route.yaml => staticroute.yaml} | 5 +- .../jsonschema/schemas/deployment-schema.yaml | 9 +- riocli/jsonschema/schemas/network-schema.yaml | 2 +- riocli/jsonschema/schemas/package-schema.yaml | 21 +- .../schemas/static_route-schema.yaml | 5 +- riocli/package/model.py | 2 +- 49 files changed, 1845 insertions(+), 412 deletions(-) delete mode 100644 riocli/apply/manifests/04-build-catkin.yaml delete mode 100644 riocli/apply/manifests/05-build-docker.yaml delete mode 100644 riocli/apply/manifests/06-build-docker-ros.yaml delete mode 100644 riocli/apply/manifests/07-device-preinstalled.yaml delete mode 100644 riocli/apply/manifests/08-device-docker.yaml delete mode 100644 riocli/apply/manifests/09-cloud-routed-network.yaml delete mode 100644 riocli/apply/manifests/10-device-routed-network.yaml delete mode 100644 riocli/apply/manifests/11-cloud-native-network.yaml delete mode 100644 riocli/apply/manifests/12-device-native-network.yaml delete mode 100644 riocli/apply/manifests/13-device-package-with-rosbag.yaml delete mode 100644 riocli/apply/manifests/14-cloud-package-with-rosbag.yaml delete mode 100644 riocli/apply/manifests/15-device-deployment-no-override-options.yaml delete mode 100644 riocli/apply/manifests/16-device-deployment-with-override-options.yaml delete mode 100644 riocli/apply/manifests/17-device-deployment-with-on-demand-options.yaml create mode 100644 riocli/apply/manifests/build.yaml create mode 100644 riocli/apply/manifests/deployment-nonros-cloud.yaml create mode 100644 riocli/apply/manifests/deployment-nonros-device.yaml create mode 100644 riocli/apply/manifests/deployment-ros-cloud.yaml create mode 100644 riocli/apply/manifests/deployment-ros-device-no-rosbag.yaml create mode 100644 riocli/apply/manifests/deployment-ros-device-rosbag.yaml create mode 100644 riocli/apply/manifests/device-docker.yaml create mode 100644 riocli/apply/manifests/device-hybrid.yaml create mode 100644 riocli/apply/manifests/device-preinstalled.yaml delete mode 100644 riocli/apply/manifests/device-with-both-runtimes.yaml create mode 100644 riocli/apply/manifests/device.yaml create mode 100644 riocli/apply/manifests/network-native-cloud.yaml create mode 100644 riocli/apply/manifests/network-native-device.yaml create mode 100644 riocli/apply/manifests/network-routed-cloud.yaml create mode 100644 riocli/apply/manifests/network-routed-device.yaml create mode 100644 riocli/apply/manifests/network.yaml create mode 100644 riocli/apply/manifests/package-nonros-cloud.yaml create mode 100644 riocli/apply/manifests/package-nonros-device.yaml create mode 100644 riocli/apply/manifests/package-ros-cloud.yaml create mode 100644 riocli/apply/manifests/package-ros-device-no-rosbag.yaml create mode 100644 riocli/apply/manifests/package-ros-device-rosbag.yaml create mode 100644 riocli/apply/manifests/secret-docker.yaml rename riocli/apply/manifests/{static-route.yaml => staticroute.yaml} (50%) diff --git a/riocli/apply/explain.py b/riocli/apply/explain.py index 7754b0ce..603a549d 100644 --- a/riocli/apply/explain.py +++ b/riocli/apply/explain.py @@ -34,9 +34,9 @@ def explain(resource: str, templates: str = None) -> None: path = Path(__file__).parent.joinpath('manifests') for each in path.glob('**/*'): - if resource in each.name: + if resource + '.yaml' == each.name: with open(each) as f: - click.secho(f.readlines()) + click.echo_via_pager(f.readlines()) raise SystemExit(0) click.secho("[Err] Resource \"{}\" not found".format(resource), fg='red') diff --git a/riocli/apply/manifests/04-build-catkin.yaml b/riocli/apply/manifests/04-build-catkin.yaml deleted file mode 100644 index 4ea21199..00000000 --- a/riocli/apply/manifests/04-build-catkin.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "catkin-build" -spec: - buildMethod: "Source" - architecture: "amd64" - repository: - url: "https://github.com/rapyuta-robotics/io_tutorials" - # gitRef: "master" - # secret: "secret-guid" - # contextDir: "talker/talker" - rosDistro: "melodic" - # catkinParameters: - # - rosPackages: - # cmakeArguments: - # makeArguments: - # catkinMakeArguments: - # blacklist: diff --git a/riocli/apply/manifests/05-build-docker.yaml b/riocli/apply/manifests/05-build-docker.yaml deleted file mode 100644 index 8f3215b4..00000000 --- a/riocli/apply/manifests/05-build-docker.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "docker-build" -spec: - buildMethod: "Docker" - architecture: "amd64" - repository: - url: "https://github.com/rapyuta-robotics/io_tutorial.git" - # gitRef: "master" - # secret: "secret-guid" - # dockerfile: "Dockerfile" - # pullSecret: "secret-guid" - # contextDir: "talker/talker" - # pushRepository: "rrdockerhub/test" - # pushSecret: "secret-guid" - # tagName: "tag-name" - # triggerName: "trigger-name" - # webhookURL: "http://webhook.url" diff --git a/riocli/apply/manifests/06-build-docker-ros.yaml b/riocli/apply/manifests/06-build-docker-ros.yaml deleted file mode 100644 index fca6cb6f..00000000 --- a/riocli/apply/manifests/06-build-docker-ros.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Build" -metadata: - name: "docker-ros-build" -spec: - recipe: "Docker" - architecture: "amd64" - - # gitRef: "master" - # secret: "secret-guid" - # contextDir: "talker/talker" - rosDistro: "melodic" - repository: - url: "https://github.com/rapyuta-robotics/io_tutorials.git" - buildMethod: "Source" - diff --git a/riocli/apply/manifests/07-device-preinstalled.yaml b/riocli/apply/manifests/07-device-preinstalled.yaml deleted file mode 100644 index 42b214bd..00000000 --- a/riocli/apply/manifests/07-device-preinstalled.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Device" -metadata: - name: "apply-device-preinstalled" - project: "project-guid" -spec: - python: "3" - rosDistro: "melodic" - preinstalled: - enabled: True diff --git a/riocli/apply/manifests/08-device-docker.yaml b/riocli/apply/manifests/08-device-docker.yaml deleted file mode 100644 index 9f1d3f2d..00000000 --- a/riocli/apply/manifests/08-device-docker.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Device" -metadata: - name: "apply-device-docker" - project: "project-guid" -spec: - python: "3" - rosDistro: "melodic" - docker: - enabled: True diff --git a/riocli/apply/manifests/09-cloud-routed-network.yaml b/riocli/apply/manifests/09-cloud-routed-network.yaml deleted file mode 100644 index a5b8fcb5..00000000 --- a/riocli/apply/manifests/09-cloud-routed-network.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "cloud-routed-network" -spec: - runtime: "cloud" - type: "routed" - rosDistro: "kinetic" - resourceLimits: "small" ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "device-routed-network" -spec: - runtime: "device" - type: "routed" - rosDistro: "melodic" - deviceGUID: "eca8de7b-932a-499b-8b9a-3cebeb2a8c7c" - networkInterface: "wlp0s20f3" ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "cloud-native-network" -spec: - runtime: "cloud" - type: "native" - rosDistro: "melodic" - resourceLimits: "xSmall" ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "device-native-network" -spec: - runtime: "device" - type: "native" - rosDistro: "melodic" - deviceGUID: "eca8de7b-932a-499b-8b9a-3cebeb2a8c7c" - networkInterface: "wlp0s20f3" diff --git a/riocli/apply/manifests/10-device-routed-network.yaml b/riocli/apply/manifests/10-device-routed-network.yaml deleted file mode 100644 index d113788c..00000000 --- a/riocli/apply/manifests/10-device-routed-network.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "device-routed-network" -spec: - runtime: "device" - type: "routed" - rosDistro: "melodic" - deviceGUID: "299a436f-9d7f-4bbf-adce-21be06bfbbce" - networkInterface: "eth0" diff --git a/riocli/apply/manifests/11-cloud-native-network.yaml b/riocli/apply/manifests/11-cloud-native-network.yaml deleted file mode 100644 index bd43a080..00000000 --- a/riocli/apply/manifests/11-cloud-native-network.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "cloud-native-network" -spec: - runtime: "cloud" - type: "native" - rosDistro: "melodic" - resourceLimits: - cpu: 0.5 - memory: 1024 diff --git a/riocli/apply/manifests/12-device-native-network.yaml b/riocli/apply/manifests/12-device-native-network.yaml deleted file mode 100644 index f2b15407..00000000 --- a/riocli/apply/manifests/12-device-native-network.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Network" -metadata: - name: "device-native-network" -spec: - runtime: "device" - type: "native" - rosDistro: "melodic" - deviceGUID: "299a436f-9d7f-4bbf-adce-21be06bfbbce" - networkInterface: "eth0" diff --git a/riocli/apply/manifests/13-device-package-with-rosbag.yaml b/riocli/apply/manifests/13-device-package-with-rosbag.yaml deleted file mode 100644 index 33668980..00000000 --- a/riocli/apply/manifests/13-device-package-with-rosbag.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Package" #We will create a package -metadata: - name: "rosbag-dev" - version: "1.0.0" - labels: - app: test -spec: - runtime: "device" - device: - arch: "amd64" - restart: "always" - ros: - enabled: True - rosBagJobs: - - name: "testbag" - recordOptions: - allTopics: True - maxSplits: 5 - compression: LZ4 - maxSplitDuration: 1 - uploadOptions: - uploadType: "OnDemand" - executables: - - name: "exec" - type: build - command: "roslaunch talker talker.launch" - runAsBash: False - build: - depends: - kind: build - nameOrGUID: "build-jtmnspmxafziwbrfjknnvyaf" diff --git a/riocli/apply/manifests/14-cloud-package-with-rosbag.yaml b/riocli/apply/manifests/14-cloud-package-with-rosbag.yaml deleted file mode 100644 index 780f919e..00000000 --- a/riocli/apply/manifests/14-cloud-package-with-rosbag.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Package" #We will create a package -metadata: - name: "rosbag-cloud" - version: "1.0.0" - labels: - app: test -spec: - runtime: cloud - cloud: - replicas: 1 - ros: - enabled: True - rosBagJobs: - - name: "testbag" - recordOptions: - topicIncludeRegex: - - "/telemetry" - maxSplits: 5 - maxSplitSize: 10 - uploadOptions: - uploadType: "OnDemand" - overrideOptions: - topicOverrideInfo: - - topicName: "/topic1" - recordFrequency: 10 - - topicName: "/topic2" - latched: True - excludeTopics: - - "/topic3" - - "/topic4" - executables: - - name: "exec" - type: build - command: "roslaunch talker talker.launch" - runAsBash: False - build: - depends: - kind: build - nameOrGUID: "build-fshjqzkbqlqwvgsksiioweuk" \ No newline at end of file diff --git a/riocli/apply/manifests/15-device-deployment-no-override-options.yaml b/riocli/apply/manifests/15-device-deployment-no-override-options.yaml deleted file mode 100644 index c297d2f7..00000000 --- a/riocli/apply/manifests/15-device-deployment-no-override-options.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: apiextensions.rapyuta.io/v1 -kind: Deployment -metadata: - name: device-no-override-options - depends: - kind: package - nameOrGUID: "pkg-epzkouhcwgqkbmibexugvlob" - version: "v1.0.0" -spec: - runtime: device - device: - depends: - kind: device - nameOrGUID: device1 - rosBagJobs: - - name: "testbag" - recordOptions: - topicIncludeRegex: - - "/telemetry" - maxSplits: 5 - compression: LZ4 - maxSplitDuration: 3 - uploadOptions: - uploadType: "Continuous" - diff --git a/riocli/apply/manifests/16-device-deployment-with-override-options.yaml b/riocli/apply/manifests/16-device-deployment-with-override-options.yaml deleted file mode 100644 index f13911c2..00000000 --- a/riocli/apply/manifests/16-device-deployment-with-override-options.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apiextensions.rapyuta.io/v1 -kind: Deployment -metadata: - name: device-with-override-options - depends: - kind: package - nameOrGUID: "pkg-epzkouhcwgqkbmibexugvlob" - version: "v1.0.0" -spec: - runtime: device - device: - depends: - kind: device - nameOrGUID: device1 - rosBagJobs: - - name: "testbag" - recordOptions: - topicIncludeRegex: - - "/telemetry" - maxSplits: 5 - compression: LZ4 - maxSplitDuration: 180 - uploadOptions: - uploadType: "Continuous" - overrideOptions: - topicOverrideInfo: - - topicName: "/topic1" - recordFrequency: 10 - - topicName: "/topic2" - latched: True - excludeTopics: - - "/topic3" - - "/topic4" \ No newline at end of file diff --git a/riocli/apply/manifests/17-device-deployment-with-on-demand-options.yaml b/riocli/apply/manifests/17-device-deployment-with-on-demand-options.yaml deleted file mode 100644 index d476974c..00000000 --- a/riocli/apply/manifests/17-device-deployment-with-on-demand-options.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: apiextensions.rapyuta.io/v1 -kind: Deployment -metadata: - name: device-with-on-demand-opts - depends: - kind: package - nameOrGUID: "pkg-zofyhzjewrdlxpykebzbrzrb" - version: "v1.0.0" -spec: - runtime: device - device: - depends: - kind: device - nameOrGUID: device1 - rosBagJobs: - - name: "testbag" - recordOptions: - allTopics: True - maxSplits: 10 - compression: LZ4 - maxSplitDuration: 1 - uploadOptions: - uploadType: "OnDemand" - onDemandOpts: - timeRange: - from: 10 - to: 11 \ No newline at end of file diff --git a/riocli/apply/manifests/build.yaml b/riocli/apply/manifests/build.yaml new file mode 100644 index 00000000..5a71aa0b --- /dev/null +++ b/riocli/apply/manifests/build.yaml @@ -0,0 +1,84 @@ +# Deprecated. Builds support will be removed soon. +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Build" +metadata: + name: "build-docker" +spec: + buildMethod: "Docker" + docker: + architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] + dockerfile: Dockerfile + pullSecret: "secret-guid" + isRos: True + rosDistro: melodic + simulation: False + repository: + url: "https://github.com/rapyuta-robotics/io_tutorial.git" + # gitRef: "master" + # secret: "secret-guid" + # dockerfile: "Dockerfile" + # pullSecret: "secret-guid" + # contextDir: "talker/talker" + # pushRepository: "rrdockerhub/test" + # pushSecret: "secret-guid" + # tagName: "tag-name" + # triggerName: "trigger-name" + # webhookURL: "http://webhook.url" +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Build" +metadata: + name: "docker-ros-build" +spec: + recipe: "Docker" + docker: + architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] + dockerfile: Dockerfile + pullSecret: "secret-guid" + isRos: True + rosDistro: melodic + simulation: False + repository: + url: "https://github.com/rapyuta-robotics/io_tutorials" + ref: "master" + gitSecret: "secret-guid" + contextDir: "talker/talker" + image: + registry: + pushSecret: "" + tagName: "" + triggerName: "" + webhookURL: "" + rosDistro: "melodic" + buildMethod: "Source" +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Build" +metadata: + name: "catkin-build" +spec: + buildMethod: "Source" + architecture: "amd64" + repository: + url: "https://github.com/rapyuta-robotics/io_tutorials" + ref: "master" + gitSecret: "secret-guid" + contextDir: "talker/talker" + image: + registry: + pushSecret: "" + tagName: "" + triggerName: "" + webhookURL: "" + catkin: + architecture: "amd64" # Options: [amd64, arm32v7, arm64v8] + isRos: True + rosDistro: melodic + simulation: False + catkinParameters: + - rosPackages: "" + cmakeArguments: "" + makeArguments: "" + catkinMakeArguments: "" + blacklist: "" diff --git a/riocli/apply/manifests/deployment-nonros-cloud.yaml b/riocli/apply/manifests/deployment-nonros-cloud.yaml new file mode 100644 index 00000000..00748509 --- /dev/null +++ b/riocli/apply/manifests/deployment-nonros-cloud.yaml @@ -0,0 +1,35 @@ +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-nonros-cloud + depends: + kind: package + nameOrGUID: "package-nonros-cloud" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud] + depends: + - kind: deployment + nameOrGUID: "deployment-ros-cloud" + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on volume + depends: + kind: disk + nameOrGUID: "disk" + staticRoutes: + - name: NAME + depends: + kind: staticroute + nameOrGUID: "staticroute" + managedServices: + - depends: + kind: managedservice + nameOrGUID: "managedservice" \ No newline at end of file diff --git a/riocli/apply/manifests/deployment-nonros-device.yaml b/riocli/apply/manifests/deployment-nonros-device.yaml new file mode 100644 index 00000000..1d4329f1 --- /dev/null +++ b/riocli/apply/manifests/deployment-nonros-device.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-nonros-device + depends: + kind: package + nameOrGUID: "package-nonros-device" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device \ No newline at end of file diff --git a/riocli/apply/manifests/deployment-ros-cloud.yaml b/riocli/apply/manifests/deployment-ros-cloud.yaml new file mode 100644 index 00000000..4307e6b1 --- /dev/null +++ b/riocli/apply/manifests/deployment-ros-cloud.yaml @@ -0,0 +1,90 @@ +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-ros-cloud + depends: + kind: package + nameOrGUID: "package-ros-cloud" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud] + depends: + - kind: deployment + nameOrGUID: "dep-guid" + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on volume + depends: + kind: disk + nameOrGUID: "disk" + staticRoutes: + - name: NAME + depends: + kind: staticroute + nameOrGUID: "staticroute" + rosNetworks: + - depends: + kind: network + nameOrGUID: "network-native-cloud" + - depends: + kind: network + nameOrGUID: "network-routed-cloud" + topics: + - "/telemetry" + managedServices: + - depends: + kind: managedservice + nameOrGUID: "managedservice" + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" \ No newline at end of file diff --git a/riocli/apply/manifests/deployment-ros-device-no-rosbag.yaml b/riocli/apply/manifests/deployment-ros-device-no-rosbag.yaml new file mode 100644 index 00000000..f8a01388 --- /dev/null +++ b/riocli/apply/manifests/deployment-ros-device-no-rosbag.yaml @@ -0,0 +1,36 @@ +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-ros-device-no-rosbag + depends: + kind: package + nameOrGUID: "package-ros-device-no-rosbag" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device + rosNetworks: + - depends: + kind: network + nameOrGUID: "network-native-device" + interface: eth0 + - depends: + kind: network + nameOrGUID: "network-routed-device" + topics: + - "/telemetry" + interface: eth0 \ No newline at end of file diff --git a/riocli/apply/manifests/deployment-ros-device-rosbag.yaml b/riocli/apply/manifests/deployment-ros-device-rosbag.yaml new file mode 100644 index 00000000..3bc2f42e --- /dev/null +++ b/riocli/apply/manifests/deployment-ros-device-rosbag.yaml @@ -0,0 +1,96 @@ +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-ros-device-rosbag + depends: + kind: package + nameOrGUID: "package-ros-device-rosbag" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device + rosNetworks: + - depends: + kind: network + nameOrGUID: "network-native-device" + interface: eth0 + - depends: + kind: network + nameOrGUID: "network-routed-device" + topics: + - "/telemetry" + interface: eth0 + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + purgeAfter: False + onDemandOpts: + timeRange: + from: 1682399216 # Unix Timestamp + to: 1682399217 # Unix Timestamp + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" \ No newline at end of file diff --git a/riocli/apply/manifests/deployment.yaml b/riocli/apply/manifests/deployment.yaml index dcd39c93..b2991f9c 100644 --- a/riocli/apply/manifests/deployment.yaml +++ b/riocli/apply/manifests/deployment.yaml @@ -2,45 +2,284 @@ apiVersion: apiextensions.rapyuta.io/v1 kind: Deployment metadata: - name: cloud-deployment + name: deployment-ros-cloud depends: kind: package - nameOrGUID: "non-ros-cloud" + nameOrGUID: "package-ros-cloud" version: "v1.0.0" - labels: { } + project: "project-guid" + labels: + app: test spec: - runtime: device + runtime: cloud # Options: [device, cloud] depends: - kind: device - nameOrGUID: shaishav-thinkpad + - kind: deployment + nameOrGUID: "dep-guid" envArgs: - - name: TEST_ENV - value: asdsad + - name: TEST_KEY + value: test_value volumes: - - execName: exec - mountPath: "/tmp" - subPath: "/tmp" + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on volume depends: kind: disk - nameOrGUID: "PVC" + nameOrGUID: "disk" staticRoutes: - - name: asd + - name: NAME depends: kind: staticroute - nameOrGUID: asdasd + nameOrGUID: "staticroute" rosNetworks: - depends: kind: network - nameOrGUID: asdasd + nameOrGUID: "network-native-cloud" + - depends: + kind: network + nameOrGUID: "network-routed-cloud" topics: - "/telemetry" + managedServices: + - depends: + kind: managedservice + nameOrGUID: "managedservice" + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-nonros-cloud + depends: + kind: package + nameOrGUID: "package-nonros-cloud" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud] + depends: + - kind: deployment + nameOrGUID: "deployment-ros-cloud" + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on volume + depends: + kind: disk + nameOrGUID: "disk" + staticRoutes: + - name: NAME + depends: + kind: staticroute + nameOrGUID: "staticroute" + managedServices: + - depends: + kind: managedservice + nameOrGUID: "managedservice" +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-ros-device-no-rosbag + depends: + kind: package + nameOrGUID: "package-ros-device-no-rosbag" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device + rosNetworks: - depends: kind: network - nameOrGUID: "native" + nameOrGUID: "network-native-device" + interface: eth0 - depends: kind: network - nameOrGUID: "routed" - managedServices: + nameOrGUID: "network-routed-device" + topics: + - "/telemetry" + interface: eth0 +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-ros-device-rosbag + depends: + kind: package + nameOrGUID: "package-ros-device-rosbag" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device + rosNetworks: - depends: - kind: managedservice - nameOrGUID: "test-service" + kind: network + nameOrGUID: "network-native-device" + interface: eth0 + - depends: + kind: network + nameOrGUID: "network-routed-device" + topics: + - "/telemetry" + interface: eth0 + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + purgeAfter: False + onDemandOpts: + timeRange: + from: 1682399216 # Unix Timestamp + to: 1682399217 # Unix Timestamp + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" +--- +apiVersion: apiextensions.rapyuta.io/v1 +kind: Deployment +metadata: + name: deployment-nonros-device + depends: + kind: package + nameOrGUID: "package-nonros-device" + version: "v1.0.0" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud] + device: + depends: + kind: device + nameOrGUID: device-docker + restart: always # Options: [always, onfailure, never] + envArgs: + - name: TEST_KEY + value: test_value + volumes: + - execName: exec-docker + mountPath: "/tmp" # Path on container + subPath: "/tmp" # Path on device \ No newline at end of file diff --git a/riocli/apply/manifests/device-docker.yaml b/riocli/apply/manifests/device-docker.yaml new file mode 100644 index 00000000..5901ed2d --- /dev/null +++ b/riocli/apply/manifests/device-docker.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-docker" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + docker: + enabled: True # Required + rosbagMountPath: "/opt/rapyuta/volumes/rosbag" \ No newline at end of file diff --git a/riocli/apply/manifests/device-hybrid.yaml b/riocli/apply/manifests/device-hybrid.yaml new file mode 100644 index 00000000..aa4f9cc7 --- /dev/null +++ b/riocli/apply/manifests/device-hybrid.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-hybrid" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + docker: + enabled: True # Required + rosbagMountPath: "/opt/rapyuta/volumes/rosbag" + preinstalled: + enabled: True # Required + catkinWorkspace: "/home/rapyuta/catkin_ws" \ No newline at end of file diff --git a/riocli/apply/manifests/device-preinstalled.yaml b/riocli/apply/manifests/device-preinstalled.yaml new file mode 100644 index 00000000..ad32aaed --- /dev/null +++ b/riocli/apply/manifests/device-preinstalled.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-preinstalled" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + preinstalled: + enabled: True # Required + catkinWorkspace: "/home/rapyuta/catkin_ws" \ No newline at end of file diff --git a/riocli/apply/manifests/device-with-both-runtimes.yaml b/riocli/apply/manifests/device-with-both-runtimes.yaml deleted file mode 100644 index 02a445e4..00000000 --- a/riocli/apply/manifests/device-with-both-runtimes.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Device" -metadata: - name: "apply-device-both" - project: "project-guid" -spec: - python: "3" - rosDistro: "melodic" - preinstalled: - enabled: True - catkinWorkspace: "/home/rapyuta/catkin_ws" - docker: - enabled: True diff --git a/riocli/apply/manifests/device.yaml b/riocli/apply/manifests/device.yaml new file mode 100644 index 00000000..a0059221 --- /dev/null +++ b/riocli/apply/manifests/device.yaml @@ -0,0 +1,45 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-docker" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + docker: + enabled: True # Required + rosbagMountPath: "/opt/rapyuta/volumes/rosbag" +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-preinstalled" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + preinstalled: + enabled: True # Required + catkinWorkspace: "/home/rapyuta/catkin_ws" + +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Device" +metadata: + name: "device-hybrid" # Required + project: "project-guid" + labels: + app: test +spec: + python: "3" + rosDistro: "melodic" # Options: ["kinetic", "melodic" (default), "noetic"] + docker: + enabled: True # Required + rosbagMountPath: "/opt/rapyuta/volumes/rosbag" + preinstalled: + enabled: True + catkinWorkspace: "/home/rapyuta/catkin_ws" \ No newline at end of file diff --git a/riocli/apply/manifests/disk.yaml b/riocli/apply/manifests/disk.yaml index 4899bc84..dfbd4ce8 100644 --- a/riocli/apply/manifests/disk.yaml +++ b/riocli/apply/manifests/disk.yaml @@ -1,7 +1,10 @@ apiVersion: "apiextensions.rapyuta.io/v1" kind: "Disk" metadata: - name: "pvc-name" + name: "disk" + project: "project-guid" + labels: + app: test spec: runtime: cloud - capacity: 4 + capacity: 4 # Options: [4, 8, 16, 32, 64, 128, 256, 512] diff --git a/riocli/apply/manifests/managedservice.yaml b/riocli/apply/manifests/managedservice.yaml index cd1f7d5d..3d6ca4a9 100644 --- a/riocli/apply/manifests/managedservice.yaml +++ b/riocli/apply/manifests/managedservice.yaml @@ -1,9 +1,10 @@ apiVersion: "apiextensions.rapyuta.io/v1" kind: ManagedService metadata: - name: "elastic-test" + name: "managedservice" + project: "project-guid" labels: creator: riocli spec: - provider: elasticsearch - config: { } \ No newline at end of file + provider: elasticsearch # Required, Options: [elasticsearch] + config: { } # Required \ No newline at end of file diff --git a/riocli/apply/manifests/network-native-cloud.yaml b/riocli/apply/manifests/network-native-cloud.yaml new file mode 100644 index 00000000..6878abf2 --- /dev/null +++ b/riocli/apply/manifests/network-native-cloud.yaml @@ -0,0 +1,14 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-native-cloud" + project: "project-guid" + labels: + app: test +spec: + type: "native" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "cloud" # Required, Options: [cloud, device] + resourceLimits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] diff --git a/riocli/apply/manifests/network-native-device.yaml b/riocli/apply/manifests/network-native-device.yaml new file mode 100644 index 00000000..8452b908 --- /dev/null +++ b/riocli/apply/manifests/network-native-device.yaml @@ -0,0 +1,14 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-native-device" + project: "project-guid" + labels: + app: test +spec: + type: "native" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "device" # Required, Options: [cloud, device] + deviceGUID: "299a436f-9d7f-4bbf-adce-21be06bfbbce" # Required + networkInterface: "eth0" # Required + restartPolicy: "always" # Options: [always, never, onFailure] diff --git a/riocli/apply/manifests/network-routed-cloud.yaml b/riocli/apply/manifests/network-routed-cloud.yaml new file mode 100644 index 00000000..8b2c543e --- /dev/null +++ b/riocli/apply/manifests/network-routed-cloud.yaml @@ -0,0 +1,14 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-routed-cloud" + project: "project-guid" + labels: + app: test +spec: + type: "routed" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "cloud" # Required, Options: [cloud, device] + resourceLimits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] \ No newline at end of file diff --git a/riocli/apply/manifests/network-routed-device.yaml b/riocli/apply/manifests/network-routed-device.yaml new file mode 100644 index 00000000..2fc29596 --- /dev/null +++ b/riocli/apply/manifests/network-routed-device.yaml @@ -0,0 +1,14 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-routed-device" + project: "project-guid" + labels: + app: test +spec: + type: "routed" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "device" # Required, Options: [cloud, device] + deviceGUID: "299a436f-9d7f-4bbf-adce-21be06bfbbce" # Required + networkInterface: "eth0" # Required + restartPolicy: "always" # Options: [always, never, onFailure] diff --git a/riocli/apply/manifests/network.yaml b/riocli/apply/manifests/network.yaml new file mode 100644 index 00000000..d18d301d --- /dev/null +++ b/riocli/apply/manifests/network.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-routed-cloud" + project: "project-guid" + labels: + app: test +spec: + type: "routed" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "cloud" # Required, Options: [cloud, device] + resourceLimits: + cpu: 0.5 # Unit: Core Options: [Multiple of 0.025, >= 0.5 <= 4] + memory: 1024 # Unit: MB Options: [Multiple of 128, >= 1024 <= 16384] +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-routed-device" + project: "project-guid" + labels: + app: test +spec: + type: "routed" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "device" # Required, Options: [cloud, device] + deviceGUID: "0eac4320-b36e-4104-b3a9-6bdc2cd37aec" # Required + networkInterface: "eth0" # Required + restartPolicy: "always" # Options: [always, never, onFailure] +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-native-cloud" + project: "project-guid" + labels: + app: test +spec: + type: "native" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "cloud" # Required, Options: [cloud, device] + resourceLimits: + cpu: 0.1 # Unit: Core Options: [Multiple of 0.025, >= 0.1 <= 4] + memory: 512 # Unit: MB Options: [Multiple of 128, >= 512 <= 16384] +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Network" +metadata: + name: "network-native-device" + project: "project-guid" + labels: + app: test +spec: + type: "native" # Required, Options: [routed, native] + rosDistro: "melodic" # Required, Options: [kinetic, melodic, noetic] + runtime: "device" # Required, Options: [cloud, device] + deviceGUID: "0eac4320-b36e-4104-b3a9-6bdc2cd37aec" # Required + networkInterface: "eth0" # Required + restartPolicy: "always" # Options: [always, never, onFailure] diff --git a/riocli/apply/manifests/package-nonros-cloud.yaml b/riocli/apply/manifests/package-nonros-cloud.yaml new file mode 100644 index 00000000..efff4400 --- /dev/null +++ b/riocli/apply/manifests/package-nonros-cloud.yaml @@ -0,0 +1,77 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-nonros-cloud" # Required + version: "v1.0.0" # Required + description: "A RIO non ROS cloud package" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud (default)] + cloud: + replicas: 1 # Required + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "sleep infinity" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "sleep infinity" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentVars: + - name: "key1" # Required + default: "value1" + description: "An environment variable" + exposed: False + - name: "key2" # Required + default: "value2" + description: "An environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + endpoints: # Only cloud runtime have endpoints + - name: "HTTP" + type: external-http + port: 80 + targetPort: 80 + - name: "HTTPS" + type: external-https + port: 443 + targetPort: 443 + - name: "TLS-TCP" + type: external-tls-tcp + port: 443 + targetPort: 443 + - name: "TCP" + type: internal-tcp + port: 80 + targetPort: 80 + - name: "UDP" + type: internal-udp + port: 80 + targetPort: 80 + - name: "TCP-RANGE" + type: internal-tcp-range + portRange: 22,80,1024-1030 + - name: "UDP-RANGE" + type: internal-udp-range + portRange: 53,1024-1025 diff --git a/riocli/apply/manifests/package-nonros-device.yaml b/riocli/apply/manifests/package-nonros-device.yaml new file mode 100644 index 00000000..01e1d45f --- /dev/null +++ b/riocli/apply/manifests/package-nonros-device.yaml @@ -0,0 +1,52 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-nonros-device" # Required + version: "v1.0.0" # Required + description: "A RIO non ROS device package" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + - name: "exec-preInstalled" + type: preInstalled # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" \ No newline at end of file diff --git a/riocli/apply/manifests/package-ros-cloud.yaml b/riocli/apply/manifests/package-ros-cloud.yaml new file mode 100644 index 00000000..261bd3bf --- /dev/null +++ b/riocli/apply/manifests/package-ros-cloud.yaml @@ -0,0 +1,145 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-ros-cloud" # Required + version: "v1.0.0" # Required + description: "A RIO cloud ROS package" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud (default)] + cloud: + replicas: 1 # Required + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentVars: + - name: "key1" # Required + default: "value1" + description: "An environment variable" + exposed: False + - name: "key2" # Required + default: "value2" + description: "An environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + endpoints: # Only cloud runtime have endpoints + - name: "HTTP" + type: external-http + port: 80 + targetPort: 80 + - name: "HTTPS" + type: external-https + port: 443 + targetPort: 443 + - name: "TLS-TCP" + type: external-tls-tcp + port: 443 + targetPort: 443 + - name: "TCP" + type: internal-tcp + port: 80 + targetPort: 80 + - name: "UDP" + type: internal-udp + port: 80 + targetPort: 80 + - name: "TCP-RANGE" + type: internal-tcp-range + portRange: 22,80,1024-1030 + - name: "UDP-RANGE" + type: internal-udp-range + portRange: 53,1024-1025 + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False diff --git a/riocli/apply/manifests/package-ros-device-no-rosbag.yaml b/riocli/apply/manifests/package-ros-device-no-rosbag.yaml new file mode 100644 index 00000000..6d58cc08 --- /dev/null +++ b/riocli/apply/manifests/package-ros-device-no-rosbag.yaml @@ -0,0 +1,76 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-ros-device-no-rosbag" # Required + version: "v1.0.0" # Required + description: "A RIO device ROS package without rosbag" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + - name: "exec-preInstalled" + type: preInstalled # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False \ No newline at end of file diff --git a/riocli/apply/manifests/package-ros-device-rosbag.yaml b/riocli/apply/manifests/package-ros-device-rosbag.yaml new file mode 100644 index 00000000..8cff8b46 --- /dev/null +++ b/riocli/apply/manifests/package-ros-device-rosbag.yaml @@ -0,0 +1,132 @@ +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-ros-device-rosbag" # Required + version: "v1.0.0" # Required + description: "A RIO device ROS package with rosbag" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + rosBagJobs: # Not supported with preinstalled executable + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + purgeAfter: False + onDemandOpts: + timeRange: + from: 1682399216 # Unix Timestamp + to: 1682399217 # Unix Timestamp + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False \ No newline at end of file diff --git a/riocli/apply/manifests/package.yaml b/riocli/apply/manifests/package.yaml index 732ce6bb..2b91a582 100644 --- a/riocli/apply/manifests/package.yaml +++ b/riocli/apply/manifests/package.yaml @@ -1,44 +1,332 @@ apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Secret" +kind: "Package" metadata: - name: "rrdockerhub" + name: "package-ros-cloud" # Required + version: "v1.0.0" # Required + description: "A RIO cloud ROS package" + project: "project-guid" + labels: + app: test spec: - type: Docker - docker: - username: user - password: password - email: user@example.net - # registry: https://index.docker.io/v1/ + runtime: cloud # Options: [device, cloud (default)] + cloud: + replicas: 1 # Required + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentVars: + - name: "key1" # Required + default: "value1" + description: "An environment variable" + exposed: False + - name: "key2" # Required + default: "value2" + description: "An environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + endpoints: # Only cloud runtime have endpoints + - name: "HTTP" + type: external-http + port: 80 + targetPort: 80 + - name: "HTTPS" + type: external-https + port: 443 + targetPort: 443 + - name: "TLS-TCP" + type: external-tls-tcp + port: 443 + targetPort: 443 + - name: "TCP" + type: internal-tcp + port: 80 + targetPort: 80 + - name: "UDP" + type: internal-udp + port: 80 + targetPort: 80 + - name: "TCP-RANGE" + type: internal-tcp-range + portRange: 22,80,1024-1030 + - name: "UDP-RANGE" + type: internal-udp-range + portRange: 53,1024-1025 + rosBagJobs: + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False --- apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Package" #We will create a package +kind: "Package" metadata: - name: "non-ros-cloud" #it will be called non-ros-cloud. - version: "1.0.0" + name: "package-ros-device-rosbag" # Required + version: "v1.0.0" # Required + description: "A RIO device ROS package with rosbag" + project: "project-guid" labels: app: test spec: - runtime: "cloud" - cloud: - replicas: 1 - executables: - - name: "http" - type: docker + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] docker: - image: "nginx" - pullSecret: # docker with a pull secret + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + rosBagJobs: # Not supported with preinstalled executable + - name: "testbag1" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag2" # Required + recordOptions: # Required + topics: + - "/topic1" + topicIncludeRegex: + - "/telemetry*" + topicExcludeRegex: "/telemetry2*" + maxMessageCount: 100 # Valid only with topics or include regex + node: "talker" # Valid only with topics or include regex + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + - name: "testbag3" # Required + recordOptions: # Required + allTopics: True + topicExcludeRegex: "/topic1*" + compression: "BZ2" # Options: [BZ2, LZ4] + maxSplits: 5 + maxSplitSize: 10 # MB + maxSplitDuration: 60 # Minutes + chunkSize: 768 # KB + prefix: "session1" + uploadOptions: # Only for device runtime + uploadType: "OnDemand" # Options: [OnStop, Continuous, OnDemand] + maxUploadRate: 1048576 # Bytes + purgeAfter: False + onDemandOpts: + timeRange: + from: 1682399216 # Unix Timestamp + to: 1682399217 # Unix Timestamp + overrideOptions: + topicOverrideInfo: + - topicName: "/topic1" + recordFrequency: 10 # Hertz + - topicName: "/topic2" + latched: True + excludeTopics: + - "/topic3" + - "/topic4" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-nonros-cloud" # Required + version: "v1.0.0" # Required + description: "A RIO non ROS cloud package" + project: "project-guid" + labels: + app: test +spec: + runtime: cloud # Options: [device, cloud (default)] + cloud: + replicas: 1 # Required + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "sleep infinity" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: depends: - kind: secret - nameOrGUID: "rrdockerhub" #here we referene by names. not GUIDs - environmentVars: #it has environment args - - name: "TEST_VAR" - description: "This is a test var" - defaultValue: "45" - exposed: true - exposedName: "TEST_VAR_EXPOSED" - - name: "TEST_INTERNAL_VAR" - defaultValue: "45" - endpoints: #These are cloud endpoints + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "sleep infinity" + runAsBash: True + simulation: False + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + environmentVars: + - name: "key1" # Required + default: "value1" + description: "An environment variable" + exposed: False + - name: "key2" # Required + default: "value2" + description: "An environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + endpoints: # Only cloud runtime have endpoints - name: "HTTP" type: external-http port: 80 @@ -47,3 +335,150 @@ spec: type: external-https port: 443 targetPort: 443 + - name: "TLS-TCP" + type: external-tls-tcp + port: 443 + targetPort: 443 + - name: "TCP" + type: internal-tcp + port: 80 + targetPort: 80 + - name: "UDP" + type: internal-udp + port: 80 + targetPort: 80 + - name: "TCP-RANGE" + type: internal-tcp-range + portRange: 22,80,1024-1030 + - name: "UDP-RANGE" + type: internal-udp-range + portRange: 53,1024-1025 +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-nonros-device" # Required + version: "v1.0.0" # Required + description: "A RIO non ROS device package" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + - name: "exec-preInstalled" + type: preInstalled # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" +--- +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Package" +metadata: + name: "package-ros-device-no-rosbag" # Required + version: "v1.0.0" # Required + description: "A RIO device ROS package without rosbag" + project: "project-guid" + labels: + app: test +spec: + runtime: device # Options: [device, cloud(default)] + device: + arch: amd64 # Options: [arm32v7, arm64v8, amd64] + restart: always # Options: [always, never, onfailure] + executables: # Required + - name: "exec-build" + type: build # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + build: + depends: + kind: build + nameOrGUID: "build" + - name: "exec-docker" + type: docker # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + runAsBash: True + limits: + cpu: 0.025 # Unit: Core Options: [Multiple of 0.025, <= 8] + memory: 128 # Unit: MB Options: [Multiple of 128, <= 32768] + docker: + image: "busybox:latest" + pullSecret: + depends: + kind: secret + nameOrGUID: "secret-docker" + - name: "exec-preInstalled" + type: preInstalled # Options: [docker (default), build, preInstalled] + command: "roslaunch talker talker.launch" + environmentArgs: + - name: "key1" # Required + default: "key1-value" + description: "A environment variable" + exposed: False + - name: "key2" # Required + default: "key2-value" + description: "A environment variable" + exposed: True + exposedName: "EXPOSED_KEY2" + ros: + enabled: True + version: melodic # Required, Options: [ kinetic, melodic, noetic ] + inboundScopedTargeted: False + rosEndpoints: + - type: topic # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low # Options: [low, med, hi, max] + - type: service # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False + qos: low + timeout: 120 # Constraint: timeout > 0 + - type: action # Required, Options: [ topic, service, action ] + name: "/telemetry" + compression: False + scoped: False + targeted: False \ No newline at end of file diff --git a/riocli/apply/manifests/project.yaml b/riocli/apply/manifests/project.yaml index 029169e5..7694aa88 100644 --- a/riocli/apply/manifests/project.yaml +++ b/riocli/apply/manifests/project.yaml @@ -1,7 +1,9 @@ apiVersion: "apiextensions.rapyuta.io/v1" kind: "Project" metadata: - name: "test-project-1" + name: "project" + labels: + app: test spec: users: - "user@example.net" diff --git a/riocli/apply/manifests/secret-docker.yaml b/riocli/apply/manifests/secret-docker.yaml new file mode 100644 index 00000000..146a281f --- /dev/null +++ b/riocli/apply/manifests/secret-docker.yaml @@ -0,0 +1,14 @@ +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Secret" +metadata: + name: "secret-docker" + project: "project-guid" + labels: + app: test +spec: + type: Docker + docker: + username: user # Required + password: password # Required + email: user@example.net # Required + registry: https://index.docker.io/v1/ \ No newline at end of file diff --git a/riocli/apply/manifests/secret.yaml b/riocli/apply/manifests/secret.yaml index 946350bd..d5b6af93 100644 --- a/riocli/apply/manifests/secret.yaml +++ b/riocli/apply/manifests/secret.yaml @@ -1,6 +1,22 @@ --- apiVersion: "apiextensions.rapyuta.io/v1" kind: "Secret" +metadata: + name: "secret-docker" + project: "project-guid" + labels: + app: test +spec: + type: Docker + docker: + username: user # Required + password: password # Required + email: user@example.net # Required + registry: https://index.docker.io/v1/ +--- +# Below examples are Deprecated. Git secret support will be removed. +apiVersion: "apiextensions.rapyuta.io/v1" +kind: "Secret" metadata: name: "git-ssh" spec: @@ -20,7 +36,7 @@ spec: authMethod: HTTP/S Basic Auth username: user password: password - # caCert: + caCert: "" --- apiVersion: "apiextensions.rapyuta.io/v1" kind: "Secret" @@ -31,16 +47,4 @@ spec: git: authMethod: HTTP/S Token Auth token: token - # caCert: ---- -apiVersion: "apiextensions.rapyuta.io/v1" -kind: "Secret" -metadata: - name: "docker-secret" -spec: - type: Docker - docker: - username: user - password: password - email: user@example.net - # registry: https://index.docker.io/v1/ + caCert: "" \ No newline at end of file diff --git a/riocli/apply/manifests/static-route.yaml b/riocli/apply/manifests/staticroute.yaml similarity index 50% rename from riocli/apply/manifests/static-route.yaml rename to riocli/apply/manifests/staticroute.yaml index 9893ec88..95fb8569 100644 --- a/riocli/apply/manifests/static-route.yaml +++ b/riocli/apply/manifests/staticroute.yaml @@ -1,4 +1,7 @@ apiVersion: "apiextensions.rapyuta.io/v1" kind: "StaticRoute" metadata: - name: "unreal-server-apply" + name: "staticroute" + project: "project-guid" + labels: + app: test \ No newline at end of file diff --git a/riocli/jsonschema/schemas/deployment-schema.yaml b/riocli/jsonschema/schemas/deployment-schema.yaml index 4dd115bf..f1edc33b 100644 --- a/riocli/jsonschema/schemas/deployment-schema.yaml +++ b/riocli/jsonschema/schemas/deployment-schema.yaml @@ -33,7 +33,7 @@ definitions: "$ref": "#/definitions/stringMap" uniqueItems: true guid: - "$ref": "#/definitions/packageGUID" + "$ref": "#/definitions/deploymentGUID" creator: "$ref": "#/definitions/uuid" project: @@ -131,9 +131,12 @@ definitions: type: string enum: - device - depends: + device: type: object - "$ref": "#/definitions/deviceDepends" + properties: + depends: + type: object + "$ref": "#/definitions/deviceDepends" restart: type: string enum: diff --git a/riocli/jsonschema/schemas/network-schema.yaml b/riocli/jsonschema/schemas/network-schema.yaml index 381471d5..9a9d9720 100644 --- a/riocli/jsonschema/schemas/network-schema.yaml +++ b/riocli/jsonschema/schemas/network-schema.yaml @@ -54,7 +54,7 @@ definitions: type: string restartPolicy: "$ref": "#/definitions/restartPolicy" - default: Always + default: always required: - deviceGUID diff --git a/riocli/jsonschema/schemas/package-schema.yaml b/riocli/jsonschema/schemas/package-schema.yaml index 35d54b86..f34ff9bb 100644 --- a/riocli/jsonschema/schemas/package-schema.yaml +++ b/riocli/jsonschema/schemas/package-schema.yaml @@ -29,8 +29,6 @@ definitions: type: string version: type: string - tag: - type: string description: type: string guid: @@ -55,8 +53,6 @@ definitions: - device - cloud default: cloud - - # TODO: validate ros: type: object "$ref": "#/definitions/rosComponentSpec" @@ -111,6 +107,8 @@ definitions: type: array items: "$ref": "#/definitions/cloudROSBagJobSpec" + required: + - cloud deviceExecutableSpec: type: object @@ -229,10 +227,6 @@ definitions: "$ref": "#/definitions/buildDepends" required: - depends - - properties: - type: - enum: - - preInstalled portNumber: type: integer @@ -431,6 +425,8 @@ definitions: type: array items: "$ref": "#/definitions/rosEndpointSpec" + required: + - version rosEndpointSpec: type: object @@ -717,12 +713,3 @@ definitions: type: string guid: type: string - deploymentDepends: - properties: - kind: - const: deployment - default: deployment - nameOrGUID: - type: string - guid: - type: string diff --git a/riocli/jsonschema/schemas/static_route-schema.yaml b/riocli/jsonschema/schemas/static_route-schema.yaml index 731c2c47..c43f050c 100644 --- a/riocli/jsonschema/schemas/static_route-schema.yaml +++ b/riocli/jsonschema/schemas/static_route-schema.yaml @@ -24,7 +24,7 @@ definitions: name: type: string guid: - "$ref": "#/definitions/projectGUID" + "$ref": "#/definitions/staticRouteGUID" creator: "$ref": "#/definitions/uuid" project: @@ -37,6 +37,9 @@ definitions: projectGUID: type: string pattern: "^project-[a-z]{24}$" + staticRouteGUID: + type: string + pattern: "^staticroute-[a-z]{24}$" stringMap: type: object additionalProperties: diff --git a/riocli/package/model.py b/riocli/package/model.py index 3290a6e8..4cda80a7 100644 --- a/riocli/package/model.py +++ b/riocli/package/model.py @@ -199,7 +199,7 @@ def _map_executable(self, exec): "memory": exec.limits.memory } - if exec.runAsBash: + if exec.get('runAsBash'): if 'command' in exec: exec_object.cmd = ['/bin/bash', '-c', exec.command] else: