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

[bridge] Introduce AppClusterWorkspaceInstanceController #13831

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

geropl
Copy link
Member

@geropl geropl commented Oct 13, 2022

Description

Introduces AppClusterWorkspaceInstanceController to garbage-collect workspace instance that failed to start on the application cluster side of the instance lifecycle:
image

Related Issue(s)

Prerequisite: #13866
Contributes to: #6770

How to test

  • start workspace on a context that triggers an image build (example)
  • note how the workspace starts as expected

Release Notes

reliably close Workspaces which fail to start for whatever reason

Documentation

Werft options:

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

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-gpl-6770-app-gc.2 because the annotations in the pull request description changed
(with .werft/ from main)

@geropl geropl force-pushed the gpl/6770-app-gc branch 3 times, most recently from 76e0726 to 287cb5a Compare October 14, 2022 11:52
@roboquat roboquat added size/XXL and removed size/M labels Oct 14, 2022
@roboquat roboquat added size/L and removed size/XXL labels Oct 21, 2022
@geropl geropl marked this pull request as ready for review October 21, 2022 15:35
@geropl geropl requested a review from a team October 21, 2022 15:35
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Oct 21, 2022
Comment on lines +56 to +72
log.info("Controlling app cluster instances", { installation: appClusterInstallation });

const notStoppedInstances = await this.workspaceDb.findRunningInstancesWithWorkspaces(
appClusterInstallation,
undefined,
false,
);
await this.workspaceInstanceController.controlNotStoppedAppClusterManagedInstanceTimeouts(
ctx,
notStoppedInstances,
appClusterInstallation,
);

log.info("Done controlling app cluster instances", {
installation: appClusterInstallation,
instancesCount: notStoppedInstances.length,
});
Copy link
Member

Choose a reason for hiding this comment

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

Nice. This would be the perfect place to put any metrics which report duration & outcome. Shame we don't have metrics configured for ws-manager-bridge

Copy link
Member

Choose a reason for hiding this comment

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

We could "cheat" and attach the duration of the run (and any outcome) to the log fields.


@inject(WorkspaceDB) protected readonly workspaceDb: WorkspaceDB;

@inject(WorkspaceInstanceController) protected readonly workspaceInstanceController: WorkspaceInstanceController;
Copy link
Member

Choose a reason for hiding this comment

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

Would we eventually move this instance onto this controller also? Seems we've got layers here which may not be adding immediate value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we could! It's basically and artifact of splitting the PRs, and not adjusting after the rebase 😆

@roboquat roboquat merged commit f89cbd4 into main Oct 24, 2022
@roboquat roboquat deleted the gpl/6770-app-gc branch October 24, 2022 07:30
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants