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

[improve][fn] add docs for supporting reading config options from files in Python runner #544

Merged
merged 4 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 34 additions & 0 deletions docs/functions-runtime-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,37 @@ functionRuntimeFactoryConfigs:
```

For more details, see [code](https://github.com/apache/pulsar/blob/master/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntimeFactoryConfig.java).

### Set runtime parameter with configuration file

Pulsar Functions now supports setting runtime parameters using a configuration file **in Python**.

**Example**

You can start a Python runtime using the configuration file `config.ini` with the following command.

```shell
pulsar-admin functions localrun \
--py /path/to/python_instance.py \
--config-file /path/to/config.ini \
--classname MyFunction \
--logging_leve debug \
Anonymitaet marked this conversation as resolved.
Show resolved Hide resolved
--inputs persistent://public/default/my-input-topic \
--output persistent://public/default/my-output-topic \
--log-topic persistent://public/default/functions-logs
```

` --config-file` is the path to the configuration file. Note that:

- The ` --config-file` should be written in `.ini` format, with each parameter being configured as `key = value`.

**Example**

```ini
[DEFAULT]
logging_level = info
max_pending_async_requests = 1000
max_concurrent_requests = 50
```

- When starting with the ` --config-file`, all parameters can be set in the ` --config-file`. If you specify parameters on the command line that are also present in the ` --config-file`, the values of the parameters on the command line will **take precedence over** the values in the ` --config-file`. Like in the example above, the `logging_level` is set to `debug`.
Anonymitaet marked this conversation as resolved.
Show resolved Hide resolved
Loading