Skip to content

Fix for dmidecode + support mounting filepaths in docker #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 15, 2025

Conversation

anandhu-eng
Copy link
Contributor

No description provided.

@anandhu-eng anandhu-eng requested a review from a team as a code owner April 1, 2025 16:55
Copy link
Contributor

github-actions bot commented Apr 1, 2025

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@@ -3,4 +3,4 @@
if [[ ${MLC_SUDO_USER} == "yes" ]]; then
${MLC_SUDO} dmidecode -t memory > ${MLC_MEMINFO_FILE}
fi
test $? -eq 0 || return $?
test $? -eq 0 || echo "Warning: Memory info is not recorded"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dmidecode exits with error no device error. Maybe due to permission error with dmidecode inside docker containers. Would it be okay if we just print warnings instead of exiting.

@anandhu-eng anandhu-eng marked this pull request as draft April 1, 2025 18:43
@anandhu-eng anandhu-eng marked this pull request as ready for review April 2, 2025 12:26
@anandhu-eng anandhu-eng changed the title Fix for dmidecode Fix for dmidecode + support mounting filepaths in docker Apr 2, 2025
@@ -78,10 +78,19 @@ def process_mounts(mounts, env, docker_settings, f_run_cmd):

# Update container environment string and mappings
if host_env_key:
container_env_string += f" --env.{host_env_key}={container_env_key} "
# We are modifying the input mapping variables wrt to the new container env variable. Is explicit passing of env variable necessary?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the run command is directly using the env variable?

@@ -392,7 +392,7 @@ def get_docker_default(key):

def get_host_path(value):
# convert relative path to absolute path
value = convert_to_abs_path(value)
value = os.path.dirname(convert_to_abs_path(value))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it's a folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.dirname does not change the value if folder is directly supplied.

sample output:

>>> import os
>>> os.path.dirname("/home/anandhu/")
'/home/anandhu'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only if / is at the end right? I think we should explicitly check for a file here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, to be safe, commit 5fb35f3 uses pathlib library to process the paths

@@ -419,7 +419,7 @@ def get_container_path_script(i):

def get_container_path(value, username="mlcuser"):
# convert relative path to absolute path
value = convert_to_abs_path(value)
# if we are trying to mount a file, mount the parent folder.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative path was already been converted to absolute path here. But I guess that should be done in get_container_value itself as there is a chance that the relative path of a folder in MLC cache could also be supplied by user which would not be handled properly here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit 5e9f7e4

@anandhu-eng anandhu-eng marked this pull request as draft April 14, 2025 06:23
@anandhu-eng
Copy link
Contributor Author

Currently, the R-GAT workflow is failing due to dgl 2.5.0 pip install error which is already raised here.

@anandhu-eng anandhu-eng marked this pull request as ready for review April 14, 2025 12:11
@arjunsuresh arjunsuresh merged commit a71d599 into mlcommons:dev Apr 15, 2025
70 of 71 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants