NVIDIA / NVFlare

NVIDIA Federated Learning Application Runtime Environment
https://nvidia.github.io/NVFlare/
Apache License 2.0
648 stars 181 forks source link

Support file source in Job API #3043

Closed yanchengnv closed 1 month ago

yanchengnv commented 1 month ago

Fixes # .

Description

Currently when a Python file is added, it is subject to special processing like imports scanning. Depending the result of the scanning and how the file path is specified, it may be placed into a subfolder within the job's "custom" folder. There is no way to guarantee that the source file is placed in the desired location within the "custom" folder.

This PR fixes this by introducing the FileSource object. The user can now place any file(s) into any desired location with the job's "custom" folder. For example:

job.to(obj=FileSource(src_path="/a/b/c/xyz.txt", dest_dir="src/docs"), target="server")

This will copy the file /a/b/c/xyz.txt to the /src/docs.

The src_path can also be a directory. In this case, the content of the directory will be copied into the dest_dir within the "custom" folder.

If dest_dir is not specified (None), then the actual destination will be the "custom" dir.

Types of changes

yanchengnv commented 1 month ago

/build

YuanTingHsieh commented 1 month ago

/build