-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
deploy supervisor image via server ide config #6512
Comments
We need to make this change backwards compatible, i.e. an old server (which does not send the supervisor image ref) needs to work with a new workspace cluster (which might expect the supervisor image ref). To do that, we could just overwrite the static layer we currently add by changing the order of the layer sources in registry facade: var layerSources []LayerSource
// add static layer first, so that they can be overwritten by the layers that come afterwards
log.Info("preparing static layer")
staticLayer := NewRevisioningLayerSource(CompositeLayerSource{})
layerSources = append(layerSources, staticLayer)
if len(cfg.StaticLayer) > 0 {
l, err := buildStaticLayer(ctx, cfg.StaticLayer, newResolver)
if err != nil {
return nil, err
}
staticLayer.Update(l)
}
ideRefSource := func(s *api.ImageSpec) (ref string, err error) {
return s.IdeRef, nil
}
ideLayerSource, err := NewSpecMappedImageSource(newResolver, ideRefSource)
if err != nil {
return nil, err
}
layerSources = append(layerSources, ideLayerSource)
desktopIdeRefSource := func(s *api.ImageSpec) (ref string, err error) {
return s.DesktopIdeRef, nil
}
desktopIdeLayerSource, err := NewSpecMappedImageSource(newResolver, desktopIdeRefSource)
if err != nil {
return nil, err
}
layerSources = append(layerSources, desktopIdeLayerSource)
// introduce new supervisor layer source. It's ok if the ref returned is an empty string, the spec mapped
// layer source handles this case gracefully.
supervisorRefSource := func(s *api.ImageSpec) (ref string, err error) {
return s.SupervisorRef, nil
}
supervisorLayerSource, err := NewSpecMappedImageSource(newResolver, supervisorRefSource)
if err != nil {
return nil, err
}
layerSources = append(layerSources, supervisorLayerSource)
// content layer source needs to remain where it is and must not be overwritten by the spec mapped stuff
clsrc, err := NewContentLayerSource()
if err != nil {
return nil, xerrors.Errorf("cannot create content layer source: %w", err)
}
layerSources = append(layerSources, clsrc) |
/assign |
One part of this issue is to add the supervisor ref to the ImageSpec of the registry facade. That's obvious. But the supervisor image ref is also part of the
This seems to be used to handle supervisor frontend URLs via @csweichel How could we get this dynamic so that we can change the supervisor image in the EDIT: I think we could get the supervisor image from the imageSpec annotation. |
We should move configuration of the supervisor image to the IDE service in Gitpod Server.
The text was updated successfully, but these errors were encountered: