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

Signed-off-by: Shailesh Pant <[email protected]>
  • Loading branch information
ishaileshpant committed Nov 11, 2024
1 parent 4898103 commit 3272c5d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions openfl/interface/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,35 @@ def export_() -> str:
)
@pass_context
def dockerize_(context, save, rebuild, revision):
"""
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')
```
"""
"""Package current workspace as a Docker image."""

# Docker build options
Expand Down

0 comments on commit 3272c5d

Please sign in to comment.