https://pulumi.com logo
#contribute
Title
# contribute
n

numerous-piano-36614

06/01/2021, 7:51 PM
Hello. Me and my team are trying to contribute to Pulumi by adding JVM support. I have question - how the language specific classes are being generated in 
sdk/
  folder? I wrote minimal Java code generator (
gen.go
) which generates 
Config.java
 file. Also, I discovered that 
GeneratePackage()
 function is executed only in tests and I guess this is “main entrypoint” for generating files, right? But I found out that code is being generated inside the internal testdata folder. Could you give us some information, how Pulumi team generates language files in 
sdk/
 folder?
b

billowy-army-68599

06/01/2021, 8:01 PM
cc @white-balloon-205
w

white-balloon-205

06/01/2021, 8:08 PM
Awesome! As I'm sure you are already aware - JVM support for Pulumi is a highly-upvoted request from many members of the broader Pulumi community: https://github.com/pulumi/pulumi/issues/1539. The steps required to bring up support for a new language in Pulumi are outlined at https://github.com/pulumi/pulumi/wiki/New-Language-Bring-Up. The core Pulumi SDK (bullet 2 in the list above) is hand written for each language. All other SDKs (for packages) are auto-generated using the generators in https://github.com/pulumi/pulumi/tree/master/pkg/codegen. The
GeneratePackage
functions for each language are called from the various package generators - including: • https://github.com/pulumi/pulumi-terraform-bridge/blob/30ae8ae5cc2d2f5987854984243c74ace4ccc952/pkg/tfgen/generate.go (for all Terraform Bridged providers) • https://github.com/pulumi/pulumi-azure-native/blob/master/provider/cmd/pulumi-gen-azure-native/main.go (for the Azure Native Provider) • Etc.
👍 1
n

numerous-piano-36614

06/01/2021, 8:23 PM
Thank you for very much info! That's all we need right now to continue work 🙂. We'll notify you if we'll have something to show 🙂
b

brave-dawn-64711

06/02/2021, 10:00 AM
thank you @white-balloon-205, just to clarify: • content of this directory was hand written or auto generated? https://github.com/pulumi/pulumi/tree/master/sdk/dotnet • if not generated, then what config is generated here if note the one in core: https://github.com/VirtusLab/pulumi/blob/master/pkg/codegen/dotnet/gen.go#L1431 wouldn't want to write a ton of Java by hand just to realize it should be generated ;) also, we've started some basic scaffolding and gRPC generator, here: https://github.com/VirtusLab/pulumi/tree/jvm-lang please advice when is a good time to do a WIP PR :)
b

bored-oyster-3147

06/02/2021, 11:47 AM
@brave-dawn-64711 the Core SDKs that are in the first repo you linked are hand written. I believe the SDKs that are auto generated are the ones for the providers. Such as: https://github.com/pulumi/pulumi-aws/tree/master/sdk
👍 1
Note the Config generation you linked is defining a static Config class in the new namespace but is then defining a static readonly Pulumi.Config property, thus assuming that Pulumi.Config is already defined elsewhere.
👍 1
b

brave-dawn-64711

06/02/2021, 1:26 PM
thanks, all clear 🙂
when should we start thinking about a PR? (what kind of maturity metric/lvl)
b

billowy-army-68599

06/02/2021, 3:22 PM
@brave-dawn-64711 i think the best time for a PR is when there's a working prototype with some tests @bored-oyster-3147 did a great job with the C# Automation API implementation: https://github.com/pulumi/pulumi/pull/5761
partypus 8bit 1
👍 2
w

worried-city-86458

06/11/2021, 1:34 AM
It would be good to capture this discussion in https://github.com/pulumi/pulumi/discussions ...
w

white-balloon-205

06/11/2021, 1:47 AM
Related to @worried-city-86458’s suggestion - @numerous-piano-36614 @brave-dawn-64711 definitely interested to hear if you've made any more progress here. If you'd like to find time for a quick call to discuss plans here - happy to find some time.
👍 1
b

brave-dawn-64711

