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

Consolidate minimum resource errors #2925

Closed
sed-i opened this issue Feb 15, 2023 · 3 comments · May be fixed by #2950
Closed

Consolidate minimum resource errors #2925

sed-i opened this issue Feb 15, 2023 · 3 comments · May be fixed by #2950
Assignees

Comments

@sed-i
Copy link

sed-i commented Feb 15, 2023

What are you trying to do?
Launch an instance with resources less than the blueprint minimum. Got 3 error messages before I was able to launch.

What's your proposed solution?
Print out all the "requires" resources that are lower than the "limit". For example:

$ multipass launch docker --name load-test --cpus 1 --memory 2G --disk 10GiB --mount /Users/me/code:/home/ubuntu/code
launch failed:
- Requested Number of CPUs is less than Blueprint minimum of 2
- Requested Memory size is less than Blueprint minimum of 4G
- Requested Disk space is less than Blueprint minimum of 40G

Additional context
Currently it's one resource error message at a time:

$ multipass launch docker --name load-test --cpus 1 --memory 2G --disk 10GiB --mount /Users/me/code:/home/ubuntu/code
launch failed: Requested Number of CPUs is less than Blueprint minimum of 2 

$ multipass launch docker --name load-test --cpus 2 --memory 2G --disk 10GiB --mount /Users/me/code:/home/ubuntu/code
launch failed: Requested Memory size is less than Blueprint minimum of 4G

$ multipass launch docker --name load-test --cpus 2 --memory 4G --disk 10GiB --mount /Users/me/code:/home/ubuntu/code
launch failed: Requested Disk space is less than Blueprint minimum of 40G
@ricab
Copy link
Collaborator

ricab commented Feb 16, 2023

Hi @sed-i, thank you for the suggestion. This is a really interesting problem. In general, returning all the errors with a command is a really difficult thing to do: recognising some errors requires an "understanding" of underlying constructs, but that is only possible if there were no earlier errors when parsing/interpreting/assembling those constructs. That's also why compilers only report certain errors after earlier phases passed.

A practical example: in multipass launch -cpus 0, it would be very hard to say that 0 is below the minimum number of cpus, because 0 is actually being passed as the free <image> argument. Because of the single dash, the value specified for the number of CPUs is actually pus.

OK, but perhaps we could make a best effort to report as many errors as we can with the info we got? We could try, but that would still require a lot of work if we were to do it on a generic basis (diverting attention from other possible enhancements). Moreover, how far should we go? In the example above, should we contact the daemon to let it contact remotes to see if we can launch with image 0, when we already know we'll never be able to launch with pus cores?

So you see, I would rather bail as soon as we can. It certainly simplifies things a lot. However, having discussed with @townsend2010, I do recognise that wasn't the best user experience you had there. But I guess the main reason is that it is difficult to know what those minima are. A compromise in this particular case would be to print all of them when any value is found to be below the minimum (but without pointing out remaining errors). Something like:

$ multipass launch docker --name load-test --cpus 1 --memory 2G --disk 10GiB --mount /Users/me/code:/home/ubuntu/code
launch failed:
Requested Number of CPUs is less than Blueprint minimum. 
The docker blueprint requires at least 2 CPUs, 4GiB of memory, and 40GiB of disk space.

How does that sound? Do you think that would have been helpful?

@sed-i
Copy link
Author

sed-i commented Feb 16, 2023

Thanks @ricab. I think your proposal fully addresses the enhancement proposal.

@townsend2010
Copy link
Collaborator

We are going to change how blueprints handle this. Instead of being a hard fast minimum, it will instead be a default that can be overridden by the user at launch. If the user passes in resources that are less than the default, then we''ll coalesce any warnings that the user chose something under the minimum. See #3248.

@townsend2010 townsend2010 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@townsend2010 townsend2010 removed this from the 1.13.0 milestone Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants