Skip to content

Commit

Permalink
Final Commit before release 2.0
Browse files Browse the repository at this point in the history
Fix some Readme things

Clean up Ceph/knative/enmasse destroy commands

Comments

Add Tensorflow destroy

TODO
More testing with Go-test for every command
Make Destroy commands a bit more stable
Add Gstreamer Tool
  • Loading branch information
astoycos committed Apr 24, 2020
1 parent edabaca commit 7411e06
Show file tree
Hide file tree
Showing 31 changed files with 3,992 additions and 193 deletions.
49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

The user can choose which tools they want to use in order to either digest, display or process the IoT data. Eventually the user will be allowed to create custom data pipelines to connect the tools. Currently the following tools will be supported

## Getting Started

Download the latest Release from the [release page](https://github.com/redhat-iot/iot-dev/releases)

Move the Executable `IoTCLI` into your `$PATH`

Run `IoTCLI` login to authenticate with your openshift cluster

# Main Components Overview

## Messaging Core

In any Edge system that incorporates IoT devices, having a scalable cloud native edge system is very important. With the `IoTCLI` you can easily deploy these messaging services to your Openshift 4.X cluster
Expand Down Expand Up @@ -66,24 +76,27 @@ Persistent storage is implemented using [Ceph Object Storage](https://ceph.io/ce
#### TensorFlow lite

TODO



## Command Reference

| Command1 (Tool) | Command2(Module) | Command3(Module command) | Argument (module input) | Flags | Function |
|-----------------|------------------|--------------------------|------------------------------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| ceph | setup | None | None | None | Setup Ceph Object Storage via the Rook Operator |
| enmasse | destroy | None | None | None | Remove Enmasse from openshift cluster |
| enmasse | IoT | addDevice | <Messaging Tenant> <DeviceID> | None | Add a Device with specified ID to the Enmasse device registry for a specified messaging TenantSetup default Credentials |
| enmasse | IoT | project | None | --namespace | Make a new enmasse IoT project in the specified namespace, defaults to “myapp” |
| enmasse | setup | None | None | None | Download Enmasse Source, store in current directory. Setup Enmasse Setup IoT services |
| kafka | bridge | None | None | --namespace | Deploy kafka HTTP bridge Deploy nginx ingress to access bridge from outside the cluster (will be transitioned to a route) |
| kafka | destroy | None | None | --namespace | Destroy the kafka deployment located at the specified namespace |
| kafka | setup | None | None | --namespace | Setup a kafka cluster viat the strimzi operator at the specified namespace |
| knative | setup | None | None | --status=true/false | Setup Knative serverless on openshift clusterConfigures both Knative-Eventing and Knative-ServingSet --status=true to check on Knative deployment |
| knative | destroy | None | None | None | Remove Knative deployment from openshift cluster |
| knative | service | None | <Knative service to be deployed> | --status=true/false--namespace | Deploy a knative service Set --status=true to check on Knative service deploymentDefault namespace is “knative-eventing” |
| knative | service | destroy | <Knative service to be destroyed> | --namespace | Remove a specified Knative service from the cluster at specified namespace Default namespace is “knative-eventing” |
| knative | source | None | <containersource to be deployed> | --namespace | Deploy a Knative Source at specified namespace Defaults to namespace “knative-eventing” |
| knative | source | destroy | <containersource to be destroyed> | --namespace | Remove a specified knative source from the cluster from specified namespaceDefault namespace is “knative-eventing” |
| Command1 (Tool) | Command2(Module) | Command3(Module command) | Argument (module input) | Flags | Function |
|-------------------|------------------|--------------------------|------------------------------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| ceph | destroy | None | None | None | Return user secrets for c |
| ceph | secrets | None | None | None | Return user secrets for ceph deployment |
| ceph | setup | None | None | None | Setup Ceph Object Storage via the Rook Operator |
| enmasse | destroy | None | None | None | Remove Enmasse from openshift cluster |
| enmasse | IoT | addDevice | <Messaging Tenant> <DeviceID> | None | Add a Device with specified ID to the Enmasse device registry for a specified messaging TenantSetup default Credentials |
| enmasse | IoT | project | None | --namespace | Make a new enmasse IoT project in the specified namespace, defaults to “myapp” |
| enmasse | setup | None | None | None | Download Enmasse Source, store in current directory. Setup Enmasse Setup IoT services |
| kafka | bridge | None | None | --namespace | Deploy kafka HTTP bridge Deploy nginx ingress to access bridge from outside the cluster (will be transitioned to a route) |
| kafka | destroy | None | None | --namespace | Destroy the kafka deployment located at the specified namespace |
| kafka | setup | None | None | --namespace | Setup a kafka cluster viat the strimzi operator at the specified namespace |
| knative | setup | None | None | --status=true/false | Setup Knative serverless on openshift clusterConfigures both Knative-Eventing and Knative-ServingSet --status=true to check on Knative deployment |
| knative | destroy | None | None | None | Remove Knative deployment from openshift cluster |
| knative | service | None | <Knative service to be deployed> | --status=true/false--namespace | Deploy a knative service Set --status=true to check on Knative service deploymentDefault namespace is “knative-eventing” |
| knative | service | destroy | <Knative service to be destroyed> | --namespace | Remove a specified Knative service from the cluster at specified namespace Default namespace is “knative-eventing” |
| knative | source | None | <containersource to be deployed> | --namespace | Deploy a Knative Source at specified namespace Defaults to namespace “knative-eventing” |
| knative | source | destroy | <containersource to be destroyed> | --namespace | Remove a specified knative source from the cluster from specified namespaceDefault namespace is “knative-eventing” |
| login | None | None | None | None | Login to your openshift cluster with the username and password |
| tensorflowServing | setup | None | None | --namespace | Deploy a tensorflow serving deployment and service Default namespace is “default” |
| tensorflowServing | destroy | None | None | --namesapce | Deploy a tensorflow serving deployment and serviceDefault namespace is “default” |
91 changes: 91 additions & 0 deletions cmd/ceph-destroy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/IoTCLI/cmd/utils"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/kubectl/pkg/cmd/delete"
"log"
//"time"
)

//Made from Instructions @https://opendatahub.io/docs/administration/advanced-installation/object-storage.html for installing
//ceph object storage via the rook operator
func cephDestroy() {
//Make command options for Knative Setup
co := utils.NewCommandOptions()

co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/route.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object-user.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/toolbox.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/cluster.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/operator.yaml")
co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/scc.yaml")

IOStreams, _, out, _ := genericclioptions.NewTestIOStreams()

//Switch Context and Reload Config Flags
co.SwitchContext("rook-ceph-system")

log.Println("Provision Knative Source")
for _, command := range co.Commands {
cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams)
//Kubectl signals missing field, set validate to false to ignore this
cmd.Flags().Set("validate", "false")
err := cmd.Flags().Set("filename", command)
if err != nil {
log.Fatal(err)
}
cmd.Run(cmd, []string{})
log.Print(out.String())
out.Reset()

}

}