06/18/2021, 9:01 AM
sorry for late response, I was on a small vacation
there is a slow but steady progress to figure out what the c# implementation is doing and how to express it in Java
with an occasional look at other implemeentations
not sure if this is too early for a call, since the implementation does not even compile since it is very incomplete right now
btw. a Slack Connect channel for jvm related discussions, could be an idea, wdyt?
@white-balloon-205 progress report: https://github.com/VirtusLab/pulumi/commits/jvm-lang
Copy code
- 1-to-1-ish port of C# SDK implementation to Java
- mostly complete implementation - Automation API is missing
- it compiles, unit tests run

Current Limitations:
- changes in usage and implementation due to lack of generic types reification in Java
- lack of AsyncLocal
- lack of AsyncIterator
There are a lot of TODOs, also needs rebasing, but there is already a lot of code written and it took a lot longer than I anticipated, so just to be sure no one is duplicating this effort 🙂 Next we'll finish an initial implementation for the code generation and try to generate some providers.
😍 4
b

broad-dog-22463

08/16/2021, 2:56 PM
This is fantastic @brave-dawn-64711 - thank you for this! Can we get you set up for a call with the team to discuss this?
b

bored-oyster-3147

08/16/2021, 3:48 PM
Hey! You guys might want to include @limited-rainbow-51650 I know he was working on or planning on working on a barebones Automation API implementation in Java. So that might be your missing piece
To be clear he was going to do Automation API without inline program support (without the core SDK) so he would have minimal to no overlap with your work, but might be worth seeing if there are touchpoints
👍 1
b

brave-dawn-64711

08/17/2021, 7:04 AM
@broad-dog-22463 that would be great, we just need to figure out a date, I'm guessing your morning and my evening should work (I'm in UTC +2)
b

broad-dog-22463

08/17/2021, 11:23 AM
Hi @brave-dawn-64711 I personally am working in your timezone for the next 3 weeks but I will need to get someone else in the Pulumi team to come along!
👍 1
w

white-balloon-205

08/17/2021, 3:34 PM
This is great to see @brave-dawn-64711! I'd love to join as well if we can find a time that works. Perhaps 3PM UTC sometime later this week? Cc also @tall-librarian-49374 who did a lot of work on the .NET SDK and may be interested in joining as well.
👍 1
t

tall-librarian-49374

08/17/2021, 3:38 PM
I’m in UTC+2 too
b

brave-dawn-64711

08/17/2021, 4:06 PM
works for me
@white-balloon-205 I'm back from holidays, so maybe we could try again with the meeting? :)
w

white-balloon-205

10/08/2021, 3:32 AM
Yes - let's do it! Any time next week 8am PT work for you? I expect we can pull together the interested folks. Perhaps the 13th?
l

limited-rainbow-51650

10/08/2021, 6:12 AM
@white-balloon-205 as a community member, I'm interested in a Java version of the Automation API at least. Interested in joining this meeting and I'm able to join at 8AM PT/17h CET on Tuesday. But if doesn't work for others, no problem. I'll follow up via GH issues then. 😉
b

brave-dawn-64711

10/08/2021, 8:08 AM
@white-balloon-205 this contribution is my priority right now so I'll make myself available when needed (within reason ofc, and apart from any emergencies); 13th works for me, I'm not superstitious 😉 8 PT / 17 CEST also works fine
w

white-balloon-205

10/09/2021, 12:59 AM
Great! I've got a Zoom scheduled to talk about this workstream for Oct 13th at 8AM PDT at https://pulumi.zoom.us/j/82164570601?pwd=NW1QSXhLaVM1M2lkT2Z4RnJsQW8yZz09. @brave-dawn-64711 and @numerous-piano-36614 if you DM me your email addresses I'll add you to the invite directly.
1
b

brave-dawn-64711

10/28/2021, 12:39 PM
@white-balloon-205 Hand-written Kubernetes provider API for Java prototype, as requested: https://gist.github.com/pawelprazak/61dc14021206aeaee2eb323b1996fba0
🔥 5
lack of reified types required some kind of solution, and those annotations are the cleanest thing I came up with without implementing my own reification
it works with an actual kubernetes 🙂
🎉 1
b

broad-dog-22463

10/28/2021, 1:48 PM
nice work @brave-dawn-64711 🙂
👍 1