Skip to content

Use public api in supervisor #15112

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

Merged
merged 1 commit into from
Dec 8, 2022
Merged

Use public api in supervisor #15112

merged 1 commit into from
Dec 8, 2022

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Dec 1, 2022

Description

How to test

We tested the following cases:

  • configcat false/true from workspace start
  • turn back-and-forth to check if api switched between server and supervisor immediately (configcat has 1/2 minutes delay for polling). Should contains:
    • ports control when workspace start (via .gitpod.yml, example repo)
    • workspace instance update
    • git commit all pulled from private repo works
  • Start with public-api enabled in conficat
    • turn down public api-server with kubectl scale deploy/public-api-server --replicas=0
    • disable public-api, and check ports controls and get git token works again
  • Start workspace with supervisor_persist_serverapi_channel_when_start
    • enabled
    • disabled

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@roboquat roboquat added size/XXL and removed size/XL labels Dec 2, 2022
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-hw-pub-sup-impl.10 because the annotations in the pull request description changed
(with .werft/ from main)

@jeanp413 jeanp413 force-pushed the hw/pub-sup-impl branch 3 times, most recently from a3bb05c to bd92a8a Compare December 6, 2022 18:50
@mustard-mh mustard-mh force-pushed the hw/pub-sup-impl branch 2 times, most recently from 60bb57d to bf16603 Compare December 7, 2022 19:01
@mustard-mh mustard-mh marked this pull request as ready for review December 8, 2022 16:04
@mustard-mh mustard-mh requested review from a team December 8, 2022 16:04
@mustard-mh mustard-mh removed team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team labels Dec 8, 2022
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

/hold

generally looks good, please have a look at comments, and merge when you are ready

}

func (service *Service) tryConnToPublicAPI() {
endpoint := fmt.Sprintf("api.%s:443", service.cfg.Host)
Copy link
Member

Choose a reason for hiding this comment

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

[nit] Supply this as config to the service, if possible.

Host: query.Host,
})
if err != nil {
log.WithField("method", "GetGitToken").WithError(err).Error("failed to call PublicAPI")
Copy link
Member

Choose a reason for hiding this comment

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

You can add these logs as a middleware. See common-go/grpc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will address this in follow-up PR

Co-authored-by: mustard <[email protected]>
Co-authored-by: Anton Kosyakov <[email protected]>
Co-authored-by: Jean Pierre <[email protected]>
Co-authored-by: iQQBot <[email protected]>
@mustard-mh
Copy link
Contributor Author

mustard-mh commented Dec 8, 2022

Addressed parts of comments and tested again, could you review? 🙏 @easyCZ

@mustard-mh mustard-mh marked this pull request as ready for review December 8, 2022 20:33
@roboquat roboquat merged commit f3fcfbf into main Dec 8, 2022
@roboquat roboquat deleted the hw/pub-sup-impl branch December 8, 2022 20:48
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production release-note-none size/XXL team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants