Skip to content

Commit

Permalink
- Add docstring to facilitate doc generation for `fx workspace docker…
Browse files Browse the repository at this point in the history
…ize` command

- Rebased - 11/Nov/2024
Signed-off-by: Shailesh Pant <[email protected]>
  • Loading branch information
ishaileshpant committed Nov 11, 2024
1 parent e87627f commit 5ae659d
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion openfl/interface/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,34 @@ def export_() -> str:
)
@pass_context
def dockerize_(context, save, rebuild, revision):
"""Package current workspace as a Docker image."""
"""
Package the current workspace as a Docker image.
This function performs the following steps:
1. Exports the current workspace.
2. Builds the OpenFL base Docker image.
3. Builds the workspace Docker image based on the exported workspace.
4. Optionally saves the workspace Docker image as a tarball file.
Parameters:
context: The context object that provides access to shared information and methods,such as invoking other commands or accessing configuration settings.
save (bool): If True, saves the workspace Docker image as a tarball (`.tar`) file.
rebuild (bool): If True, forces a rebuild of the Docker images without using the cache.
revision (str): Specifies the OpenFL revision to use as a build argument in the Docker build process.
Returns:
None
Raises:
RuntimeError: If any of the Docker commands fail during execution.
Example:
To package the workspace and save the Docker image as a tarball:
```python
dockerize_(context, save=True, rebuild=False, revision='main')
```
"""
# Docker build options
options = []
options.append("--no-cache" if rebuild else "")
Expand Down

0 comments on commit 5ae659d

Please sign in to comment.