How can there be a pulumi github action <https://g...
# getting-started
c
How can there be a pulumi github action https://github.com/pulumi/actions ... shouldn't the code be different for every deployment? I am somehow missing the big picture
b
the action runs
pulumi up
against the code you've checked into your repo
c
I thought the idea is that I am using the pulumi sdk to write code that then will execute the infrastructure changes. that's how I understand it from here https://www.pulumi.com/docs/intro/concepts/
It's calling
pulumi.Run
why is
pulumi up
even needed?
pulumi up
and
pulumi destroy
read very terraform'ish
g
The Pulumi SDK provides the tools to write code to make infrastructure changes, however, you still need something to orchestrate the execution of those changes. The CLI provides the functionality to invoke the various C(R)UD operations (
up
preview
destroy
etc)
b
☝️
c
how do the two interact then?
b
@careful-television-82602 can you elaborate on the question? how do which two interact?
c
Well, let's say I build a golang binary that uses the sdk to define the infrastructure - I thought the runtime to make the changes happen would be baked into the executable. But now instead it seems like I need to call another binary
pulumi up
to make these changes happen - while my infrastructure definition code is in another binary. So how does
pulumi up
execute the code that I am writing?
or am I writing some kind of plugin that
pulumi
loads?
b
You have the choice. The traditional way which some users prefer is to execute via Pulumi up However you can also build your own interface using automation api
The decision on how is up you
c
OK, it seems like I am after the automation api then 🙂
But I am still curious - how does it work with
pulumi up
?
you would still have two binaries, no?
b
automation API still needs you to have the
pulumi
binary locally on your machine yes
c
even with automation api? urgh.
OK, then it's even more important to understand how the two binaries interact.
right now I don't see that much of a benefit/difference over using terraform.
b
Well, we think there’s lots of benefits 😄 I’d recommend giving it a try
c
terraform applies the what's defined via dsl. pulumi applies what's defined via code (but I still don't understand how it uses the code)
Well, I am trying to get started 🙂
"After writing your program, you run the Pulumi CLI command 
pulumi up
 from within your project directory. This command creates an isolated and configurable instance of your program, known as a stack."
This is leaving me with more questions than answers.
Does pulumi do the compilation? does it just an interpreter?
And what is "isolated and configurable instance of your program" supposed to mean?
The go code has a main
Copy code
func main() {
  pulumi.Run(func(ctx *pulumi.Context) error {
  }
}
What's the
pulumi up
for?
will it run that main function?
b
Did you work through our getting started guide? https://www.pulumi.com/docs/get-started/
Excuse my brevity, I’m replying from my phone
c
nw ... yes, that's where I am quoting from
I've also have the quickstart example setup
b
In the context of Go, when you run pulumi up, it compiles a go binary and executes it within the context of the pulumi engine
👍 1
c
leaving me with question marks
b
c
that info "executes it within the context of the pulumi engine" is what I was looking for
b
If you take a look at the diagram in the how pulumi works diagram, it has an index.js - replace that with your go binary
Now if you don’t want to use the cli, you can add a wrapping layer around the cli and engine box with your own custom logic, that’s automation . Api
I’m going to update the diagram I think to show that as an option
Does that help? If not, happy to jump on a call next week some time
c
well, ideally I would have a single binary with the engine linked - not calling some external binaries
well, if you open to that - would love to have a quick chat
that might be much quicker than to write here - especially via text on the phone 🙂
to get in touch: https://torstencurdt.com/
The "Language Hosts" section is enlightening
So the answer of "how do the two interact then?" is that they talk via gRPC
b
Yes via grpc
We don’t currently have an option to talk directly to the language host
c
interesting design decision ... curious on why RPC was chosen and not direct linking
b
I don’t have insight into that I’m afraid
My understand is that it’s becauce grpc works across all language hosts
c
I've yet to come across a language that doesn't allow for linking 🙂 but I assume there are reasons ... be it just not having to use e.g. CGO for golang
It does make a bit odd for non-interactive embedding IMO.
Let's say I have service that controls the infrastructure. That's is a process that calls the
pulumi
process, that calls the binary with the infrastructure code.