quick question - is there a way for me to consume ...
# golang
a
quick question - is there a way for me to consume pulumi as a library in, for example, a CLI of my own? and if so, is there any example of doing so? I’ve been playing with the automation api, but it seems to require the pulumi CLI to be installed which I’m less interested in.
b
as it stands, the automation API does require the Pulumi CLI to be installed yes, we don't envisage that changing in the near term
you could in theory talk directly to the engine, but that hasn't been implemented yet
a
okay good to know. how much pain and suffering am I in for if I wanted to try talking directly to the engine?
b
....I wouldn't want to do it myself.
what's the reason behind not wanting the CLI installed?
a
I’m looking to build a CLI of my own, of which infrastructure creation is only a small part. the only place pulumi would come into play is for our end users to bootstrap their infra in AWS or GCP and then create a few VMs that run an initial kubernetes cluster. after that, they’d be using other functions of our CLI to interact with that cluster as their management plane for creating subsequent clusters via cluster api. which is a big way of just saying “I don’t want to have to ask users to install yet another CLI if I don’t have to”
but also just seems like a good way to have some support heartache because of different pulumi CLI versions installed and whatnot
b
that's understandable, i think you'll have less fun using the engine directly I'm afraid, you'd have to reimplement the whole thing as a package 😞
a
while I’ve got you, maybe I can ask you a question that brought me down this path. I’ve been messing with the automation API as I said, but when coupling it with some of our libraries, I’ve run into the following error
Copy code
failed to run update: exit status 255\ncode: 255\nstdout: Updating (spencer-test):\n \n\nstderr: error: failed to discover plugin requirements: grpc: error unmarshalling request: failed to unmarshal *pulumirpc.GetRequiredPluginsRequest\n\n
any ideas on what’s actually going on under the hood that causes this to fail? I feel like it’s some mismatch between the grpc go mods between our other pkgs and pulumi, but I haven’t been able to reproduce it even with a
replace
to force the grpc version
b
hrm, without seeing the code i wouldn't be totally sure.
a
yeah, that’s fair. I’ll keep trying to reproduce with something more minimal than my current code base. was just wondering if you’ve come across that error before. google only showed some python related issues for a while ago
b
you're using Go? did you do
workspace.InstallPlugins
a
indeed 😞
not sure why it’s falling over tbh. will keep digging