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

[Enhancement] Support reading config options from file in Function Java Runner (JavaInstanceStarter) #18532

Open
2 tasks done
imaffe opened this issue Nov 18, 2022 · 1 comment · May be fixed by #18643 or streamnative/pulsar-archived#5181
Labels

Comments

@imaffe
Copy link

imaffe commented Nov 18, 2022

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Currently the JavaInstanceStarter uses JCommander to parse command line args. However in certain cases reading from command line is not very flexible (think we need to use a env var as an argument but the container has no shell access). Thus we need to support reading configs from a file.

This is necessary for :

BTW, we can provide a new issue for python as well.

Solution

Solution:

  • add a new command line flag "--config_file" and accepts a file URl
  • read the file using PulsarConfigurationLoader and create a new class JavaInstanceConfiguration extends PulsarConfiguration.
  • Config priority : command line > conf file.
  • Create a new validation class the make sure required field are either provided in the file or via command line interface (this means we need to make all JCommander required field non-required)

We need to make sure this new feature would not break any existing code.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

@github-actions github-actions bot added the Stale label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment