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

Add yaml include support #3133

Merged
merged 12 commits into from
Jan 30, 2025
Merged

Add yaml include support #3133

merged 12 commits into from
Jan 30, 2025

Conversation

yhwen
Copy link
Collaborator

@yhwen yhwen commented Jan 7, 2025

Fixes # .

Description

Added the support for yaml to include another yaml configuration file.

YAML does not naturally support any kind of "import" or "include" statement to include another yaml file. Adding this to support the yaml config in the format like: (include could be single file, or a list of include files.)

....
include: 1.yml

or:
include: [1.yml, 2.yml]

The "include" can be used at any level. Also support recursively include.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtest.sh.
  • In-line docstrings updated.
  • Documentation updated.

Copy link
Collaborator

@chesterxgchen chesterxgchen left a comment

Choose a reason for hiding this comment

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

Should add description and unit tests to show how this supposed to be used ?

@yanchengnv
Copy link
Collaborator

Please explain why this feature is needed.

@yhwen
Copy link
Collaborator Author

yhwen commented Jan 17, 2025

Please explain why this feature is needed.

Added the description of how to use the "include". Also include the example in the unit_test.

api_version: 3
name: example_project

include: 1.yml

participants:

  • name: server
    port: 123
    include: [1.yml]
  • name: client
    port: 234
    include: 2.yml

Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

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

Should support dict too.

nvflare/lighter/utils.py Show resolved Hide resolved
Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

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

Looks good in general. Please fix the open file issue.

nvflare/lighter/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes of open file issues!

@yhwen
Copy link
Collaborator Author

yhwen commented Jan 24, 2025

/build

@yhwen yhwen enabled auto-merge (squash) January 24, 2025 21:54
@yhwen
Copy link
Collaborator Author

yhwen commented Jan 28, 2025

/build

@ZiyueXu77
Copy link
Collaborator

/build

@yhwen yhwen merged commit 288e790 into NVIDIA:main Jan 30, 2025
20 checks passed
nvidianz pushed a commit to nvidianz/NVFlare that referenced this pull request Jan 30, 2025
Fixes # .

### Description

Added the support for yaml to include another yaml configuration file.

YAML does not naturally support any kind of "import" or "include"
statement to include another yaml file. Adding this to support the yaml
config in the format like: (include could be single file, or a list of
include files.)

....
include: 1.yml

or:
include:  [1.yml, 2.yml]

The "include" can be used at any level. Also support recursively
include.


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Quick tests passed locally by running `./runtest.sh`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated.

---------

Co-authored-by: Ziyue Xu <[email protected]>
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.

4 participants