Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove functions in zipper config #625

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 18 additions & 64 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,96 +24,50 @@ env GOBIN=/bin go install github.com/yomorun/yomo/cmd/yomo@latest

## Getting Started

### 1. Source
### 1. YoMo-Zipper

#### Write a source app

See [example/source/main.go](example/source/main.go)

#### Run

```sh
go run main.go
```

### 2. Stream Function

#### Init

Create a stream function
#### Configure YoMo-Zipper `config.yaml`

```sh
yomo init [Name]
```
See [../example/config.yaml](../example/config.yaml)

#### Run

```sh
cd [Name] && yomo run
```
OR in Production
```sh
cd [Name] && yomo build && ./sl.yomo
yomo serve --config ../example/config.yaml
```

### 3. Stream Function to store data in DB
### 2. Source

#### Write a stream function
#### Write a source app

See [example/stream-fn-db/app.go](example/stream-fn-db/app.go)
See [../example/9-cli/source/main.go](../example/9-cli/source/main.go)

#### Run

```sh
cd example/stream-fn-db && yomo run
```
OR in Production
```sh
cd example/stream-fn-db && yomo build && ./sl.yomo
```
cd ../example/9-cli/source

### 4. YoMo-Zipper

#### Configure YoMo-Zipper `config.yaml`

```yaml
name: Service
host: localhost
port: 9000
functions:
- name: Noise
- name: MockDB
go run main.go
```

#### Run
### 3. Stream Function

```sh
yomo serve --config config.yaml
```

## Example
#### Write the serverless function

### Prerequisites
[Installing task](https://taskfile.dev/#/installation)
See [../example/9-cli/sfn/main.go](../example/9-cli/sfn/main.go)

### Simple Example
#### Build

#### Run
Build the app.go to a WebAssembly file.

```sh
task example
```
cd ../example/9-cli/sfn

### Edge-Mesh

#### Run US Node

```sh
task example-mesh-us
yomo build
```

#### Run EU Node
#### Run

```sh
task example-mesh-eu
yomo run sfn.wasm
```
10 changes: 0 additions & 10 deletions docs/pages/docs/cli/zipper.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ auth:
type: token
token: <CREDENTIAL>

### sfn ###
functions:
- name: sfn-ai-stream-response
- name: sfn-async-log-events

### cascading ###
downstreams:
- zipper-asia_pacific
Expand Down Expand Up @@ -60,11 +55,6 @@ downstreams:
- `type` - the type of the credential, currently only `token` is supported.
- `token` - the credential, it is a string.

### StreamFunction Config

- `functions` - the list of [StreamFunctions][sfn] that allowed to connect this Zipper.
- `name` - the name of the [StreamFunction][sfn], it is used to identify the [StreamFunction][sfn] in the network.

### Downstreams Config

- `downstreams` - the list of downstream Zippers, the data will be forwarded to these Zippers when needed.
Expand Down