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

Revise host mode. #5317

Merged
merged 5 commits into from
Sep 15, 2020
Merged

Revise host mode. #5317

merged 5 commits into from
Sep 15, 2020

Conversation

pgavlin
Copy link
Member

@pgavlin pgavlin commented Sep 10, 2020

The current implementation of host mode uses a pulumi host command and
an ad-hoc communication protocol between the engine and client to
connect a language host after the host has begun listening. The most
significant disadvantages of this approach are the communication
protocol (which currently requires the use of stdout), the host-specific
command, and the difficulty of accommodating the typical program-bound
lifetime for an update.

These changes reimplement host mode by adding engine support for
connecting to an existing language runtime service rather than launching
a plugin. This capability is provided via an engine-specific language
runtime, client, which accepts the address of the existing languge
runtime service as a runtime option. The CLI exposes this runtime via
the --client flag to the up and preview commands, which similarly
accepts the address of an existing language runtime service as an
argument. These changes also adjust the automation API to consume the
new host mode implementation.

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would be good for @EvanBoyle to review as well.

pkg/engine/plugin_host.go Outdated Show resolved Hide resolved
@EvanBoyle
Copy link
Contributor

Just linking these two issues:

Closes #5225
closes #5249

Copy link
Contributor

@EvanBoyle EvanBoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Substantially cleaner and easier to reason about than the original approach. Thanks for taking the time to dig into this! Just a few notes/questions.

pkg/cmd/pulumi/preview.go Show resolved Hide resolved
return nil, "", err
}
if clientAddress != "" {
proj.Runtime = workspace.NewProjectRuntimeInfo("client", map[string]interface{}{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we rely on language info being present here for other parts of the system. I'm aware that we used this approach in the host command but I think that was an oversight.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to leave this as-is for now and address it in a follow-up change. I'll file an issue to track.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg/engine/lifecycle_test.go Outdated Show resolved Hide resolved
sdk/go/common/resource/plugin/host.go Show resolved Hide resolved
pgavlin and others added 4 commits September 14, 2020 14:56
The current implementation of host mode uses a `pulumi host` command and
an ad-hoc communication protocol between the engine and client to
connect a language host after the host has begun listening. The most
significant disadvantages of this approach are the communication
protocol (which currently requires the use of stdout), the host-specific
command, and the difficulty of accommodating the typical program-bound
lifetime for an update.

These changes reimplement host mode by adding engine support for
connecting to an existing language runtime service rather than launching
a plugin. This capability is provided via an engine-specific language
runtime, `client`, which accepts the address of the existing languge
runtime service as a runtime option. The CLI exposes this runtime via
the `--client` flag to the `up` and `preview` commands, which similarly
accepts the address of an existing language runtime service as an
argument. These changes also adjust the automation API to consume the
new host mode implementation.
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve design of host mode Wire up various parameters to pulumi host command
3 participants