Skip to content

Commit

Permalink
fix compatibility test issue (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan7n authored Apr 2, 2024
1 parent c944f89 commit 4556400
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cli/medperf/commands/compatibility_test/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from medperf.commands.dataset.prepare import DataPreparation
from medperf.commands.dataset.submit import DataCreation
from medperf.utils import get_folders_hash, remove_path
from medperf.utils import get_file_hash, get_folders_hash, remove_path
from medperf.exceptions import InvalidArgumentError, InvalidEntityError

from medperf.comms.entity_resources import resources
Expand Down Expand Up @@ -48,11 +48,13 @@ def prepare_local_cube(path):
config.tmp_paths.append(dst)
cube_metadata_file = os.path.join(path, config.cube_metadata_filename)
if not os.path.exists(cube_metadata_file):
mlcube_yaml_path = os.path.join(path, config.cube_filename)
mlcube_yaml_hash = get_file_hash(mlcube_yaml_path)
temp_metadata = {
"id": None,
"name": temp_uid,
"git_mlcube_url": "mock_url",
"mlcube_hash": "",
"mlcube_hash": mlcube_yaml_hash,
"parameters_hash": "",
"image_tarball_hash": "",
"additional_files_tarball_hash": "",
Expand Down Expand Up @@ -88,9 +90,11 @@ def prepare_cube(cube_uid: str):
path = path.resolve()

if os.path.exists(path):
logging.info("local path provided. Creating symbolic link")
temp_uid = prepare_local_cube(path)
return temp_uid
mlcube_yaml_path = os.path.join(path, config.cube_filename)
if os.path.exists(mlcube_yaml_path):
logging.info("local path provided. Creating symbolic link")
temp_uid = prepare_local_cube(path)
return temp_uid

logging.error(f"mlcube {cube_uid} was not found as an existing mlcube")
raise InvalidArgumentError(
Expand Down

0 comments on commit 4556400

Please sign in to comment.