pulumi/scripts
Will Jones 34eac65c20
Only use gRPC to communicate with the Java host (#18138)
Language hosts are an important part of the Pulumi ecosystem,
encapsulating language-specific concerns such as program execution,
plugin hosting, and code generation, and exposing these as a gRPC
service.

Presently, we abuse the fact that the Java language host (along with all
other Pulumi-maintained language hosts) is written in Go to invoke some
of its functionality _directly_---that is, as linked in-memory function
calls---by having `pulumi/pulumi` depend on `pulumi/pulumi-java` in its
`go.mod`. This is undesirable for several reasons -- it creates
unnecessary coupling (indeed, a very annoying cyclic dependency),
requires special-casing in various parts of the CLI, and is hard to
test. In this change, therefore, we switch out these in-memory calls for
"proper" gRPC ones. Specifically:

* `pulumi convert` and `pulumi import` will now call `GenerateProject`
and `GenerateProgram` (Programgen) over a gRPC wire.
* `pulumi package gen-sdk` will now call `GeneratePackage` (SDKgen) over
a gRPC wire.
* `pulumi-java` is removed as a dependency from `go.mod`(s).
`pulumi-java`'s version is now explicitly tracked in the
`scripts/get-language-providers.sh` script (which also becomes simpler
now we have no `go.mod`-dependency-hosts any more).

Aside from the fact that calls are now being made over a network
connection, behaviour should be identical:

* The gRPC implementations of `GenerateProgram` and `GenerateProject`
(found in `pkg/cmd/pulumi-language-java/main.go` in `pulumi-java`) call
the currently used in-memory function as-is, with no surrounding code
except for deserialization of inputs and binding of PCL.
* The gRPC implementation of `GeneratePackage` performs a single
operation aside from deserialization and binding -- name deduplication.
This is the same function as that performed by the `pulumi-java-gen`
binary that is currently used to generate Java SDKs (until now,
`gen-sdk` has not been used _at all_---in-memory or otherwise---due to
this and other issues; see
https://github.com/pulumi/pulumi-java/issues/1508). As a result, this
should now be a suitable replacement for `pulumi-java-gen` and the
correct implementation for `gen-sdk`.

With this, we can remove the cyclic dependency, get rid of
`pulumi-java-gen` and clean up several bits of bespoke code. Rock on,
Java!

> [!NOTE]
> Aside from Java conformance tests giving us confidence, `pulumi
package gen-sdk` has been manually tested with `pulumi-azure-native`,
which is referenced in
https://github.com/pulumi/pulumi-java/issues/1508.

Fixes https://github.com/pulumi/pulumi-java/issues/1508
2025-01-03 16:48:13 +00:00
..
brew.sh Check language plugins in about tests (#18007) 2024-12-11 17:45:19 +00:00
get-job-matrix.py Fix minimum python version in pyproject.toml (#18123) 2024-12-30 10:35:33 +00:00
get-language-providers.sh Only use gRPC to communicate with the Java host (#18138) 2025-01-03 16:48:13 +00:00
get-pulumi-watch.sh ci: Enable goreleaser prep script to build for local os & arch 2022-09-16 09:50:10 -07:00
get-version ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00
go-test.py Revert "Revert "Disable `--rerun-fails` in tests"" (#15643) 2024-03-26 16:26:21 +00:00
go-update.sh ci: Remove -compat=1.18 flags to validate that tests pass on current and minimum supported Go versions 2022-09-27 10:41:25 -07:00
go-wrapper.sh Run integration tests with race detection (#15895) 2024-04-11 15:58:42 +00:00
integration_test_subsets.py Start policy packs in parallel (#14495) 2023-11-20 14:08:32 +00:00
normpath Toward replacing MSBuild with make+bash on Windows (#8617) 2022-01-07 22:27:14 -05:00
prep-for-goreleaser.sh ci: Enable goreleaser prep script to build for local os & arch 2022-09-16 09:50:10 -07:00
publish_npm.sh Publish dev versions of the python and node SDKs (#15299) 2024-02-15 16:25:57 +00:00
pulumi-version.sh Publish dev versions of the python and node SDKs (#15299) 2024-02-15 16:25:57 +00:00
retry Revert "ci: Remove retry script (#15960)" 2024-06-28 09:00:49 -07:00
reversion.js Fix version scripts (#15759) 2024-03-22 14:31:57 +00:00
set-version.py Fix prerelease version (#18125) 2024-12-30 13:35:18 +00:00
tidy.sh Use PrePrepareProject in TestParameterizedGo (#17924) 2024-12-05 09:50:59 +00:00
versions.sh ci: ensure trunk is always green 2022-09-13 13:38:14 -07:00