Skip to content

Commit

Permalink
added setuptool import
Browse files Browse the repository at this point in the history
Signed-off-by: yes <shailesh.tanwar@intel.com>
  • Loading branch information
tanwarsh committed Jan 17, 2025
1 parent 354f227 commit 3a3f80d
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion openfl-workspace/torch_cnn_histology/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
setuptools==65.5.1
setuptools>=65.5.1
torch==2.4.1
torchvision==0.19.1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
setuptools==65.5.1
setuptools>=65.5.1
torch==2.4.1
torchvision==0.19.1
2 changes: 1 addition & 1 deletion openfl-workspace/torch_cnn_mnist/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
setuptools==65.5.1
setuptools>=65.5.1
torch==2.4.1
torchvision==0.19.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools==65.5.1
setuptools>=65.5.1
tensorboard
torch==2.4.1
torchvision==0.19.1
Expand Down
2 changes: 1 addition & 1 deletion openfl-workspace/torch_cnn_mnist_fed_eval/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools==65.5.1
setuptools>=65.5.1
tensorboard
torch==2.4.1
torchvision==0.19.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability
rsa>=4.7 # not directly required, pinned by Snyk to avoid a vulnerability
setuptools==65.5.1
setuptools>=65.5.1
tensorboard
torch==2.4.1
torchvision==0.19.1
Expand Down
2 changes: 1 addition & 1 deletion openfl-workspace/torch_llm_horovod/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools==65.5.1
setuptools>=65.5.1
accelerate
datasets
evaluate
Expand Down
2 changes: 1 addition & 1 deletion openfl-workspace/torch_template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Set your workspace's requirements here
setuptools==65.5.1
setuptools>=65.5.1
torch==2.4.1
torchvision==0.19.1
2 changes: 1 addition & 1 deletion openfl-workspace/torch_unet_kvasir/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools==65.5.1
setuptools>=65.5.1
scikit-image==0.24.0
torch==2.4.1
torchvision==0.19.1
10 changes: 6 additions & 4 deletions openfl/interface/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

"""Workspace module."""

import setuptools # this import is added to avoid error: assert '_distutils' in core.__file__, core.__file__
import logging
import os
import shutil
Expand Down Expand Up @@ -66,7 +67,6 @@ def create_dirs(prefix):
(prefix / "data").mkdir(parents=True, exist_ok=True) # training data
(prefix / "logs").mkdir(parents=True, exist_ok=True) # training logs
(prefix / "save").mkdir(parents=True, exist_ok=True) # model weight saves / initialization
(prefix / "local_state").mkdir(parents=True, exist_ok=True) # persistent state
(prefix / "src").mkdir(parents=True, exist_ok=True) # model code

shutil.copyfile(WORKSPACE / "workspace" / ".workspace", prefix / ".workspace")
Expand Down Expand Up @@ -355,7 +355,6 @@ def export_() -> str:
# os.makedirs(os.path.join(tmp_dir, 'save'), exist_ok=True)
os.makedirs(os.path.join(tmp_dir, "logs"), exist_ok=True)
os.makedirs(os.path.join(tmp_dir, "data"), exist_ok=True)
os.makedirs(os.path.join(tmp_dir, "local_state"), exist_ok=True)
shutil.copytree("src", os.path.join(tmp_dir, "src"), ignore=ignore)
shutil.copytree("plan", os.path.join(tmp_dir, "plan"), ignore=ignore)
shutil.copytree("save", os.path.join(tmp_dir, "save"))
Expand All @@ -365,7 +364,7 @@ def export_() -> str:
if not os.path.isfile(_ws_identifier_file):
openfl_ws_identifier_file = os.path.join(WORKSPACE, "workspace", _ws_identifier_file)
logging.warning(
f"`{_ws_identifier_file}` is missing, copying {openfl_ws_identifier_file} as-is."
f"`{_ws_identifier_file}` is missing, " f"copying {openfl_ws_identifier_file} as-is."
)
shutil.copy2(openfl_ws_identifier_file, tmp_dir)
shutil.copy2(_ws_identifier_file, tmp_dir)
Expand Down Expand Up @@ -430,7 +429,10 @@ def dockerize_(context, save: bool, rebuild: bool, enclave_key: str, revision: s
# Build OpenFL base image.
logging.info("Building OpenFL Base image")
base_image_build_cmd = (
"DOCKER_BUILDKIT=1 docker build {options} -t {image_name} -f {dockerfile} {build_context}"
"DOCKER_BUILDKIT=1 docker build {options} "
"-t {image_name} "
"-f {dockerfile} "
"{build_context}"
).format(
options=options,
image_name="openfl",
Expand Down

0 comments on commit 3a3f80d

Please sign in to comment.