mlcommons / cm4mlops

A collection of portable, reusable and cross-platform automation recipes (CM scripts) with a human-friendly interface and minimal dependencies to make it easier to build, run, benchmark and optimize AI, ML and other applications and systems across diverse and continuously changing models, data sets, software and hardware (cloud/edge)
http://docs.mlcommons.org/cm4mlops/
Apache License 2.0
7 stars 12 forks source link

Packages requiring SUDO are installed in user cache path #80

Open anandhu-eng opened 2 weeks ago

anandhu-eng commented 2 weeks ago

Currently, the install, cuda script installs the packages with SUDO permission to user path, which requires SUDO permission to remove when doing cm rm cache. Also, upon installation to user path, the other users in the system might not be able to access the packages.

This was the error while cache removal:

Deleting CM artifact in /home/anandhu/CM/repos/local/cache/911bc2acb2d841df with tags "install,cuda,prebuilt,prebuilt-cuda,install-prebuilt-cuda,version-12.4.1,script-artifact-14eadcd42ba340c3" ...
Traceback (most recent call last):
  File "/home/anandhu/.local/bin/cm", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/anandhu/.local/lib/python3.12/site-packages/cmind/cli.py", line 37, in run
    r = cm.access(argv, out='con')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/anandhu/.local/lib/python3.12/site-packages/cmind/core.py", line 602, in access
    r = action_addr(i)
        ^^^^^^^^^^^^^^
  File "/home/anandhu/.local/lib/python3.12/site-packages/cmind/automation.py", line 605, in delete
    shutil.rmtree(path_to_artifact)
  File "/usr/lib/python3.12/shutil.py", line 785, in rmtree
    _rmtree_safe_fd(fd, path, onexc)
  File "/usr/lib/python3.12/shutil.py", line 686, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onexc)
  File "/usr/lib/python3.12/shutil.py", line 686, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onexc)
  File "/usr/lib/python3.12/shutil.py", line 717, in _rmtree_safe_fd
    onexc(os.unlink, fullname, err)
  File "/usr/lib/python3.12/shutil.py", line 715, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: 'fortran.c'
arjunsuresh commented 2 weeks ago

@anandhu-eng that's correct. I think the best solution will be to install such packages under /opt directory (not sure if we have any such installations for windows) and then add a cache_dependency path in the respective script.