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

[image-builder] Fix ignoring of user-passed authentication #19745

Merged
merged 1 commit into from
May 16, 2024

Conversation

geropl
Copy link
Member

@geropl geropl commented May 15, 2024

Description

With #19474 a bug was introduced that ignores two registry authentication special cases:

  1. installation defined registry auth (code)
    • this is an old self-hosted feature, and we don't seem to be using it anymore ✔️
  2. user-defined registry auth (the GITPOD_IMAGE_AUTH variable)
    • this one is fixed with this PR 👇

Related Issue(s)

Fixes ENT-72

How to test

  • start an image build referencing a base image in a private repository (via GITPOD_IMAGE_AUTH)

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@geropl
Copy link
Member Author

geropl commented May 15, 2024

@iQQBot Could you review this PR, and see if it makes sense?

Copy link
Contributor

@kylos101 kylos101 left a comment

Choose a reason for hiding this comment

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

Works well!

I tested the following:

  1. Previously built workspace images that are dependent on private registries in a custom dockerfile are able to start workspaces w/o building or being dependent on having GITPOD_IMAGE_AUTH set on the repo.
  2. A change to the private image in a custom dockerfile dependent on a private registry fails the build with a 502 if the GITPOD_IMAGE_AUTH is not set (image-builder-bob needs a credential).
  3. Building on the previous test, once the GITPOD_IMAGE_AUTH is set in the repo, a workspace image is built, and a workspace started. It can also be restarted.
  4. I can also use the same private image directly (so no custom docker file). It restarts fine, and if I delete the workspace-image it gets rebuilt.

I did not test private ECR. Let's plan to do against dogfood Thursday, and follow-up if needed? It's easier to land main-gha changes in Dedicated.

Before removing the hold, let's assert the problem can be recreated in a gen113 preview. That'll help us increase confidence that this resolves the issue. I'll do that now.

@kylos101
Copy link
Contributor

Made a preview from:
image

Got the following on workspace start for this context, an image ref:
image

This was regardless of whether GITPOD_IMAGE_AUTH was defined for the repo (even when defined we got the error).

Interestly, starting from this context, a docker file (a customer dockerfile) worked w/o issue. This other docker file also worked fine.

@geropl
Copy link
Member Author

geropl commented May 16, 2024

Before removing the hold, let's assert the problem can be recreated in a gen113 preview. That'll help us increase confidence that this resolves the issue. I'll do that now.

Awesome, thank you for your thorough testing 🧡

@geropl
Copy link
Member Author

geropl commented May 16, 2024

/unhold

@geropl
Copy link
Member Author

geropl commented May 16, 2024

Whoa, blocked by needing ✔️ from an old EXP team member... 😬

@geropl
Copy link
Member Author

geropl commented May 16, 2024

Thx @AlexTugarev for the unblock 🙇

@roboquat roboquat merged commit ec41fce into main May 16, 2024
15 checks passed
@roboquat roboquat deleted the gpl/72-fix-image-auth branch May 16, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants