-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[installer] make sure dashboard is deployed after server and papi-server #19042
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
Conversation
@@ -46,6 +48,11 @@ var componentCmd = &cobra.Command{ | |||
ctx, cancel := context.WithTimeout(cmd.Context(), timeout) | |||
defer cancel() | |||
|
|||
if shouldSkipComponentWaiter(ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not we call it each time inside the waitPodsImage loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They behavior the same
func startWaitFeatureFlag(ctx context.Context, timeout time.Duration) { | ||
featureFlagCtx, cancel := context.WithTimeout(ctx, timeout) | ||
defer cancel() | ||
client := experiments.NewClient(experiments.WithDefaultClient(nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need default client to nil, since it will never be nil without it -> it will return a client NewAlwaysReturningDefaultValueClient
. Then self-hosted
Gitpod Instance may need to keep wait for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that to land it the metric should be added. We deploy it with false state, then we enable it on dogfood, then on Cloud, and afterwards for other cells.
pre-approved since we talked about it, but i did not try and metric should be added
/hold
c4ea20d
to
470749f
Compare
@akosyakov Force push changes into 198d71d Could you take a look? It may happen in preview env that pods ready too fast so there's no related metrics for them |
72b4afd
to
198d71d
Compare
Checked with preview env, that metric works. It took me a lot of time to debug with service-waiter. Configcat config fetch seems will failed for the start. 🥲 And I just recognized that we forget the very first idea to wait: if not skip, we need to keep fetch feature flag. In case its value is changed. Addressed with 198d71d , metric test result see below
|
Tested again with deploy server / public-api with |
@geropl Could you help reviewing it? |
Do you mean first deployment or each time? |
Will test now, too! |
@akosyakov It'll not affect component deployment, but we don't have metric in this case, since feature flag's value is not got yet. |
return defaultValue, false, fetchTimes | ||
default: | ||
stringValue := client.GetStringValue(ctx, experiments.ServiceWaiterSkipComponentsFlag, "NONE", experiments.Attributes{ | ||
GitpodHost: componentCmdOpt.gitpodHost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧡
fetchTimes int | ||
}{ | ||
{ | ||
name: "happy path", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧡
getShouldSkipComponentWaiter := func() { | ||
startTime := time.Now() | ||
value, isActualValue, fetchTimes := ActualWaitFeatureFlag(featureFlagCtx, client, defaultSkip) | ||
avgTime := time.Since(startTime) / time.Duration(fetchTimes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mustard-mh When waiting for longer than timeout, I got a integer divide by zero here (I scaled server down to 0 replicas to test):
panic: runtime error: integer divide by zero
goroutine 18 [running]:
github.com/gitpod-io/gitpod/service-waiter/cmd.startWaitFeatureFlag.func1()
github.com/gitpod-io/gitpod/service-waiter/cmd/component.go:168 +0x4e5
github.com/gitpod-io/gitpod/service-waiter/cmd.startWaitFeatureFlag({0x1a40810?, 0xc000434c40?}, 0x0?)
github.com/gitpod-io/gitpod/service-waiter/cmd/component.go:174 +0x1be
created by github.com/gitpod-io/gitpod/service-waiter/cmd.glob..func2 in goroutine 1
github.com/gitpod-io/gitpod/service-waiter/cmd/component.go:56 +0x45b
Finished testing:
I double checked the code and tests, looks really good! 🙏 Once the last thing is fixed we should 🏁 and merge. 🚀 |
Addressed, thank you 🚢 |
/unhold |
Description
Summary generated by Copilot
🤖 Generated by Copilot at 8857387
This pull request adds a feature flag mechanism to the service-waiter component using the ConfigCat SDK, and uses it to control the waiting for the public-api-server and the server components in the dashboard deployment. It also adds the component name as a custom attribute for experiments. The changes affect the
components/common-go/experiments
,components/service-waiter/cmd
, andinstall/installer/pkg/components/dashboard
packages.Related Issue(s)
Fixes EXP-822
How to test
leeway dev:preview
pods should deployed successfullyleeway dev:preview
pods should deployed successfullyControl with Feature Flag
service_waiter_skip_components
value to skip truecomponent
set withserver
orpublic-api-server
orserver,public-api-server
, it should skip target service waiterDocumentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold