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

Bump server to 1.26.2, enable HTTP by default #734

Open
wants to merge 4 commits into
base: next-server
Choose a base branch
from

Conversation

bergundy
Copy link
Member

No description provided.

Port for the HTTP API service.
Default is off.
description: Port for the HTTP API service.
default: 7243
Copy link
Member

@cretz cretz Jan 6, 2025

Choose a reason for hiding this comment

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

Can we get confirmation that enabling HTTP by default is only for an internal Nexus completion callback mechanism? If so, can we instead use an in-memory approach instead of binding this port for everyone by default? (some internal team discussions are underway on this)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's used for callbacks and for all other Nexus RPCs in the spec.

Available to be called from external clients or internally by the history service Nexus machinery.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

Mostly LGTM (just a minor comment or two before approval), but would like @josh-berry to re-confirm his approval confirming he is ok with http-always-on-default-random-port.

description: |
Port for the HTTP API service.
Default is off.
description: Port for the HTTP API service. Defaults to a random free port.
Copy link
Member

@cretz cretz Jan 7, 2025

Choose a reason for hiding this comment

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

Should we have any way to disable the HTTP API service? I can't think of a good reason at this time, so can probably not worry about it for now.

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 thought about this but don't think it's a concern if it defaults to a random port. We can always add a --no-http flag if we wanted later.

@@ -25,26 +25,29 @@ import (

func TestServer_StartDev_Simple(t *testing.T) {
port := strconv.Itoa(devserver.MustGetFreePort("127.0.0.1"))
httpPort := strconv.Itoa(devserver.MustGetFreePort("127.0.0.1"))
Copy link
Member

Choose a reason for hiding this comment

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

Why are these test updates needed? Can't we just let it choose the random default?

Copy link
Member Author

Choose a reason for hiding this comment

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

They're not, I left it here in prep for when we make the HTTP port fixed.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think that's a reasonable assumption/expectation yet. But so long as there's some code path somewhere that is covering the random part, all good, even if it's not needed.

@@ -152,6 +158,7 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string)

cctx.Printer.Printlnf("CLI %v\n", VersionString())
cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort)
cctx.Printer.Printlnf("%-8s %v:%v", "HTTP:", toFriendlyIp(opts.FrontendIP), opts.FrontendHTTPPort)
Copy link
Member

Choose a reason for hiding this comment

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

I am a little concerned about this part. The HTTP API is not considered stable and is not really documented. So listing this as though it is I think is a bit rough. Can we only display this when the port was given explicitly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... for metrics we print even if the port isn't specified. Let's keep this consistent.

Copy link
Member

Choose a reason for hiding this comment

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

The concern is not about whether the port is specified, it's about promoting the HTTP API. Metrics is stable/GA and documented w/ a cloud equivalent, HTTP API is not. We should not by default encourage use of the HTTP API in dev server at this time until it is a documented product available to all cloud users by default. But if a user explicitly sets an option, that's different/understandable, though I would also be ok just not showing it at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

@josh-berry
Copy link
Collaborator

Mostly LGTM (just a minor comment or two before approval), but would like @josh-berry to re-confirm his approval confirming he is ok with http-always-on-default-random-port.

If it's callable externally, then I think my preference would be to make it non-random by default. Otherwise we are making it harder for Nexus users to know what port to use.

This is a weak preference since we can always make it non-random later. I have no objection to merging as-is if there are strong opinions in the other direction.

@bergundy
Copy link
Member Author

bergundy commented Jan 7, 2025

This is a weak preference since we can always make it non-random later. I have no objection to merging as-is if there are strong opinions in the other direction.

I agree with everything you said. We're going to have to make it non-random eventually, but let's prepare the SDKs for that first or figure out a way to reuse the gRPC port for Nexus.

Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

👍 @bergundy Sounds good to me.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM (assuming per #734 (comment) that there is some test that covers the random HTTP port aspect)

@josh-berry
Copy link
Collaborator

@bergundy Do you think you'll be able to merge this today?

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.

3 participants