Skip to content

Rename config files and machine files #2436

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

Closed
moenodedev opened this issue Jun 20, 2024 · 5 comments
Closed

Rename config files and machine files #2436

moenodedev opened this issue Jun 20, 2024 · 5 comments

Comments

@moenodedev
Copy link

Description

No response

@moenodedev
Copy link
Author

moenodedev commented Jun 20, 2024

Many of the files and directories have confusing filenames

The ssh key filename is user

For Alpine basedisk is really iso and diffdisk is disk.

There configuration directory is _config

Logs, sockets, kernel files and configuration are in one directory

@moenodedev
Copy link
Author

moenodedev commented Jun 20, 2024

Small improvements would make it easier for users to configure lima or clean up files

~/.lima/config/networks.yaml

~/.lima/ssh/id_ed25519
~/.lima/ssh/id_ed25519.pub

~/.lima/machines/$name/lima.yaml
~/.lima/machines/$name/cache
~/.lima/machines/$name/logs
~/.lima/machines/$name/sockets
~/.lima/machines/$name/storage

@jandubois
Copy link
Member

Many of the existing names have been chosen because stuff has been squeezed in without breaking backwards compatibility. E.g. we picked _config because it is not a valid instance name.

Moving instances into a subdirectory is obviously better, but it also means that we need to provide migrations for users that update from a previous version of Lima.

And it also means that users couldn't move back to an older version in case they run into an issue with the new Lima version, because we couldn't provide a reverse-migration (the old Lima version wouldn't know about the new layout).

I think it might be a good idea to sanitize the filesystem layout for Lima 1.0.0, but it needs some careful consideration of upgrade scenarios, and usage by downstream projects, like colima, finch, and Rancher Desktop, as well as other scripts that users might have.

BTW, I don't understand what the issue is with having user and user.pub files for the keys, especially if we move them to an ssh subdirectory.

@jandubois
Copy link
Member

~/.lima/machines/$name/cache

I don't know what would be in here. The Lima caches should be shared by all instances.

~/.lima/machines/$name/sockets

This is potentially problematic, as the path is really $LIME_HOME/machines/$name/sockets/…, with ~/.lima just being the default for $LIMA_HOME.

On macOS a socket filename must be no more than 103 characters, so this gratuitously takes an additional 17 characters from a very limited resource, severely limiting where you can put $LIMA_HOME (to my surprise, there are lots of users where $USER is more than 30 characters).

~/.lima/machines/$name/storage

What would be in here? Just the basedisk and diffdisk? I'm not convinced that adding an extra subdirectory for just 2 files makes sense.

For me putting the logs into a separate directory would be the most useful, so I can easily grep just them and none of the other files.

@moenodedev
Copy link
Author

Thanks for the explanation :)

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

No branches or pull requests

2 participants