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

OpenDDS cannot be configured with environment variables #4491

Merged
merged 1 commit into from Mar 6, 2024

Conversation

jrw972
Copy link
Contributor

@jrw972 jrw972 commented Feb 27, 2024

Problem

OpenDDS cannot be configured with environment variables. Configuring with environment variables is useful for containers and cloud deployments.

Solution

Parse environment variables and add them to the ConfigStore. Only environment variables starting with OPENDDS_ are parsed. The remainder of the name is used as the key for the ConfigStore. Environment variables are processed before command-line arguments and the config file.

@jrw972 jrw972 self-assigned this Feb 27, 2024
@jrw972 jrw972 marked this pull request as ready for review February 27, 2024 19:06
dds/DCPS/Service_Participant.cpp Show resolved Hide resolved
dds/DCPS/Service_Participant.cpp Outdated Show resolved Hide resolved
@jrw972 jrw972 linked an issue Feb 28, 2024 that may be closed by this pull request
@jrw972 jrw972 force-pushed the env-config branch 2 times, most recently from 23b75e0 to fd5d92a Compare February 29, 2024 14:52
LPTSTR env_string = (LPTSTR) env_strings;

while (*env_string) {
parse_env(ACE_TEXT_ALWAYS_CHAR(env_string));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitza-oci Does this make sense?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try adding a uses_wchar Windows build to CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity...

build_and_test.yml is at the limit that GHA will allow so we will need to refactor it before we can add another build.

Converting an existing Windows build failed with build errors. One of the root causes was wide character not being supported correctly for ACE's XML support. So, we will need to be selective about what features to include in such a build.

I will record these points in the Wiki.

@jrw972 jrw972 force-pushed the env-config branch 2 times, most recently from 11adb2d to 363b7d2 Compare March 4, 2024 20:05
Copy link
Member

@mitza-oci mitza-oci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be tested by setting the environment in the Perl test driver or spawning a child process with a modified environment.

Problem
-------

OpenDDS cannot be configured with environment variables.  Configuring
with environment variables is useful for containers and cloud
deployments.

Solution
--------

Parse environment variables and add them to the ConfigStore.  Only
environment variables starting with OPENDDS_ are parsed.  The
remainder of the name is used as the key for the ConfigStore.
Environment variables are processed before command-line arguments and
the config file.
@jrw972 jrw972 merged commit 19abd11 into OpenDDS:master Mar 6, 2024
129 of 130 checks passed
@jrw972 jrw972 deleted the env-config branch March 6, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for looking at environment variables when accessing config
3 participants