Skip to content

Commit

Permalink
Release 0.5 (#24)
Browse files Browse the repository at this point in the history
* Update README

Signed-off-by: Felixnoo <[email protected]>

* Release v0.5.0

Signed-off-by: laminar <[email protected]>

* update: change the default version of OpenFunction to the latest stable version.

Signed-off-by: laminar <[email protected]>

* release v0.5.2

Signed-off-by: laminar <[email protected]>

Co-authored-by: Felixnoo <[email protected]>
Co-authored-by: Benjamin Huo <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2022
1 parent edad22b commit 938c414
Show file tree
Hide file tree
Showing 17 changed files with 994 additions and 803 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,31 @@

`[BUGFIX]`

# 0.5.1

> This is the first release of OpenFunction CLI
`[CHANGE]`

`[FEATURE]`

`[ENHANCEMENT]`

`[BUGFIX]`
- Fix the issue that ofn install cannot install the latest version of OpenFunction #19

# 0.5.2

> This is the first release of OpenFunction CLI
`[CHANGE]`

`[FEATURE]`

`[ENHANCEMENT]`
- Change the default version of OpenFunction to the latest stable version
- Add the `--force` option to force the operation
- Use the spinner instead of the original process display
- Adjust the function hierarchy to make some functions more generic

`[BUGFIX]`
147 changes: 66 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,132 +1,117 @@
# ![OpenFunctionCtl](docs/images/logo.png)

`cli` is the Command-Line Interface for [OpenFunction](https://github.com/OpenFunction/OpenFunction)
`cli` is the command-line interface for [OpenFunction](https://github.com/OpenFunction/OpenFunction).

The `cli` repo is used to track issues for the `OpenFunction`. this tool allows users to focus on the core functionality of the OpenFunction, while also presenting the relationship between the OpenFunction and its dependent components in a more abstract and friendly way to the user.
The `cli` repo is used to track issues for the `OpenFunction`. This tool allows you to focus on the core functionality of the OpenFunction, while also presents the relationship between the OpenFunction and its dependent components in a more abstract and friendly way.

## Main commands
The main commands supported by the CLI are:
- init: provides management for openfunction’s framework.
- install: install OpenFunction and its dependencies.
- uninstall: uninstall OpenFunction and its dependencies.
- create: create a function from a file or stdin.
- apply: apply a function from a file or stdin.
- install: installs OpenFunction and its dependencies.
- uninstall: uninstalls OpenFunction and its dependencies.
- create: creates a function from a file or stdin.
- apply: applies a function from a file or stdin.
- get: prints a table of the most important information about the specified function.
- get builder: prints important information about the builder.
- get serving:prints important information about the serving.
- delete: delete a specified the function.
- get serving: prints important information about the serving.
- delete: deletes the specified function.

## Getting started

Visit [ofn release](https://github.com/OpenFunction/cli/releases/) to select the `ofn` cli to deploy to your cluster.
Visit [ofn releases page](https://github.com/OpenFunction/cli/releases/) to download the `ofn` cli to deploy to your cluster.

### Use ofn to deploy OpenFunction

> We assume that you have placed the artifacts from the above step under the appropriate path in `PATH` and renamed it `ofn`.
> Make sure you put the artifacts from the above step under the appropriate path in `PATH` and rename it `ofn`.
You can use the `ofn install --all` to complete a simple deployment. By default, this command will install the *v0.4.0* version of OpenFunction for you, while it will skip the installation process for components that already exist (you can use the `--upgrade` command to overwrite these components).
Run `ofn install --all` to implement a simple deployment. By default, this command will install the *v0.4.0* version of OpenFunction and skips the installation of components that already exist. To overwrite the existing components, use the `--upgrade` command.

Please refer to the [ofn install docs](docs/install.md).
For more information, refer to the [ofn install document](docs/install.md).

```shell
# ofn install --all --upgrade
# ofn install --all
Start installing OpenFunction and its dependencies.
Here are the components and corresponding versions to be installed:
The following components will be installed:
+------------------+---------+
| COMPONENT | VERSION |
+------------------+---------+
| Knative Serving | 1.0.1 |
| Tekton Pipelines | 0.30.0 |
| OpenFunction | 0.5.0 |
| Kourier | 1.0.1 |
| DefaultDomain | 1.0.1 |
| Keda | 2.4.0 |
| Tekton Pipelines | 0.30.0 |
| OpenFunction | 0.4.0 |
| CertManager | 1.5.4 |
| Dapr | 1.5.1 |
| CertManager | 1.1.0 |
| Shipwright | 0.6.1 |
| Knative Serving | 1.0.1 |
| DefaultDomain | 1.0.1 |
| IngressNginx | 1.1.0 |
+------------------+---------+
You have used the `--upgrade` parameter, which means that the installation process will overwrite the components that already exist.
Make sure you know what happens when you do this.
Enter 'y' to continue and 'n' to abort:
-> y
🔄 -> INGRESS <- Installing Ingress...
🔄 -> KNATIVE <- Installing Knative Serving...
🔄 -> DAPR <- Installing Dapr...
🔄 -> DAPR <- Downloading Dapr Cli binary...
🔄 -> KEDA <- Installing Keda...
🔄 -> CERTMANAGER <- Installing Cert Manager...
🔄 -> SHIPWRIGHT <- Installing Shipwright...
🔄 -> INGRESS <- Checking if Ingress is ready...
🔄 -> KEDA <- Checking if Keda is ready...
🔄 -> CERTMANAGER <- Checking if Cert Manager is ready...
🔄 -> SHIPWRIGHT <- Checking if Shipwright is ready...
🔄 -> KNATIVE <- Installing Kourier as Knative's gateway...
🔄 -> KNATIVE <- Configuring Knative Serving's DNS...
🔄 -> KNATIVE <- Checking if Knative Serving is ready...
✅ -> CERTMANAGER <- Done!
🔄 -> DAPR <- Initializing Dapr with Kubernetes mode...
✅ -> SHIPWRIGHT <- Done!
✅ -> KNATIVE <- Done!
✅ -> INGRESS <- Done!
✅ -> DAPR <- Done!
✅ -> KEDA <- Done!
🔄 -> OPENFUNCTION <- Installing OpenFunction...
🔄 -> OPENFUNCTION <- Checking if OpenFunction is ready...
✅ -> OPENFUNCTION <- Done!
🚀 Completed in 2m3.638035129s.
✓ Dapr - Completed!
✓ Keda - Completed!
✓ Knative Serving - Completed!
✓ Shipwright - Completed!
✓ Cert Manager - Completed!
✓ Ingress - Completed!
✓ OpenFunction - Completed!
🚀 Completed in 1m40.055438303s.

██████╗ ██████╗ ███████╗███╗ ██╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║
██║ ██║██████╔╝█████╗ ██╔██╗ ██║
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║
╚██████╔╝██║ ███████╗██║ ╚████║
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝

███████╗██╗ ██╗███╗ ██╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗
██╔════╝██║ ██║████╗ ██║██╔════╝╚══██╔══╝██║██╔═══██╗████╗ ██║
█████╗ ██║ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║██╔██╗ ██║
██╔══╝ ██║ ██║██║╚██╗██║██║ ██║ ██║██║ ██║██║╚██╗██║
██║ ╚██████╔╝██║ ╚████║╚██████╗ ██║ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
```

### Use ofn to uninstall OpenFunction

> We assume that you have placed the artifacts from the above step under the appropriate path in `PATH` and renamed it `ofn`.
> Make sure you put the artifacts from the above step under the appropriate path in `PATH` and rename it `ofn`.
You can use `ofn uninstall --all` to easily uninstall OpenFunction and its dependencies (or just uninstall OpenFunction without arguments).
Run `ofn uninstall --all` to uninstall OpenFunction and its dependencies (or just uninstall OpenFunction without arguments).

Please refer to the [ofn uninstall docs](docs/uninstall.md).
For more information, refer to the [ofn uninstall document](docs/uninstall.md).

```shell
~# ofn uninstall --all
~# ofn uninstall --all -y
Start uninstalling OpenFunction and its dependencies.
The following components already exist:
+------------------+---------+
| COMPONENT | VERSION |
+------------------+---------+
| Cert Manager | v1.5.4 |
| Ingress Nginx | 1.1.0 |
| Tekton Pipelines | v0.28.1 |
| Shipwright | 0.6.0 |
| OpenFunction | v0.4.0 |
| Dapr | 1.4.3 |
| OpenFunction | 0.5.0 |
| Knative Serving | 1.0.1 |
| Kourier | 1.0.1 |
| DefaultDomain | 1.0.1 |
| IngressNginx | 1.1.0 |
| Keda | 2.4.0 |
| Knative Serving | 0.26.0 |
| Dapr | 1.5.1 |
| Shipwright | 0.6.1 |
| Tekton Pipelines | 0.30.0 |
| CertManager | 1.5.4 |
+------------------+---------+
You can see the list of components to be uninstalled and the list of components already exist in the cluster.
Make sure you know what happens when you do this.
Enter 'y' to continue and 'n' to abort:
-> y
🔄 -> OPENFUNCTION <- Uninstalling OpenFunction...
🔄 -> KNATIVE <- Uninstalling Knative Serving...
🔄 -> DAPR <- Uninstalling Dapr with Kubernetes mode...
🔄 -> KEDA <- Uninstalling Keda...
🔄 -> SHIPWRIGHT <- Uninstalling Tekton Pipeline & Shipwright...
🔄 -> INGRESS <- Uninstalling Ingress...
🔄 -> CERTMANAGER <- Uninstalling Cert Manager...
✅ -> OPENFUNCTION <- Done!
✅ -> DAPR <- Done!
🔄 -> KNATIVE <- Uninstalling Kourier...
✅ -> KEDA <- Done!
✅ -> CERTMANAGER <- Done!
✅ -> KNATIVE <- Done!
✅ -> INGRESS <- Done!
✅ -> SHIPWRIGHT <- Done!
🚀 Completed in 1m21.683329262s.
✓ Dapr - Completed!
✓ Keda - Completed!
✓ Knative Serving - Completed!
✓ Shipwright - Completed!
✓ Tekton Pipelines - Completed!
✓ Cert Manager - Completed!
✓ Ingress - Completed!
✓ OpenFunction - Completed!
🚀 Completed in 1m17.729501739s.
```

### Build OpenFunction CLI

You can also use `make build` to build the OpenFunction CLI —— `ofn`.
To build the OpenFunction CLI——`ofn`, run `make build`.
When the command is executed, you can find the artifact in the `. /dist` directory.
Move it to the appropriate path in the `PATH` so that you can use it in your environment.
Move it to an appropriate path in the `PATH` so that you can use it in your environment.

```shell
~# make build
Expand Down
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This page describes the release process and the currently planned schedule for u
| release series | date (year-month-day) | release shepherd |
|----------------|--------------------------------------------|---------------------------------------------|
| v0.5.0 | 2021-12-21 | Laminar (GitHub: @tpiperatgod) |
| v0.5.1 | 2021-12-22 | Laminar (GitHub: @tpiperatgod) |
| v0.5.2 | 2022-01-03 | Laminar (GitHub: @tpiperatgod) |

# How to cut a new release

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.5.0
v0.5.2
8 changes: 4 additions & 4 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This command will help you to install OpenFunction and its dependencies.
--shipwright For installing ShipWright.
--sync For installing OpenFunction Sync Runtime (To be supported).
--upgrade Upgrade components to target version while installing.
--yes Automatic yes to prompts. ('-y' as a short form)
--verbose Show verbose information.
--version string Used to specify the version of OpenFunction to be installed. (default "v0.4.0")
--timeout duration Set timeout time. Default is 5 minutes. (default 5m0s)
Expand Down Expand Up @@ -52,11 +53,10 @@ ofn install --upgrade --all
### Install a specific version of OpenFunction
> default to v0.4.0 if no version specified
> default to the latest stable version
The available versions are:
- v0.3.1
- v0.4.0
- any stable version
- latest
```shell
Expand All @@ -69,7 +69,7 @@ OpenFunction relies on several components like Knative Serving, Dapr, Keda, Ship
The OpenFunction CLI provides a default compatibility matrix based on which OpenFunction CLI will install a default selected version of each component for each version of kubernetes.
The OpenFunction CLI keeps the installed component details in `$home/.ofn/inventory.yaml`.
The OpenFunction CLI keeps the installed component details in `$home/.ofn/<cluster name>-inventory.yaml`.
| Components | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20+ | CLI Option | Description |
| ---------------------- | --------------- | --------------- | --------------- | ---------------- | ---------------- | ---------------------------------------------- |
Expand Down
10 changes: 5 additions & 5 deletions docs/uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ This command will help you to uninstall OpenFunction and its dependencies.
--shipwright For uninstalling ShipWright.
--sync For uninstalling OpenFunction Sync Runtime (To be supported).
--verbose Show verbose information.
--version string Used to specify the version of OpenFunction to be uninstalled. (default "v0.4.0")
--yes Automatic yes to prompts. ('-y' as a short form)
--version string Used to specify the version of OpenFunction to be uninstalled.
--wait Awaiting the results of the uninstallation.
--timeout duration Set timeout time. Default is 5 minutes. (default 5m0s)
```
Expand Down Expand Up @@ -54,11 +55,10 @@ ofn uninstall --all --wait

### Uninstall a specific version of OpenFunction

> Default to v0.4.0 if no version specified
> Default to the version of the OpenFunction currently installed
The available versions are:
- v0.3.1
- v0.4.0
- any stable version
- latest

```shell
Expand All @@ -67,7 +67,7 @@ ofn uninstall --version v0.4.0

## Inventory

During installation, the OpenFunction CLI keeps the installed component details in `$home/.ofn/inventory.yaml`. So during the uninstallation, the OpenFunction CLI will remove the relevant components based on the contents of `$home/.ofn/inventory.yaml`.
During installation, the OpenFunction CLI keeps the installed component details in `$home/.ofn/<cluster name>-inventory.yaml`. So during the uninstallation, the OpenFunction CLI will remove the relevant components based on the contents of `$home/.ofn/<cluster name>-inventory.yaml`.

In addition, the OpenFunction CLI supports obtaining the version of the component and the path to the component's yaml file from the environment variable. You can refer to the [Environment variables](install.md#environment-variables) for more information.

Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ module github.com/OpenFunction/cli
go 1.16

require (
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412
github.com/fatih/color v1.7.0
github.com/jedib0t/go-pretty/v6 v6.2.4
github.com/leaanthony/synx v0.1.0
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852
github.com/openfunction v0.3.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.2.1
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ github.com/aerospike/aerospike-client-go v4.5.0+incompatible/go.mod h1:zj8LBEnWB
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/agrea/ptr v0.0.0-20180711073057-77a518d99b7b/go.mod h1:Tie46d3UWzXpj+Fh9+DQTyaUxEpFBPOLXrnx7nxlKRo=
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412 h1:vOVO0ypMfTt6tZacyI0kp+iCZb1XSNiYDqnzBWYgfe4=
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412/go.mod h1:AI9hp1tkp10pAlK5TCwL+7yWbRgtDm9jhToq6qij2xs=
github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20210420163308-c1402a70e2f1/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
Expand Down Expand Up @@ -852,6 +854,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20210311094424-0ca2b1909cdc/go.mod h1:o4psv/D+LJC+NGyL66BoKWXLkzlJeUqhL6/3rjFKXw0=
github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/leaanthony/synx v0.1.0 h1:R0lmg2w6VMb8XcotOwAe5DLyzwjLrskNkwU7LLWsyL8=
github.com/leaanthony/synx v0.1.0/go.mod h1:Iz7eybeeG8bdq640iR+CwYb8p+9EOsgMWghkSRyZcqs=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE=
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8=
Expand Down Expand Up @@ -998,6 +1002,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI=
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
Loading

0 comments on commit 938c414

Please sign in to comment.