Skip to content

Conversation

@f-trycua
Copy link
Collaborator

@f-trycua f-trycua commented Apr 5, 2025

This PR improves lume with support for multiple VM locations and configurable cache settings, improving flexibility and resource management.

Multiple VM Locations

  • Added ability to create and manage VMs in different storage locations
  • Introduced commands for VM location management:
    • lume config location add <name> <path> - Add a new location
    • lume config location remove <name> - Remove a location
    • lume config location list - List all locations
    • lume config location default <name> - Set default location
  • Added --location parameter to key commands:
    • lume create - Create VMs in specific locations
    • lume pull - Pull images to specific locations
    • lume run - Run VMs from specific locations

Configurable Cache Directory

  • Added ability to set custom cache location for VM images
  • Introduced cache configuration commands:
    • lume config cache get - Show current cache directory
    • lume config cache set <path> - Set new cache directory
  • Removed --no-cache parameter in favor of configurable cache location

XDG Base Directory Compliance

  • Moved configuration to ~/.config/lume/config.json following XDG spec
  • Implemented automatic migration from legacy settings

Technical Improvements

  • Enhanced VM management to track and respect location context
  • Improved error handling for location-specific operations
  • Added detailed logging for VM location operations
  • Simplified caching behavior through centralized configuration

Migration

Existing VMs will continue to work as before, with automatic migration of settings to the new configuration format.

@f-trycua
Copy link
Collaborator Author

f-trycua commented Apr 5, 2025

@pepicrft @aktech I'd like your thoughts here.

@f-trycua
Copy link
Collaborator Author

f-trycua commented Apr 5, 2025

Address issue #14

@f-trycua f-trycua changed the title Ass multiple VM locations and configurable cache Add multiple VM locations and configurable cache Apr 5, 2025
@f-trycua f-trycua changed the title Add multiple VM locations and configurable cache [Lume] Add multiple VM locations and configurable cache Apr 5, 2025
@pepicrft
Copy link
Contributor

pepicrft commented Apr 7, 2025

@f-trycua, how do other container solutions deal with the same problem? What I found to be shared in other CLIs is the use of configuration options, which can be configured via arguments, environment variables, and configuration files.

Out of curiosity, how are VMs structured in terms of files? I'd try to understand better the motivation behind the configuration so you can propose the best solution. Otherwise, you might end up introducing a new concept, "locations," and expand the interface of the CLI, potentially adding complexity with not much value back.

@f-trycua
Copy link
Collaborator Author

f-trycua commented Apr 9, 2025

Fair questions - I haven't found much. Simply, solutions in this space don't seem to offer this level of flexibility. With lume we are dealing with macos images >40GB. Therefore specifying multiple locations would at least give the ability to store the images in a separated SSD store.

lume config 
Default VM location: default (~/.lume)
Cache directory: ~/.lume/cache

Configured VM locations:
  - default: ~/.lume (default)

@Else00 - also since you proposed the original issue #14 is this what you intended?

@f-trycua
Copy link
Collaborator Author

f-trycua commented Apr 9, 2025

Another thought if we want to align with other tools like Docker or Podman, is to consider supporting config overrides via environment variables (e.g., LUME_CACHE_DIR, LUME_VM_LOCATION).

Also renaming location -> paths

@pepicrft
Copy link
Contributor

Another thought if we want to align with other tools like Docker or Podman, is to consider supporting config overrides via environment variables (e.g., LUME_CACHE_DIR, LUME_VM_LOCATION).

Yeah, I think this is a good idea. Every flag or argument should be passable through environment variables too:

lume .. --foo bar
FOO=BAR lume ...

This might be useful

@f-trycua f-trycua merged commit bcfff60 into main Apr 14, 2025
1 of 2 checks passed
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.

2 participants