// destroyCmd represents the destroy command
var cephDestroyCmd = &cobra.Command{
Use: "destroy",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
log.Println("destroy called")
cephDestroy()
},
}

func init() {
cephCmd.AddCommand(cephDestroyCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// destroyCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// destroyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
72 changes: 72 additions & 0 deletions cmd/ceph-secrets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
"github.com/IoTCLI/cmd/utils"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/kubectl/pkg/cmd/get"
"log"
)

func getCredentials() {
co := utils.NewCommandOptions()

co.Commands = append(co.Commands, "secrets")

IOStreams, _, out, _ := genericclioptions.NewTestIOStreams()

//Switch Context and Reload Config Flags
co.SwitchContext("rook-ceph")

log.Print("Get S3 secrets, save for possible later use:")
cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams)
cmd.Flags().Set("output", "json")
cmd.Run(cmd, []string{co.Commands[0], "rook-ceph-object-user-my-store-odh-user"})
log.Print(out.String())
out.Reset()
}

// secretsCmd represents the secrets command
var cephSecretsCmd = &cobra.Command{
Use: "secrets",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
log.Println("Ceph Secrets called")
getCredentials()
},
}

func init() {
cephCmd.AddCommand(cephSecretsCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// secretsCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// secretsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
Loading

0 comments on commit 7411e06

Please sign in to comment.