Skip to content

Add meta ID and owner to find workspace image-build Pod #10029

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
May 16, 2022

Conversation

jenting
Copy link
Contributor

@jenting jenting commented May 16, 2022

Description

Add meta ID (workspace ID) and owner to find the workspace image-build Pod.

The integration test TestParallelBaseImageBuild did not hit this issue on core-dev env but it always happens on preview-environment.

The integration test calls image-builder-mk3 Build twice with the same dockerfile. The image-builder-mk3 requests the ws-manager to create the image-builder Pod for building the container image. If the image-builder Pod always exists, the ws-manager returns the existed image-builder Pod to the image-builder-mk3.

In core-dev, the 2nd image-build Build call would not hit this code block However, in preview-environment, the 2nd image-build Build call would hit this code block. It seems to be a race condition.

In general, to find the corresponding workspace Pods, we should add the meta ID (workspace ID) as well as the owner name.
Otherwise, the 2nd image-build Build call will not launch a new Pod to execute the image build because the 1st image-build Pod matches the annotations.

Related Issue(s)

Fixes #9782

How to test

./dev/preview/install-k3s-kubeconfig.sh
cd test

go test -v ./... \
  -kubeconfig=/home/gitpod/.kube/config \
  -namespace=default \
  -run=TestParallelBaseImageBuild

Release Notes

None

Documentation

N/A

@jenting jenting requested a review from a team May 16, 2022 06:51
@github-actions github-actions bot added team: workspace Issue belongs to the Workspace team and removed size/XS labels May 16, 2022
@jenting jenting changed the title Add meta ID and owner to find workspaces Add meta ID and owner to find workspace image-build Pod May 16, 2022
@jenting jenting force-pushed the jenting/workspace-integration-test-9782 branch from 00b93dc to a07155d Compare May 16, 2022 06:52
Copy link
Contributor

@csweichel csweichel left a comment

Choose a reason for hiding this comment

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

Did not test, but change and explanation make perfect sense.
Did verify that the GetWorkspaces implementation respects the additional filter.

@roboquat roboquat merged commit a816c6c into main May 16, 2022
@roboquat roboquat deleted the jenting/workspace-integration-test-9782 branch May 16, 2022 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/XS team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace integration test TestBaseImageBuild and TestParallelBaseImageBuild failed again
3 participants