quickemu/quickget refactoring #925
Replies: 19 comments 38 replies
-
Come to here @flexiondotorg @philclifford @TuxVinyards @dabrown645 @lj3954 |
Beta Was this translation helpful? Give feedback.
-
The quickemu, a command-line interface (CLI) tool for managing and running VMs on GNU/Linux, has grown significantly in size and complexity. With around 3000 lines of code, maintaining and extending the tool has become challenging. This proposal outlines a strategy to refactor quickget and quickemu into a modular architecture, which will improve maintainability, extensibility, and readability of the codebase. Current State of quickemu Modular Architecture Application Management: Separate the logic for installing, updating, and removing applications into distinct modules. #!/usr/bin/env bash Module: InstallationDependencies: coreutils, wget, curl, grep, sedFunction: install_appinstall_app() { Function: update_appupdate_app() { Function: remove_appremove_app() { Main Entry Pointmain() { Execute the main functionmain "$@" Next Steps PS: Borrowed from different project (which facing same...) |
Beta Was this translation helpful? Give feedback.
-
For now work started independently on two sepparated repositories. With quickget Thanks to @lj3954 and @dabrown645 |
Beta Was this translation helpful? Give feedback.
-
Wonder if @lj3954 and @dabrown645 are using their spare time following the American Super Bowl? I am reading that a lot of things are grinding to a halt in America because of it. Or perhaps they are still working on things?
Why not. Makes good sense. I had wondered how your English had suddenly improved so much overnight 👍 |
Beta Was this translation helpful? Give feedback.
-
I am interested in creating UI modules (never done any modularization) will be studying how to make UI module.. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
So which quickget refactor we will use? Wanna see votes... |
Beta Was this translation helpful? Give feedback.
-
I don't really think any of this is going to go anywhere. Bash just does not support the features necessary for such a project, especially functions between multiple files which cannot really be used independently. Thus, I'm instead working on rewriting a version of quickget in Rust. I don't expect to ever merge it here, especially considering many people (including Martin Wimpress) do not know the language, but it should be an alternative that allows for a lot more flexibility and improved performance. It's still in very early stages, but you can check it out in my new repository. |
Beta Was this translation helpful? Give feedback.
-
Whats your current progress @dabrown645? Looks like I am left alone on this. Still wanna tweak this bash version.. |
Beta Was this translation helpful? Give feedback.
-
I am open to refactoring Quickemu to make it easier to maintain, as opposed to the monolithic scripts we currently have. I have even considered re-writing it another language. |
Beta Was this translation helpful? Give feedback.
-
👍
👎 For learning bash and how to participate in open source projects in general (And of course because I like it)PS: Liam already started with quickget rewrite in rust |
Beta Was this translation helpful? Give feedback.
-
@lj3954 Gave your rust work a whirl this morning. I have spent a couple of days sorting out rustup and looking on and off at your code, of recent. The curve is still steep. I have found things that I would like to fix and PR. But my best 'community contribution' at the present point in time is still just to flag them up. 🤷
I copied the binary to my a folder with a VM and got the following errors:
Your work all looks clean and organised . You are doing well and I am finding inspiring to look at how you have done things. And thank you for acknowledging the work that I have done and have posted up in my wiki, BTW. But at this point I gave up and posted this. 🤣 I expect that I will return back but I do find myself continually asking the question 'why?' Why do I need to keep hitting my head against the wall. We don't need fast code. Qemu and the Linux core-utils do all the lifting. We don't need to able to target Windows or anything else, do we? And what was wrong with the Bash rewrite you did? I thought that was shaping up quite well? I do worry about the learning curve and number of community contributions that just won't happen if change to rust. It's definitely a good excuse to learn a new language, though .... |
Beta Was this translation helpful? Give feedback.
-
Personally having written a lot of professional Bash at my work place, I don't think we really need to rewrite this in Rust. There are a lot of ways Bash can be wielded so that it is safe, and the fact that the codebase is written in Bash makes contributions easy. That being said, I do like the idea of a refactor having looked at the code myself. Perhaps we can take a page out of Calamares' book and make each OS its own "module" that handles everything related to that OS, and then the quickget and quickemu scripts can simply call into the modules to do the needed jobs? |
Beta Was this translation helpful? Give feedback.
-
Hi, I was a bit hesitant about bringing this up, however, today I found this discussion (I'm a bit slow) and I think some of the work I've been doing might be useful. I started working on this project when I saw the
The idea I was going for here was to make it easy to add distributions without having to modify the core functionality of quickget. I think can also carry over to quickemu by allowing us to adjust functionality inside the distribution templates as well, making it easier to concentrate on getting everything working right without having to worry about breaking other distributions. Some things work nicely with these changes, others need a bit more work, I have an embarrassing macos template that /seems/ to work and windows* distributions are currently broken and what I am working on I've had a lot of fun working on this, but completely understand if it's not your cup of tea (I've using If you are interested: https://github.com/shawndfisher/quickemu/tree/decouple Oh, I've also added a few distributions: 9front, arkane, dsl, nomadbsd and a few others... |
Beta Was this translation helpful? Give feedback.
-
My rewrite now supports monitor_cmd (without any external dependencies) as well as --kill, macOS CPU arguments based on CPU support, and (if I'm not mistaken) all of the fixes that should allow for a macOS host. Of course, it uses libraries which already support other platforms for system calls, so not much needed to be implemented there. I believe that support for Spice displays is the only thing needed to be feature-complete with the bash quickemu. |
Beta Was this translation helpful? Give feedback.
-
The work I've been doing on Quickemu and Quickget recently may appear to contradict the discussion here about re-implementation in Rust. That is not the case. I want to fill in some of the larger gaps in Quickemu using the existing code, so we have a broader reference implementation to work from. |
Beta Was this translation helpful? Give feedback.
-
Screencast_20240527_223159.webmHere's the first example of a configuration generated by the new quickget_ci project. |
Beta Was this translation helpful? Give feedback.
-
Seemingly daily progress report on the quickget configuration generator: Any entry with any field containing a URL which cannot be resolved will be discarded. The user will never have to deal with quickget resolving to nonexistent URLs. Nearly all the code is asynchronous now as well, which probably isn't too important given that it's planned to run it in CI, but I still enjoy the pointless optimizations. On my connection, FreeBSD, which makes 2 sequential requests first, takes <400ms to create and validate all entries. Of course, information will be fetched for all distros simultaneously. |
Beta Was this translation helpful? Give feedback.
-
I am back home after a two-week trip to the USA. Thanks for the updates. Excellent progress and the idea of building configuration in CI is solid. |
Beta Was this translation helpful? Give feedback.
-
There is a lot of good discussion here, but I am going to close this discussion and ask that we have a more focused discussion about the future direction of the project here: |
Beta Was this translation helpful? Give feedback.
-
Discussed in issue here
Anyone who have anything to say to topic come here...
Beta Was this translation helpful? Give feedback.
All reactions