Skip to content

Conversation

@LawnGnome
Copy link
Contributor

@LawnGnome LawnGnome commented Jan 12, 2021

This fixes sourcegraph/sourcegraph#17172. I'm inclined to get this in before I try releasing 3.23.2 again.

The only real drawback of this PR (besides the extra lines of code) is that src will now always ensure the sourcegraph/src-campaign-volume-workspace container is available, since we don't know at the point of downloading Docker images which workspace we'll use. (To figure that out, we'd need the images, and then the snake eats itself.) Since Docker is good at caching, I'm not too concerned: this is only one extra docker image inspect call in any case except for the very first cold run with a new version. (Also, we can definitely optimise those more later.)

Speaking of versioning, there's one other change to make this work as well: when I implemented #412, I missed that newer versions of the workspace image wouldn't be pulled when new src versions were released. I've fixed this now (otherwise all my careful Docker image tagging would be for naught!), but note there's a touch of extra complexity in here around moving the buildTag to another package so we can access it. I think it's fine, but it's worth an extra set of eyes.

It won't cost much to download the utility image once, even if it's not
used, so let's just do it and simplify. This also means we don't end up
with a circular dependency once workspace creator selection depends on
campaign spec steps.
@LawnGnome LawnGnome requested a review from a team January 12, 2021 02:02
@LawnGnome LawnGnome self-assigned this Jan 12, 2021
Copy link
Contributor

@mrnugget mrnugget left a comment

Choose a reason for hiding this comment

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

Looks good to me! Left just a tiny suggestion regarding the default CLI param value.

images.add(image, nil)
}
// We also need to ensure we have our own utility images available.
images.add(dockerVolumeWorkspaceImage, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 on reducing the interface and hardcoding the image here.

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

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

nice workaround 👍

@LawnGnome LawnGnome merged commit 68d2b18 into main Jan 12, 2021
@LawnGnome LawnGnome deleted the aharvey/detect-mixed-user branch January 12, 2021 17:59
scjohns pushed a commit that referenced this pull request Apr 24, 2023
… users (#422)

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

src-cli: Unix user ID mismatch can cause permission errors

4 participants