Skip to content
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

fix: fix issue on applehv when mounting volume (#130) #135

Closed
wants to merge 1 commit into from

Conversation

lstocchi
Copy link
Contributor

This patch adds the :z bind option when mounting the volume to fix the issue on applehv.

Copy link
Contributor

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

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

LGTM

@lstocchi
Copy link
Contributor Author

@jeffmaury have you run it on your MAC? Bc it does not work for @feloy

@lstocchi
Copy link
Contributor Author

Closing for the moment as this does not work. I had a dirty env apparently. If you execute the mount using the cli it update volume permissions and then it works fine with desktop.
By downloading the model again using desktop it does not work

@lstocchi lstocchi closed this Jan 25, 2024
@feloy
Copy link
Contributor

feloy commented Jan 25, 2024

I'm reopening to track the issue.

context:

  • mac M3
  • appleHV

As far as I can understand, mounting the file with the :z flag using the podman API is not making the necessary changes on the files to mount.

The steps to investigate:

  • start the container with AI Studio (with podman API), and :z => no access to file
  • start the container with CLI and :z => access to file
  • start again the container with AI Studio (with podman API), and :z (and the same file) => access to file

Details on the file:
mount.md

@feloy feloy reopened this Jan 25, 2024
@rhatdan
Copy link
Member

rhatdan commented Jan 26, 2024

A directory mounted with :z will cause podman and other container tools to run a chcon -t container_file_t -l s0 -R SOURCDIR. This will attempt to change the SELinux label to a label that is read/writable by all containers from an SELinux point of view. It can take a very long time, depending on the size of the volume being mounted in (Size means # or inodes). If it needs to change the label on 10,000,000 inodes it is going to take a long time. If the volume is coming from a nother system or outside of a virtual machine it can even take longer. Using apple hypervisor we have seen issues with the 'Z' or 'z" failing, when the source file is set read/only.

We have made a change in Podman to automatically mount all volumes from outside the VM to label them as container_file_t:s0 by default. This means that the containers can read/write all volumes mounted into the VM, and you o longer need to do :z or :Z. If you do a :Z or have previously done a :Z to a volume, then this volume will continue to be only useable by the container with the same SElinuc MCS Label.

containers/podman#21297

@@ -137,6 +137,9 @@ export class ApplicationManager {
Target: `/${modelName}`,
Source: modelPath,
Type: 'bind',
BindOptions: {
Propagation: 'z',
Copy link
Contributor

Choose a reason for hiding this comment

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

That is not compatible with the Podman Desktop API

@lstocchi lstocchi marked this pull request as draft January 26, 2024 15:03
@lstocchi
Copy link
Contributor Author

Closing as it should work by using the updated podman-desktop api -> #231

@lstocchi lstocchi closed this Mar 11, 2024
mhdawson pushed a commit to mhdawson/podman-desktop-extension-ai-lab that referenced this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants