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

feat: proxy calls through the runner #3586

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stuartwdouglas
Copy link
Collaborator

No description provided.

This was referenced Nov 29, 2024
@stuartwdouglas stuartwdouglas force-pushed the stuartwdouglas/runner-proxy branch 4 times, most recently from 4b48645 to 03ad2f0 Compare December 1, 2024 22:59
@stuartwdouglas stuartwdouglas marked this pull request as ready for review December 1, 2024 23:17
if err != nil {
return fmt.Errorf("failed to send message: %w", err)
}
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There should be a check here for if moduleContext.Err() != nil, which can happen if the server closes the connection cleanly. Otherwise below will report a nil error as an error.

}

func (r *runnerProxy) GetModuleContext(ctx context.Context, c *connect.Request[ftlv1.GetModuleContextRequest], c2 *connect.ServerStream[ftlv1.GetModuleContextResponse]) error {
moduleContext, err := r.controllerModuleService.GetModuleContext(ctx, connect.NewRequest(c.Msg))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these calls to connect.NewRequest() are going to drop all headers, even ones we want to preserve?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's been a while but I think this is automatically handled by middleware + headers in the context...so maybe disregard!

@@ -397,7 +406,8 @@ func (s *Service) deploy(ctx context.Context, key model.DeploymentKey, module *s
return fmt.Errorf("failed to download artefacts: %w", err)
}

envVars := []string{"FTL_ENDPOINT=" + s.config.ControllerEndpoint.String(),
logger.Infof("Setting FTL_ENDPOINT to %s", s.proxy.bindAddress.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be debugf to avoid showing to user during local dev. We should really solve this differently, but for now that's the way it is.

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.

2 participants