https://pulumi.com logo
#general
Title
# general
m

mysterious-hamburger-19066

06/02/2022, 10:23 PM
Hello. I”m looking for some guidelines here. I’m using Pulumi to set up VMs for running my experiments. I have multiple VMs running in parallel, and I could call the pulumi run command multiple times from different VMs to run multiple experiments in parallel, or on the same vm, run multiple experiments in parallel, by calling pulumi up while the stack created some resources for another experiment that is still running. If I try to reuse the same stack across experiments, the stack either updates an existing set of resources it created, or it destroys any existing resources it previously created for another experiment that is still running. So, for each experiment, I’m creating a new stack and then deleting the stack at the end of the experiment. Is this the right way to do this? Is there a better way to do it?
l

little-cartoon-10569

06/02/2022, 10:25 PM
Pulumi isn't the right tool to run stuff in your VMs. Pulumi is for creating the VMs, configuring their boot instructions, and things like that.
m

mysterious-hamburger-19066

06/02/2022, 10:46 PM
Oh. I’m not running anything using Pulumi. I’m using another library meant to run remote commands for that. I’m more specifically talking about the stack part. Should I create a new stack for each experiment or is there a way I can call pulumi up twice and not have the stack destroy the previous resources?
l

little-cartoon-10569

06/02/2022, 10:48 PM
Ah right. That's the right way to do it using "vanilla" Pulumi. You can get much fancier than that with automation-api.
You can, for example, dynamically create stacks and choose at run time whether to refresh/re-up an existing stack, or create a new stack.
m

mysterious-hamburger-19066

06/02/2022, 10:50 PM
Ah. Okay. That answers my question. Thank you very much! 🙂
l

little-cartoon-10569

06/02/2022, 10:50 PM
You could also use a single stack and dynamically add resources to it (in loops / conditionals), but the automation-api solution is better.
m

mysterious-hamburger-19066

06/02/2022, 10:50 PM
Yes. The automation-api is what I’m using right now.
l

little-cartoon-10569

06/02/2022, 10:51 PM
Once you wrap it in a handy self-serve web page, and associate an experiment name with a stack, then you'll stop worrying about stacks and learn to love the bomb automation.
❤️ 1
m

mysterious-hamburger-19066

06/02/2022, 10:52 PM
I’m already loving it. 🙂
ham dance 1
2 Views