Skip to content

Commit a112f21

Browse files
authored
Carson/iterate deployment docs (#341)
Slightly reworks SDF deployment docs page. 1. Moves paragraph about cloud worker creation under the explanations of creating Host & Remote worker. 2. Adjusts wording & adds a couple links Still have to: 1. proof `Remote Worker` section and `Managing Dataflows` section. 2. Clarify difference in use case between user-managed "Remote" worker and Infinyon-managed "Cloud" worker
1 parent b806168 commit a112f21

File tree

3 files changed

+57
-81
lines changed

3 files changed

+57
-81
lines changed

sdf/deployment.mdx

Lines changed: 52 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,29 @@ description: Deployment of dataflow via a Worker
44
sidebar_position: 60
55
---
66

7-
# Introduction
7+
## Introduction
88

99
When you use the `run` command to execute a dataflow, it runs within the same process as the CLI. This is useful for development and testing because it's easy to start without needing to manage additional resources. It allows for quick testing and validation of the dataflow, and you can easily load and integrate development packages.
1010

11-
For production deployment, the `deploy` command is used to deploy the dataflow on a worker. All operations available in `run` also apply to deploy, with the following differences:
11+
For production deployment, the `deploy` command is used to deploy the dataflow on a `worker`. All operations available in `run` also apply to deploy, with the following differences:
1212
- The dataflow is executed on the worker, not within the CLI process. The CLI communicates with the worker on the user's behalf.
13-
- The dataflow continues running even if the CLI is shut down. It will only terminate if the worker is stopped, shut down, or the dataflow is explicitly stopped or deleted.
13+
- The dataflow continues running even if the CLI is shut down. It will only terminate if the worker is stopped or shut down, or if the dataflow is explicitly stopped or deleted.
1414
- Dataflows in the worker only have access to published packages, unlike `run` mode, which allows access to local packages. If you need to use a package, you must publish it first.
1515
- Multiple dataflows can be deployed on the worker, with each dataflow isolated from the others. They do not share any state or memory but can communicate via Fluvio topics.
1616

17+
To use deployment mode, it's essential to understand what a worker is, and [how to manage a dataflow inside a worker](#managing-dataflows).
1718

18-
To use deployment mode, it's essential to understand the following concepts:
19-
- Workers
20-
- Deploying dataflows to workers
21-
- Dataflow lifecycle within a worker
2219

23-
# Workers
20+
## Workers
2421

2522
A worker is the deployment target for a dataflow and must be created and provisioned before deploying a dataflow. The worker can run anywhere as long as it can connect to the same Fluvio cluster. If you're using InfinyOn Cloud, the worker is automatically provisioned.
2623

2724
There is no limit to the number of dataflows you can run on each worker, apart from CPU, memory, and disk constraints. For optimal performance, it is recommended to run a single worker per machine.
2825

29-
There are two types of workers: `Host` and `Remote`. `Host` is a simple worker designed for local deployment without requiring any additional infrastructure. It is not designed for robust production deployment.
30-
For typical production deployment, you will use `Remote` worker. It is designed to run in the cloud, data center, or edge device. If you are using InfinyOn Cloud, the `remote` cloud worker is automatically provisioned and registered in your profile.
26+
There are two types of workers: `host` and `remote`. A host worker is a simple worker designed for local deployment without requiring any additional infrastructure. It is not designed for robust production deployments. For typical production deployments, you will use remote workers. Remote workers are designed to run in the cloud, data center, or on edge devices. If you are using InfinyOn Cloud, the remote cloud worker is automatically provisioned and registered in your profile.
27+
28+
A worker "profile" is maintained for each Fluvio cluster. The worker profile maintains a list of uuids of the cluster's workers, as well as the currently selected worker. When you switch the Fluvio profile, the corresponding worker profile is used automatically. Together, the worker profile and Fluvio profile allow the [SDF CLI] to issue commands to the selected worker. Once a worker is selected, it will be used for all dataflow operations until you choose a different worker. Each worker also has a human-readable name which is used to easily identify the worker in the CLI.
3129

32-
Each worker has a unique identifier for the Fluvio cluster. The worker profile is stored in the local machine and is used to match the worker with the Fluvio cluster. When you switch the Fluvio profile, the worker profile is also switched. Once a worker is selected, it will be used for all dataflow operations until you choose a different worker.
33-
The worker also human-readable name that is used to identify the worker in the CLI.
3430

3531
### Host Workers
3632

@@ -39,20 +35,20 @@ To create host worker, you can use the following command.
3935
$> sdf worker create <name>
4036
```
4137

42-
This will creates and register a new worker in your machine. It will run in the background until you shutdown the worker or machine is rebooted. The name can be anything as long as it is unique for your machine since profile are not shared across different machines.
38+
This will creates and register a new worker on your machine. It will run in the background until you shutdown the worker or machine is rebooted. The name can be anything.
4339

44-
Once you have created the worker, You can list them.
40+
Once you have created a worker, You can view the list of workers on your Fluvio cluster.
4541

4642
```bash
4743
$> sdf worker create main
4844
Worker `main` created for cluster: `local`
4945
$> sdf worker list
50-
NAME TYPE CLUSTER WORKER ID
51-
* main Host local 7fd7eda3-2738-41ef-8edc-9f04e500b919
46+
NAME TYPE CLUSTER WORKER ID VERSION
47+
* main Host local 7fd7eda3-2738-41ef-8edc-9f04e500b919 <your SDF version>
5248
```
53-
The `*` indicates the current selected worker.
49+
The `*` indicates the current selected worker.
5450

55-
SDF only support running a single HOST worker for each machine since a single worker can support many dataflow. If you try to create another worker, you will get an error message.
51+
SDF only supports running a single host worker for each machine since a single worker can support many dataflows. If you try to create another worker, you will get an error message.
5652

5753
```bash
5854
$ sdf worker create main2
@@ -61,26 +57,16 @@ There is already a host worker with pid 20686 running. Please terminate it firs
6157
```
6258

6359
Shutting down a worker will terminate all running dataflow and worker processes.
60+
6461
```bash
6562
$> sdf worker shutdown main
66-
sdf worker shutdown main
6763
Shutting down pid: 20688
68-
Shutting down pid: 20686
6964
Host worker: main has been shutdown
7065
```
7166

72-
Even though host worker is shutdown and removed from the profile, the dataflow files and state are still persisted. You can restart the worker and the dataflow will resume.
67+
Even though the host worker is shutdown and removed from the profile, the dataflow files and state are still persisted. You can restart the worker and the dataflow will resume.
7368

74-
For example, if you have dataflow `fraud-detector` and `car-processor` running in the worker and you shut down the worker, the dataflow process will be terminated. But you can resume by recreating the HOST worker.
75-
76-
```bash
77-
$> sdf worker create main
78-
```
79-
80-
The local worker stores the dataflow state in the local file system. The dataflow state is stored in the `~/.sdf/<cluster>/worker/<dataflow>`.
81-
For the `local` cluster, files will be stored in `~/.sdf/local/worker/dataflows`.
82-
83-
if you have deleted the fluvio cluster, the worker needs to be manually shutdown and created again. This limitation will be removed in a future release
69+
Host workers store the dataflow state in the local file system at `~/.sdf/local/worker/dataflows`. If you have deleted your local fluvio cluster, the worker needs to be manually shutdown and created again. This limitation will be removed in a future release
8470

8571

8672
### Remote Workers
@@ -93,7 +79,7 @@ Typical lifecycle for using remote worker:
9379

9480
Note that there are many ways to manage the remote worker. You can use Kubernetes, Docker, Systemd, Terraform, Ansible, or any other tool that can manage the server process and ensure it can restart when server is rebooted. Please contact InfinyOn support for more information.
9581

96-
InfinyOn cloud is a simplest way to use the remote worker. When you create a cluster in InfinyOn cloud, it will automatically provision and sync worker for you.
82+
InfinyOn cloud is a simplest way to use the remote worker. When you create a cluster in InfinyOn cloud, it will automatically provision and sync worker for you.
9783

9884
The worker is automatically register when you create the cluster. By default, worker is name as cluster name.
9985

@@ -134,7 +120,7 @@ To unregister the worker after you are done with and no longer need, you can us
134120
$> sdf worker unregister <name>
135121
```
136122

137-
## Managing workers
123+
### Managing workers
138124

139125
Workers must be registered before deploying a dataflow. The CLI provides commands to manage workers, including creating, listing, switching, and deleting them.
140126

@@ -160,8 +146,30 @@ finding all available workers:
160146

161147
With `-all` option, it will display `version` of the discovered worker.
162148

149+
// check if this is true for remote workers
150+
The dataflow state is stored in the `~/.sdf/<cluster>/worker/<dataflow>`.
163151

164-
# Deploying dataflow
152+
### Workers on InfinyOn Cloud
153+
154+
With InfinyOn Cloud, there is no need to manage the worker. It provisions the worker for you. It also sync profile when cluster is created.
155+
156+
For example, creating cloud cluster will automatically provision and create SDF worker profile.
157+
158+
```bash
159+
$> fluvio cloud login --use-oauth2
160+
$> fluvio cloud cluster create
161+
Creating cluster...
162+
Done!
163+
Downloading cluster config
164+
Registered sdf worker: jellyfish
165+
Switched to new profile: jellyfish
166+
```
167+
168+
You can unregister the cloud worker like any other remote worker.
169+
170+
## Managing Dataflows
171+
172+
### Deploying Dataflows to Workers
165173

166174
Once worker is selected, you can deploy the dataflow using `deploy` command:
167175

@@ -175,16 +183,14 @@ The deploy command is similar to the run command. It deploys the dataflow and st
175183
Error: No workers. run `sdf worker create` to create one.
176184
```
177185

178-
## Managing dataflow in worker
179-
180186
When you are running dataflow in the worker, it will indicate name of the worker in the prompt:
181187

182188
```bash
183189
$> sdf deploy
184190
[main] >> show state
185191
```
186192

187-
## Listing and selecting dataflow
193+
### Listing and selecting dataflow
188194

189195
To list all dataflows running in the worker, you can use the `show dataflow` command which shows the fully qualified name of the dataflow and its status.
190196

@@ -212,22 +218,7 @@ To select the dataflow, you can use `dataflow select` with the fully qualified d
212218
dataflow switched to: myorg/wordcount-simple@0.10
213219
```
214220
215-
## Deleting dataflow
216-
217-
To delete the dataflow, you can use the `dataflow delete` command.
218-
219-
After you delete the dataflow, it will no longer be listed in the dataflow list.
220-
221-
```bash
222-
[jolly-pond]>> delete dataflow myorg/wordcount-simple@0.10
223-
Dataflow Status Last Updated
224-
* myorg/user-job-map@0.1.0 running 10 minutes ago
225-
```
226-
227-
Note that since `myorg/wordcount-simple@0.10 ` is deleted, it is no longer listed in the dataflow list.
228-
229-
230-
## Advanced: Stopping and Restarting dataflow
221+
### Stopping and Restarting dataflow
231222
232223
In certain cases, you want to stop the dataflow but not delete it. You can use the `stop` command.
233224
@@ -242,36 +233,18 @@ And restart:
242233
243234
Note that `stop` is not persistent. If worker is restarted, the dataflow will be restarted.
244235
245-
# Using worker in InfinyOn Cloud
246-
247-
With InfinyOn Cloud, there is no need to manage the worker. It provisions the worker for you. It also sync profile when cluster is created.
248-
249-
For example, creating cloud cluster will automatically provision and create SDF worker profile.
250-
251-
```bash
252-
$> fluvio cloud login --use-oauth2
253-
$> fluvio cloud cluster create
254-
Creating cluster...
255-
Done!
256-
Downloading cluster config
257-
Registered sdf worker: jellyfish
258-
Switched to new profile: jellyfish
259-
```
260-
261-
You can unregister the cloud worker like any other remote worker.
262-
236+
### Deleting dataflow
263237
264-
# Advanced: Starting remote worker
238+
To delete the dataflow, you can use the `dataflow delete` command.
265239
266-
To start worker as remote worker, you can use `launch` command:
240+
After you delete the dataflow, it will no longer be listed in the dataflow list.
267241
268242
```bash
269-
$> sdf worker launch --base-dir <dir> --worker-id <worker-id>
243+
[jolly-pond]>> delete dataflow myorg/wordcount-simple@0.10
244+
Dataflow Status Last Updated
245+
* myorg/user-job-map@0.1.0 running 10 minutes ago
270246
```
271247
272-
where `base-dir` and `worker-id` are optional parameters. If you don't specify `base-dir`, it will use the default directory: `/sdf`.
273-
If you don't specify `worker-id`, it will generate unique id for you.
274-
275-
This script is typically used by devops team to start the worker in the server.
248+
Note that since `myorg/wordcount-simple@0.10 ` is deleted, it is no longer listed in the dataflow list.
276249
277-
[CLI]: cli
250+
[SDF CLI]: sdf/cli/index.mdx

sdf/whatsnew.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ To upgrade CLI to this version, run the following command:
1515

1616
<CodeBlock language="bash">{InstallFvm}</CodeBlock>
1717

18-
To upgrade host workers, shutdown and restart the worker:
18+
To upgrade local (host) workers, shutdown and restart the worker:
1919

2020
```bash
2121
$ sdf worker shutdown <host-worker-name>
2222
$ sdf worker create <host-worker-name>
2323
```
2424

25-
For upgrading cloud workers, please contact [InfinyOn support](#infinyon-support).
25+
For upgrading Infinyon Cloud (remote) workers, please contact [InfinyOn support](#infinyon-support).
2626

2727
### CLI changes
2828

src/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ code, code * {
2121
font-family: "Spline Sans Mono", monospace;
2222
font-style: normal !important;
2323
font-weight: 400 !important;
24+
vertical-align: top;
25+
padding-top: 0;
26+
padding-bottom: 0;
2427
}
2528

2629
p {

0 commit comments

Comments
 (0)