diff --git a/openfl/interface/workspace.py b/openfl/interface/workspace.py index b138ad67db1..6abfa248d79 100644 --- a/openfl/interface/workspace.py +++ b/openfl/interface/workspace.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 -"""Workspace module.""" +"""Workspace module""" import logging import os import shutil @@ -30,7 +30,7 @@ @pass_context def workspace(context): """Manage Federated Learning Workspaces. - + Args: context: The context in which the command is being invoked. """ @@ -413,8 +413,27 @@ 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, + constructs the workspace Docker image, and optionally saves the workspace image as a tarball file. + + Steps Performed: + 1. Exports the current workspace as an archive. + 2. Builds the OpenFL base Docker image using the specified or default revision. + 3. Builds the workspace Docker image, incorporating the exported workspace and signing key. + 4. Optionally saves the workspace Docker image as a `.tar` file. + Raises: + FileNotFoundError: If the provided enclave key path does not exist. + RuntimeError: If any Docker commands fail during the build or export process. + + Notes: + - If no enclave key is provided, a new one is generated using OpenSSL and saved in the workspace. + - The generated image is compatible with TEE environments but can be used outside of TEE if needed. + - Docker BuildKit is utilized for efficient and secure image builds. + """ # Docker build options options = [] options.append("--no-cache" if rebuild else "")