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] Extracting updating of prebuilds into PrebuildUpdater (2/3) #10425

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

geropl
Copy link
Member

@geropl geropl commented Jun 2, 2022

Description

This PR extract all logic related to updating prebuilds from src/ee/bridge behind a new interface PrebuildUpdater with two implementations: Noop (non-ee version) and DB (ee version) (2/3 in the chain)

Related Issue(s)

Context: #9395

How to test

  • start a workspace on this branch
  • start a workspace in the preview env
  • check the logs kubectl logs ws-manager-bridge- ws-manager-bridge
  • note how:
    • everything is working as expected
    • bridge logs show no errors

Release Notes

NONE

Documentation

@geropl geropl requested a review from a team June 2, 2022 08:38
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jun 2, 2022
@geropl geropl changed the title [bridge] Extracting updating of prebuilds into PrebuildUpdater [bridge] Extracting updating of prebuilds into PrebuildUpdater (2/3) Jun 2, 2022
Base automatically changed from gpl/9395-stuck-prebuilds to main June 2, 2022 10:11
@roboquat roboquat added size/L and removed size/M labels Jun 2, 2022
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

LGTM

/hold because of merge conflicts after 1/3 got merged

@geropl geropl force-pushed the gpl/9395-stuck-prebuilds-2 branch from ddd06f0 to 40a3e5d Compare June 2, 2022 12:01
@roboquat roboquat added size/M and removed size/L labels Jun 2, 2022
@geropl
Copy link
Member Author

geropl commented Jun 2, 2022

/unhold

@roboquat roboquat merged commit df7ed58 into main Jun 2, 2022
@roboquat roboquat deleted the gpl/9395-stuck-prebuilds-2 branch June 2, 2022 12:29
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jun 9, 2022
@@ -462,24 +466,11 @@ export class WorkspaceManagerBridge implements Disposable {
instance.stoppedTime = new Date().toISOString();
promises.push(this.workspaceDB.trace({}).storeInstance(instance));
promises.push(this.onInstanceStopped({}, ri.workspace.ownerId, instance));
promises.push(this.stopPrebuildInstance(ctx, instance));
promises.push(this.prebuildUpdater.stopPrebuildInstance(ctx, instance));
Copy link
Member

Choose a reason for hiding this comment

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

@geropl I don't think this does anything useful. Looks to me like it would update the workspace instance that got set to 'stopped' a few lines above now to 'aborted'. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks to me like it would update the workspace instance that got set to 'stopped' a few lines above now to 'aborted'. Am I missing something?

It updates the PrebuiltWorkspace that's corresponding that WorkspaceInstance to aborted, which would otherwise not bet updated.

In what context are you looking into this? Can I help?

Copy link
Member

Choose a reason for hiding this comment

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

It updates the PrebuiltWorkspace that's corresponding that WorkspaceInstance to aborted, which would otherwise not bet updated.

Why does it do that? And how can a prebuild not be finished when there is a workspace based on it?

In what context are you looking into this? Can I help?

Just reading the code and trying to make sense of it 😇

Copy link
Member

Choose a reason for hiding this comment

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

Ah, got it now. Forget it 😁

Copy link
Member

Choose a reason for hiding this comment

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

What confused me is that the method is called stopPrebuildInstance while it only aborts the PrebuildWorkspace in the database.

Copy link
Member Author

Choose a reason for hiding this comment

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

All good 😉

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-none size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants