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

Fix hanging "Prebuild in Progress" page #10357

Merged
merged 4 commits into from
Jun 8, 2022

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented May 30, 2022

This PR fixes an issue with the hanging "Prebuild in Progress" page.
This PR does not fix missing image builder logs from this very page.

How to test

  • clone https://gitlab.com/alex736/gitpod-large-image into your account
  • create a project for it using the preview environment from this PR
  • push a change which modifies a) the Dockerfile and/or b) the init script in the .gitpod.yml file
  • quickly switch to the project's page and start a workspace when you see the prebuild being started
  • now you should see the "Prebuild in Progress" page
  • depending on the time "configured" in the Dockerfile of the repo (modification a) you should eventually see the transition to the following workspace creation pages

Fixes #8195 and more.

Fix hanging "Prebuild in Progress" page.

@AlexTugarev AlexTugarev force-pushed the alex/prebuild-not-starting-workspace-8195 branch from d9a335d to db5409f Compare June 7, 2022 11:57
@AlexTugarev AlexTugarev force-pushed the alex/prebuild-not-starting-workspace-8195 branch from ff53f1c to 1887fec Compare June 8, 2022 11:32
@AlexTugarev AlexTugarev force-pushed the alex/prebuild-not-starting-workspace-8195 branch from 1887fec to 5a6250c Compare June 8, 2022 12:46
}
return false;
};
const pollIsPrebuildDone = async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

this was unused at all 🙈

const disposables = watchHeadlessLogs(
props.runningPrebuild.instanceID,
(chunk) => logsEmitter.emit("logs", chunk),
checkIsPrebuildDone,
Copy link
Member Author

Choose a reason for hiding this comment

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

this was the only option to proceed, i.e. only if headless logs poller checked for isPrebuildDone periodically, we'd a chance to proceed. whenever that poller broke, this was a UX dead-end.

if (update.workspaceId !== props.runningPrebuild.workspaceID) {
return;
}
if (update.status.phase === "stopped") {
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the old assumption in a new shape 😞
'still don't like it myself, but it kind of works.
what it does: when we enter the RunningPrebuildView scene, we're listening for the stopped event of image-build/prebuild, and when it's happening we proceed.

@@ -661,19 +663,20 @@ interface ImageBuildViewProps {
}

function ImageBuildView(props: ImageBuildViewProps) {
const logsEmitter = new EventEmitter();
Copy link
Member Author

Choose a reason for hiding this comment

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

If the parent comp of ImageBuildView decided to re-render this will be reinitialized unintentionally.

@@ -754,7 +754,9 @@ export interface PrebuiltWorkspace {

export namespace PrebuiltWorkspace {
export function isDone(pws: PrebuiltWorkspace) {
return pws.state === "available" || pws.state === "timeout" || pws.state === "aborted";
return (
Copy link
Member Author

Choose a reason for hiding this comment

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

though isDone seems to be very unused after this PR, it seems to be wrong to have the failed state missing in here.

Copy link
Member

Choose a reason for hiding this comment

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

If it's unused, let's remove it. It's always available in git history.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's API though.

Copy link
Member

Choose a reason for hiding this comment

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

It's API though.

What do you mean?

@AlexTugarev AlexTugarev changed the title Start workspace when prebuild is done Fix hanging "Prebuild in Progress" page Jun 8, 2022
@AlexTugarev AlexTugarev marked this pull request as ready for review June 8, 2022 13:04
@AlexTugarev AlexTugarev requested a review from a team June 8, 2022 13:04
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jun 8, 2022
@AlexTugarev AlexTugarev mentioned this pull request Jun 8, 2022
11 tasks
@geropl geropl self-assigned this Jun 8, 2022
Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Nice @AlexTugarev , worked as expected for me! 🚀

One downside: Logs did not work for me in one case, though, even after reload.
Meanwhile the prebuild view worked flawlessly... 🙈
Bumps the importance respective issue I guess!

@roboquat roboquat merged commit 8a56328 into main Jun 8, 2022
@roboquat roboquat deleted the alex/prebuild-not-starting-workspace-8195 branch June 8, 2022 14:55
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jun 9, 2022
@AlexTugarev
Copy link
Member Author

One downside: Logs did not work for me in one case, though, even after reload.

@geropl, as mentioned before, image build logs never show up in this. I don't think this is a front-end issue, as I've seen the calls were not successful on server side. There is another issue with image build logs for prebuild which is independent of frontend bits.

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

Successfully merging this pull request may close these issues.

[prebuild] Not starting workspace once the prebuild is done
4 participants