Giter VIP home page Giter VIP logo

Comments (6)

afbjorklund avatar afbjorklund commented on August 23, 2024 1

One possible solution is that "/tmp/lima" is the placeholder, and replace it with $TMPDIR/lima.

i.e. something like filepath.Join(os.TempDir(), "lima"), so that it works also on Windows


systemd would try to use some complex scheme:

https://systemd.io/TEMPORARY_DIRECTORIES/

But it should be optional (opt-in), since it breaks things.

https://0pointer.de/blog/projects/tmp.html re: /tmp

from lima.

jandubois avatar jandubois commented on August 23, 2024 1

I'm not a fan of making /tmp/lima "magical" and replacing it with a different location at VM start. I would rather add support for templating, so you could write something like this:

- location: "{{.Temp}}/lima"
  mountPoint: /tmp/lima
  create: true
  writable: true

Where {{.Temp}} would be os.TempDir() evaluated at the start of the instance.

The create property would tell Lima to create the location if it doesn't exist. Maybe we don't need it, and we should always create non-existing locations, but having a separate setting feels safer. That way we can just drop mounts whose locations don't exist on the host. We should already be doing that, but I haven't checked.

I don't know what other template variables would make sense; we can add {{.Home}}, but it would be redundant with the special handling of ~ that already exists. Maybe {{.Cache}} and {{.Config}} for os.UserCacheDir() and os.UserConfigDir()?

We could add access to the host environment with something like {{.Env.LIMA_TEMP}}, but I would wait until we have an actual use-case.

I don't see a need for LIMA_TEMP; you can just set TMPDIR or TEMP before calling limactl and get the same effect.

from lima.

jandubois avatar jandubois commented on August 23, 2024 1

Using TMPDIR will break under macOS, with the default setup and the default mounts.

Since it is generated under /var/folders by default, but that location is not mounted...

I'm not sure what point you are trying to make. If you use it as the location for the /tmp/lima mount point, then it will be mounted for you...

Or are you saying that you can't mount paths under $TMPDIR into containers running inside an instance because the directory isn't mounted. That is true; the user would need to add that mount point themselves.

FWIW, Rancher Desktop mounts /private/var/folders into the instance for this reason.

Side note: /tmp is a symlink to /private/tmp

/var is also a symlink to /private/var...

from lima.

afbjorklund avatar afbjorklund commented on August 23, 2024

Using TMPDIR will break under macOS, with the default setup and the default mounts.

Since it is generated under /var/folders by default, but that location is not mounted...

Side note: /tmp is a symlink to /private/tmp

But /tmp/lima still works, because of symlink.

from lima.

afbjorklund avatar afbjorklund commented on August 23, 2024

It would to use something like $LIMA_TEMP.

https://lima-vm.io/docs/dev/internals/

Then you could set LIMA_TEMP=$TMPDIR/lima

i.e. similar to overriding LIMA_HOME=$HOME/.lima

from lima.

afbjorklund avatar afbjorklund commented on August 23, 2024

The mounts should be OK, it was a reflection on the TMPDIR (like that issue about it being not absolute in Windows)

Will leave /tmp/lima, and see if something can be templates instead.

from lima.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.