-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from conductor-oss/community-docs-cleanup-2
cleanup docs
- Loading branch information
Showing
69 changed files
with
124 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[Related Projects](docs/docs/resources/related.md) | ||
[Related Projects](docs/resources/related.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[Annotations Processor](docs/docs/reference-docs/annotations-processor.md) | ||
[Annotations Processor](docs/documentation/advanced/annotation-processor.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# | ||
# conductor:ui - Netflix Conductor UI | ||
# conductor:ui - Conductor UI | ||
# | ||
FROM node:20-alpine | ||
LABEL maintainer="Orkes OSS <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 1 addition & 54 deletions
55
docs/devguide/how-tos/Workers/build-a-golang-task-worker.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,3 @@ | ||
# Build a Go Task Worker | ||
|
||
## Install | ||
```shell | ||
go get github.com/netflix/conductor/client/go | ||
``` | ||
This will create a Go project under $GOPATH/src and download any dependencies. | ||
|
||
## Implementing a Task a Worker | ||
`task`package provies the types used to implement the worker. Here is a reference worker implementation: | ||
|
||
```go | ||
package task | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Implementation for "task_1" | ||
func Task_1_Execution_Function(t *task.Task) (taskResult *task.TaskResult, err error) { | ||
log.Println("Executing Task_1_Execution_Function for", t.TaskType) | ||
|
||
//Do some logic | ||
taskResult = task.NewTaskResult(t) | ||
|
||
output := map[string]interface{}{"task":"task_1", "key2":"value2", "key3":3, "key4":false} | ||
taskResult.OutputData = output | ||
taskResult.Status = "COMPLETED" | ||
err = nil | ||
|
||
return taskResult, err | ||
} | ||
``` | ||
|
||
## Worker Polling | ||
Here is an example that shows how to start polling for tasks after defining the tasks. | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"github.com/netflix/conductor/client/go" | ||
"github.com/netflix/conductor/client/go/task/sample" | ||
) | ||
|
||
func main() { | ||
c := conductor.NewConductorWorker("{{ server_host }}", 1, 10000) | ||
|
||
c.Start("task_1", "", sample.Task_1_Execution_Function, false) | ||
c.Start("task_2", "mydomain", sample.Task_2_Execution_Function, true) | ||
} | ||
``` | ||
### `NewConductorWoker` parameters | ||
1. baseUrl: Server address. | ||
2. threadCount: No. of threads. Number of threads should be at-least same as the number of workers | ||
3. pollingInterval: Time in millisecond between subsequent polls | ||
See [conductor-sdk/conductor-go](https://github.com/conductor-sdk/conductor-go/blob/main/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 1 addition & 79 deletions
80
docs/devguide/how-tos/Workers/build-a-python-task-worker.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,4 @@ | ||
# Build a Python Task Worker | ||
## Install the python client | ||
```shell | ||
virtualenv conductorclient | ||
source conductorclient/bin/activate | ||
cd ../conductor/client/python | ||
python setup.py install | ||
``` | ||
|
||
## Implement a Task Worker | ||
[ConductorWorker](https://github.com/Netflix/conductor/blob/main/polyglot-clients/python/conductor/ConductorWorker.py#L36) | ||
class is used to implement task workers. | ||
The following script shows how to bring up two task workers named `book_flight` and `book_car`: | ||
|
||
```python | ||
from __future__ import print_function | ||
from conductor.ConductorWorker import ConductorWorker | ||
|
||
def book_flight_task(task): | ||
return {'status': 'COMPLETED', 'output': {'booking_ref': 2341111, 'airline': 'delta'}, 'logs': ['trying delta', 'skipping aa']} | ||
|
||
def book_car_task(task): | ||
return {'status': 'COMPLETED', 'output': {'booking_ref': "84545fdfd", 'agency': 'hertz'}, 'logs': ['trying hertz']} | ||
|
||
def main(): | ||
print('Starting Travel Booking workflows') | ||
cc = ConductorWorker('{{ server_host }}{{ api_prefix }}', 1, 0.1) | ||
cc.start('book_flight', book_flight_task, False) | ||
cc.start('book_car', book_car_task, True) | ||
|
||
if __name__ == '__main__': | ||
main() | ||
``` | ||
### `ConductorWorker` parameters | ||
```python | ||
server_url: str | ||
The url to the server hosting the conductor api. | ||
Ex: '{{ server_host }}{{ api_prefix }}' | ||
|
||
thread_count: int | ||
The number of threads that will be polling for and | ||
executing tasks in case of using the start method. | ||
|
||
polling_interval: float | ||
The number of seconds that each worker thread will wait | ||
between polls to the conductor server. | ||
|
||
worker_id: str, optional | ||
The worker_id of the worker that is going to execute the | ||
task. For further details, refer to the documentation | ||
By default, it is set to hostname of the machine | ||
``` | ||
### `start` method parameters | ||
```pythhon | ||
taskType: str | ||
The name of the task that the worker is looking to execute | ||
exec_function: function | ||
The function that the worker will execute. The function | ||
must return a dict with the `status`, `output` and `logs` | ||
keys present. If this is not present, an Exception will be | ||
raised | ||
wait: bool | ||
Whether the worker will block execution of further code. | ||
Since the workers are being run in daemon threads, when the | ||
program completes execution, all the threads are destroyed. | ||
Setting wait to True prevents the program from ending. | ||
If multiple workers are being called from the same program, | ||
all but the last start call but have wait set to False. | ||
The last start call must always set wait to True. If a | ||
single worker is being called, set wait to True. | ||
domain: str, optional | ||
The domain of the task under which the worker will run. For | ||
further details refer to the conductor server documentation | ||
By default, it is set to None | ||
``` | ||
|
||
See | ||
[https://github.com/Netflix/conductor/tree/main/polyglot-clients/python](https://github.com/Netflix/conductor/tree/main/polyglot-clients/python) | ||
for the source code. | ||
[conductor-sdk/conductor-python](https://github.com/conductor-sdk/conductor-python/blob/main/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.