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

Unable to change mount point of mounted directories #64

Closed
jlsalmon opened this issue Mar 1, 2024 · 3 comments · Fixed by #65
Closed

Unable to change mount point of mounted directories #64

jlsalmon opened this issue Mar 1, 2024 · 3 comments · Fixed by #65

Comments

@jlsalmon
Copy link

jlsalmon commented Mar 1, 2024

Hi folks,

I just ran into an issue where a build which uses a custom --builds-dir argument in the config stage failed due to spaces in the path (/Volumes/My Shared Files/...) in a component I don't have control over. I'm aware that the mount point can be changed via mount_virtiofs, but it doesn't seem to be possible to achieve this at the moment inside a GitLab job.

I tried changing the mountpoint in a pre_get_sources_script block in config.toml, but unfortunately the GitLab job environment has already been created by this point, and the buildsdir (and cachedir) are already hard-coded with the default mountpoint.

Would it be possible to provide a way to customise the builds dir on the guest to support non-default mount points? Perhaps with a syntax similar to tart's own --dir option, e.g. --builds-dir=/host/builds:/guest/builds?

Perhaps this could also be unified somehow with the --guest-builds-dir option? I tried using --guest-builds-dir but it's mutually exclusive with --builds-dir.

Many thanks in advance 🙏

@edigaryev
Copy link
Contributor

I tried changing the mountpoint in a pre_get_sources_script block in config.toml, but unfortunately the GitLab job environment has already been created by this point, and the buildsdir (and cachedir) are already hard-coded with the default mountpoint.

You can work around this by creating a symbolic link:

ln -s "/Volumes/My Shared Files/buildsdir" /Users/admin/buildsdir

...and then passing the /Users/admin/buildsdir to the component I don't have control over.

@jlsalmon
Copy link
Author

jlsalmon commented Mar 4, 2024

@edigaryev many thanks for the suggestion, unfortunately that doesn't seem to be a complete workaround for what I'm currently trying to do, since the component I don't have control over uses getcwd() which does not appear to resolve symlinks and returns the real path 🙁

fkorotkov added a commit that referenced this issue Mar 6, 2024
After introducing of cirruslabs/tart#733 we can use different VirtioFS tags for different directories and precisely mount them into exact locations.

`/Volumes/My Shared Files/` default path is error-prone since some tools don't like whitespaces in paths. With this change directories will be directly mounted into `$HOME`.

Fixes #64
@fkorotkov
Copy link
Contributor

I guess we can try to change the default mount location given recent improvements to Tart. I've drafted the idea in #65. @edigaryev is on PTO until Monday and he'll take a look next week since he has more context.

edigaryev pushed a commit that referenced this issue Apr 2, 2024
* Mount directories directly into `$HOME`

After introducing of cirruslabs/tart#733 we can use different VirtioFS tags for different directories and precisely mount them into exact locations.

`/Volumes/My Shared Files/` default path is error-prone since some tools don't like whitespaces in paths. With this change directories will be directly mounted into `$HOME`.

Fixes #64

* Fixed lint issue

* Don't forget to `mkdir -p`

* Introduce `mountPoint`
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 a pull request may close this issue.

3 participants