Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala Language Plugin for Pulumi should support all the executors that Java Language Plugin does #303

Closed
dubinsky opened this issue Nov 16, 2023 · 14 comments · Fixed by #354
Assignees
Labels
area/docs The documentation and website area/language-host Runtime that executes user programs awaiting-release Fix was merged but not released kind/improvement An improvement with existing workaround kind/question Questions about existing features resolution/fixed This issue was fixed
Milestone

Comments

@dubinsky
Copy link

Getting started creates an impression that Scala CLI and Scala Language Plugin are required to use Besom. In fact, if the project uses one of the execution methods supported by the Pulumi Java Language Plugin (Gradle, Maven, JAR, JBang or SBT), Besom SDK can be used with runtime: java in Pulumi.yaml, just as Pulumi Java SDK can be used from Scala code that way. Indeed, if the project uses Gradle, Maven or JBang, Scala Language Plugin must not be used: while retaining support for JAR and SBT execution, it drops support for Gradle etc. in favour of Scala CLI. Scala Language Plugin seems to be required only if the project uses Scala CLI, and although this setup is recommended, I think the ability to use Besom with - say - Gradle should be at least mentioned ;)

@lbialy
Copy link
Collaborator

lbialy commented Nov 16, 2023 via email

@dubinsky
Copy link
Author

@lbialy one way to remove some friction is to copy from the Java language plugin to the Scala one not just the JAR and SBT executors but all of them (Gradle, Maven and JBang too); this way, by switching from the Java runtime to the Scala one one would gain the ability to use Scala CLI - but would not lose the ability to use - say - Gradle...

@dubinsky
Copy link
Author

I am not sure what the Scala language plugin does, but I suspect that it provides more than just the executors. I can easily see how Besom might require the use of the Scala language plugin, and I am more than willing to switch to runtime: scala - as long as I do not lose the ability to use the build tool of my choosing that I can use now with runtime: java.

@dubinsky dubinsky changed the title Scala CLI and Scala Language Plugin for Pulumi are not required to use Besom Scala Language Plugin for Pulumi should support all the executors that Java Language Plugin does Nov 16, 2023
@lbialy
Copy link
Collaborator

lbialy commented Nov 17, 2023 via email

@dubinsky
Copy link
Author

plan for language plugin is to support way more
features

Cool!

we could backport gradle etc very easily

From what I see, JAR and SBT support were just copied, so it's just more copying ;)
Ability to switch to runtime: scala without breaking Gradle is going to greatly improve DX ;)

@pawelprazak
Copy link
Collaborator

pawelprazak commented Nov 20, 2023

The fact that those language plugins are mostly interchangeable right now is not intentional.

The Java SDK and it's language plugin have different lifecycle and ownership - it is maintained by Pulumi
The Scala SDK a.k.a. Besom is maintained by VirtusLab.

This is the first reason why we cannot guarantee the interchangeability of language plugins in the future.

The second, and more important fact is, that the language plugin has more responsibilities then just build tools.
Please have a look at the gRPC definition for reference.
This is not implemented in both mentioned plugins at the moment of writing, but it will be implemented in Besom, rather sooner than later.
This will make the interchangeability impossible by design.

Another internal goal of Besom is to rewrite the language plugin to Scala 3 with Graalvm static binary, this will allow us to embed the codegen module and maybe even the scala-cli itself, it sounds tempting.

As for the tooling support, I've always thought the Pulumi way of doing language plugins is fundamentally incompatible with the "JVM-way", and the dependency should be IMO reversed.

Once we have Automation API implemented, every build tool can easily create a plugin for Besom, just like most JVM people like it (it was highly requested by Java SDK users to have a gradle and maven plugins).

So to summarize, I'm in favor of the following plan:

  • implement the Automation API (it is critical anyway) [Epic] Add Automation API #254
  • drop SBT support and let the community develop plugins leveraging Automation API
  • port language provider to Scala and integrate it with coursier/scala-cli as a single binary

Also we'd like to prioritize delivery of feature parity with upstream - this is the main goal, so we must be laser focused on the core of Besom.

@pawelprazak pawelprazak added the kind/question Questions about existing features label Nov 20, 2023
@pawelprazak
Copy link
Collaborator

As for something immediately actionable, we probably should document that Java SDK and Besom are completely separate and can interact in unpredictable and "interesting" ways when used together.

@pawelprazak pawelprazak added area/docs The documentation and website area/language-host Runtime that executes user programs labels Nov 20, 2023
@dubinsky
Copy link
Author

@pawelprazak
I understand that to continue to be able to use Besom I need to use runtime: scala, and I am happy - eager even! - to do it.
I also understand that when the Automation API becomes available, build-tool integration using it will become possible, and I am happy to look at the possibility of developing a Gradle plugin for such integration.

I do not quite understand the impact of this statement:

I've always thought the Pulumi way of doing language plugins is fundamentally incompatible with the "JVM-way", and the dependency should be IMO reversed.

Does this mean that at some point the ability to use Besom via the pulumi CLI delegating to the Besom's Scala Language Plugin is going to get removed completely?

Before all of the above transpires, what is the way for me right now to use Besom properly, with the Scala Language Plugin, if I am using Gradle as a build tool and the language plugin does not (and will not) support it? Should I point to my executable JAR in Pulumi.yaml's runtime.option.binary or is there a better way? Or am I out of luck and not a part of the target audience of the early adopters? ;)

Thanks!

@pawelprazak
Copy link
Collaborator

I'm sorry about my confusing remarks, I was just thinking out loud. There are no specific decisions made yet regarding language plugin, other than that we'd like to find a way to give the community the best support for build tools possible, and the exact shape of it, I hope, will be made clear by user feedback, like yours :)

This is a very good point you are making, about early adoption, and I see no reason no to port Java lang host Gradle support, @lbialy WDYT?

@dubinsky
Copy link
Author

Will this be in the next release? ;)

@golosegor
Copy link

it would be really nice to have this resolved...

@lbialy
Copy link
Collaborator

lbialy commented Jan 3, 2024 via email

@pawelprazak pawelprazak added this to the 0.2.0 milestone Jan 17, 2024
@pawelprazak pawelprazak self-assigned this Jan 26, 2024
@pawelprazak pawelprazak added the kind/improvement An improvement with existing workaround label Jan 26, 2024
pawelprazak added a commit that referenced this issue Jan 29, 2024
- add the executors
- add integration tests

fixes #303
pawelprazak added a commit that referenced this issue Jan 29, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Jan 31, 2024
- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
pawelprazak added a commit that referenced this issue Feb 1, 2024
* Add language plugin executors form gradle and maven

- add the executors
- add integration tests
- update language plugin go.mod go.sum

fixes #303
@pawelprazak pawelprazak added the awaiting-release Fix was merged but not released label Feb 1, 2024
@pawelprazak
Copy link
Collaborator

Reopening until release

@pawelprazak pawelprazak reopened this Feb 1, 2024
@pawelprazak pawelprazak added the resolution/fixed This issue was fixed label Feb 5, 2024
@lbialy
Copy link
Collaborator

lbialy commented Feb 8, 2024

Release of 0.2.0 which brings support for Maven and Gradle is underway. Closing the issue.

@lbialy lbialy closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs The documentation and website area/language-host Runtime that executes user programs awaiting-release Fix was merged but not released kind/improvement An improvement with existing workaround kind/question Questions about existing features resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants