-
Notifications
You must be signed in to change notification settings - Fork 33
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
Is it possible to start multiple instances of VMs at the same time? #3
Comments
Hi @antranapp, that's definitely something we're considering to implement, however I can't give a clear timeline. In theory it should be possible to run up to 2 VMs in parallel. While I haven't tried it myself I've heard from several people that 2 VMs is a limitation of the Virtualization framework. |
While it may not be intentional, this works already by starting a second instance of Cilicon. It would be awesome if a single instance were able to manage multiple vms with different configurations to support building on different macos versions. |
It's not a limitation of the framework or the hardware, but rather the legal agreement. You can find it here and the important part is under 2.b.iii: "to run up to two (2) additional copies or instances of the Apple You will get a VZErrorDomain error 6 if you try to add 3 or more which tells you it's not allowed. This is a very old part of the agreement though, so hopefully if enough people ask Apple to amend it they may open it up on Apple Silicon to allow more since clearly with how powerful the new chips are it can definitely support it. With that said, I'm adding +1 to the ticket as I'd love to see support for two added for the reason above of wanting to support multiple CI test jobs in parallel without having them impact one another. |
Any updates? |
This would be very interesting for us. What's needed in terms of implementation to support this feature? |
Fyi opening Cilicon multiple times (using |
Hiya @ast3150 and @Marcocanc , I am running Cilicon right now with two VMs and it seems to be working very well (Cilicon is great full-stop, thank you @Marcocanc for publishing and supporting this project – it really hits the right balance for me between believably ephemeral instances and low-fussiness systems complexity, given a moderate need). I am doing multiple VMs via a pretty easy workaround, but it is my hope to find some discretionary time so I can submit a real PR for this feature (and possibly a couple of other itch-scratches I'm doing locally). For now I will just document the workaround, which is having two running app instances of Cilicon where the second one looks for a config entitled
That's actually it, then you can launch both apps and at least for me, they are both getting network and can both launch different correctly-configured VMs that appear to work correctly so far. |
I'm guessing that the design of this inside a single app could be something as low-key as "if a cilicon2.yml exists, open a second window, do all the stuff" and you could probably leave it to the enduser to deal with the problem of providing a good cilicon2.yml, at least to start. |
Hi Halle, I will start working on a (much-needed) refactor of Cilicon with a much cleaner architecture and support for multiple VMs soon. Let me know if you'd like to contribute and we can try find a way to collaborate on it. |
I'd enjoy that! |
BTW, there is one other change needed in code to support this currently in the form I described above. If you follow my instructions above, you will eventually encounter this issue where a complete run leads to a permanent shutdown of one or the other instance. I believe the reason for this is that in the current logic, there is a brief period in which there would be three instances of virtualized macOS, which isn't allowed. I changed this in
to first check for whether there is a VM in the |
Hi dear Colleagues, I really like CIlicon so I wanted to share my current state of running multiple instances: I was also able to run multiple instances of Cilicon. open /Applications/Cilicon.app -n --args -config-path /Users//cilicon.yml Running this will start two Cilicon instances using the provided configs:
|
Hi @FabianBartels , Thanks for sharing and this is an interesting approach. Have you encounter the issue described by @Halle above, at some point Cilicon trying to have 3 VMs started, which is not allowed? Cilicon instance 1 -> running 1 VM and waiting for workflows to be picked up If yes, what was the fix for that issue? |
HI @ccorneliu, i checked the fork of @Halle and the only thing that was missing compared to the current main branch of the official Cilicon was a sleep. So far what works for me is:
I ran multiple tests and all of them worked without any issues. See sleep in this excerpt:
Full method:
In addition to that (not related to the issue you asked for) is a change of the GitHub Provisioner:
|
Here's the branch: https://github.com/traderepublic/Cilicon/tree/cilicon-3.0 |
Edit: Was able to resolve this by adding a Looks very promising! |
@ElectricCookie The configuration validation definitely still needs a bit of work. Unfortunately multi-runner Cilicon is very low priority for us at the moment, as we don't need it internally. |
@Marcocanc would you be open to a PR implementing apple’s https://pkl-lang.org/ as config file? Since v3 will have a breaking change anyway, this might be a good moment to switch to a typed and validated config file 😄 |
I'd be open for. We could also try to make it yml compatible (fallback to yml if no pkl is found). The generated code conforms to Decodable anyway. When deploying Cilicon + pkl config, would we have to ship the schema along with it, or is that only required if you want the editor to warn you about a bad config? |
I think you would amend the template file which you can import via a URL (https://pkl-lang.org/main/current/language-reference/index.html#module-uris). I'm unsure whether you could simply point the the raw.github url of the file in the repo - which would have the benefit of being versioned. I'll have a look at this once I get around to tinkering :) |
The preview of Cilicon 3.0 is great! Took me ~10 minutes to setup and get running, and it's working really well. Thanks for putting the effort into making multiple VMs work 🌻 |
We have a bunch of Mac Studios for CI in our office at this moment but we can use it only for run a single job at a time right now due to flaky Xcode with parallel executions.
Can Cilicon start multiple VMs at the same time, which run independent from each others? This'd help us to ultilise the Mac Studios' resources better by parallelising multiple jobs in multiple VMS
The text was updated successfully, but these errors were encountered: