Hey! I'm creating a wrapper of Pulumi for another ...
# general
s
Hey! I'm creating a wrapper of Pulumi for another language, is there any documentation regarding that? I ask that because I am looking for something similar to a spec or which services should be implemented when creating a new lib.
s
Hi @stale-twilight-36329! I'll ask the team 🙂 can I ask what language you're looking to use?
s
Hi @steep-plastic-74107! I am currently using Ruby.
🙌 1
s
Sweet, that's good context to have! I'll let you know what the team says 🙂
❤️ 1
s
I'm looking forward. Thanks 😉
s
They said this is the best doc right now: pulumi-developer-docs.readthedocs.io/latest/docs/architecture/languages.html. But let us know if you have any questions going through!
❤️ 1
s
Thanks a lot, Elisabeth. Should I keep using this channel or is there a more suitable one for this kind of topic?
s
This is a good one to use! You can @ me or whoever the community helper is too 🙂
❤️ 1
e
If you look at the other language they run "conformance tests" (github.com/pulumi/pulumi/blob/…/language_test.go) those are currently the best way to get coverage that your implementation is correct
👀 1
s
Is using localstack or floci to validate behavior a common practice? I ask that because hitting aws everytime using a personal account might be a problem...
e
conformance tests use entirely local and in-memory providers, no calling out to aws or anything similar
1
s
Ok, I was reading the docs, and just wanted to confirn: I have to write the conformance tests in Ruby since I am creating a runtime for Ruby. Is there a way to validate my conformance tests against tests written using other languages?
I just noticed I have to write the conformance tests in go...
e
The conformance test runner needs to be written in Go, but your language runtime doesn't have to be in Go as well. You just need to be able to start up a language runtime server and point the conformance test framework at it. For us thats normally a Go grpc server running in the same process, but it doesn't have to be.
And the conformance tests don't compare across languages, they're a set of assertions written against the language runtime protocol
👍 1
The ideal is all the ruby test programs are generated via GenerateProject calls, but you can also write them by hand and use the override system.
A lot of our Go tests use overrides because Go codegen has been more challenging that typescript or python for us
s
Ok, that's an interesting context. So the idea of the conformance tests, is hitting the protocol through the language runtime, am I correct?
I ask that, because since the conformance tests don't compare across languages, I may need to pay more attention to any implementation details in Ruby.
An example: since the grpc implementation in Ruby is blocking, I had to workaround that by using threads in order to have the same experience of creating resources asynchronously like the Node implementation.
e
is hitting the protocol through the language runtime, am I correct?
yup
An example: since the grpc implementation in Ruby is blocking, I had to workaround that by using threads in order to have the same experience of creating resources asynchronously like the Node implementation
Yeh they're blocking in Go as well, which is why we always spin up new goroutines for registering resources
s
Cool, seems I'm on the right track
Ok, I'll add the conformance tests to my roadmap. Another question: I found some time ago a repository containing multiple example scripts. Is it safe to just use them as a reference, to write a set of the same examples, but for Ruby? I ask that because I implemented classes and interfaces for some common services like AWS S3 or EC2, but I'm not sure if there is a list or something similar that I can use as a checklist.
e
If you mean github.com/pulumi/examples, then yeh we'd normally try to have most examples in there for each language
1
s
@stale-twilight-36329 #CB81H6DG9 is specifically for this type of question, but it's not a big deal to post in #C84L4E3N1 about it either.
❤️ 1