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 - 18/Nov/2024
- Updated as per latest code and comments
- Added module level comment
Signed-off-by: Shailesh Pant <shailesh.pant@intel.com>
  • Loading branch information
ishaileshpant committed Nov 19, 2024
1 parent a977fb3 commit 9ae28e7
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions openfl/interface/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0


"""Workspace module."""
"""Workspace module"""
import logging
import os
import shutil
Expand Down Expand Up @@ -413,8 +413,28 @@ def export_() -> str:
)
@pass_context
def dockerize_(context, save: bool, rebuild: bool, enclave_key: str, revision: str):
"""Package current workspace as a TEE-ready Docker image."""
"""
Package the current workspace as a Trusted Execution Environment (TEE)-ready Docker image.
This command exports the current workspace, builds an OpenFL base Docker image,
\b
constructs the workspace Docker image, and optionally saves the workspace image as a tarball file.
Steps Performed:\n
1. Exports the current workspace as an archive.\n
2. Builds the OpenFL base Docker image using the specified or default revision.\n
3. Builds the workspace Docker image, incorporating the exported workspace and signing key.\n
4. Optionally saves the workspace Docker image as a `.tar` file.\n
\b
Raises:\n
FileNotFoundError: If the provided enclave key path does not exist.\n
RuntimeError: If any Docker commands fail during the build or export process.\n
\b
Notes:\n
- If no enclave key is provided, a new one is generated using OpenSSL and saved in the workspace.\n
- The generated image is compatible with TEE environments but can be used outside of TEE if needed.\n
- Docker BuildKit is utilized for efficient and secure image builds.\n
"""
# Docker build options
options = []
options.append("--no-cache" if rebuild else "")
Expand Down

0 comments on commit 9ae28e7

Please sign in to comment.