diff --git a/.werft/jobs/build/deploy-to-preview-environment.ts b/.werft/jobs/build/deploy-to-preview-environment.ts index 4d6a36dcc97706..57fbb48f8a666f 100644 --- a/.werft/jobs/build/deploy-to-preview-environment.ts +++ b/.werft/jobs/build/deploy-to-preview-environment.ts @@ -308,6 +308,9 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl // Relax CPU contraints exec(`yq w -i config.yaml workspace.resources.requests.cpu "100m"`, { slice: installerSlices.INSTALLER_RENDER }); + // Disable resolution of latest images and use bundled latest versions instead + exec(`yq w -i config.yaml experimental.ide.resolveLatest false`, { slice: installerSlices.INSTALLER_RENDER }); + if ((deploymentConfig.analytics || "").startsWith("segment|")) { exec(`yq w -i config.yaml analytics.writer segment`, { slice: installerSlices.INSTALLER_RENDER }); exec(`yq w -i config.yaml analytics.segmentKey ${deploymentConfig.analytics!.substring("segment|".length)}`, { slice: installerSlices.INSTALLER_RENDER }); @@ -390,7 +393,7 @@ async function deployToDevWithInstaller(werft: Werft, jobConfig: JobConfig, depl exec(`/tmp/installer validate cluster -c config.yaml || true`, { slice: installerSlices.INSTALLER_RENDER }); // render the k8s manifest - exec(`/tmp/installer render --namespace ${deploymentConfig.namespace} --config config.yaml > k8s.yaml`, { silent: true }); + exec(`/tmp/installer render --use-experimental-config --namespace ${deploymentConfig.namespace} --config config.yaml > k8s.yaml`, { silent: true }); werft.done(installerSlices.INSTALLER_RENDER); } catch (err) { if (!jobConfig.mainBuild) { diff --git a/components/BUILD.yaml b/components/BUILD.yaml index b976e0c5ba05d7..3dc92155acdcff 100644 --- a/components/BUILD.yaml +++ b/components/BUILD.yaml @@ -42,9 +42,13 @@ packages: - components/ide/code-desktop:docker-insiders - components/ide/code:docker - components/ide/jetbrains/image:goland + - components/ide/jetbrains/image:goland-latest - components/ide/jetbrains/image:intellij + - components/ide/jetbrains/image:intellij-latest - components/ide/jetbrains/image:phpstorm + - components/ide/jetbrains/image:phpstorm-latest - components/ide/jetbrains/image:pycharm + - components/ide/jetbrains/image:pycharm-latest - components/image-builder-bob:docker - components/image-builder-mk3:docker - components/local-app:docker diff --git a/components/ide/jetbrains/image/BUILD.yaml b/components/ide/jetbrains/image/BUILD.yaml index 0963b3399c3f4e..4005d0f9c282c2 100644 --- a/components/ide/jetbrains/image/BUILD.yaml +++ b/components/ide/jetbrains/image/BUILD.yaml @@ -5,9 +5,13 @@ packages: - version deps: - :intellij + - :intellij-latest - :goland + - :goland-latest - :pycharm + - :pycharm-latest - :phpstorm + - :phpstorm-latest - name: intellij type: docker srcs: @@ -30,6 +34,28 @@ packages: image: - ${imageRepoBase}/ide/intellij:${version} - ${imageRepoBase}/ide/intellij:commit-${__git_commit} + - name: intellij-latest + type: docker + srcs: + - "startup.sh" + - "supervisor-ide-config_intellij.json" + deps: + - components/ide/jetbrains/backend-plugin:plugin + - components/ide/jetbrains/image/status:app + - components/ide/jetbrains/cli:app + argdeps: + - imageRepoBase + config: + dockerfile: leeway.Dockerfile + metadata: + helm-component: workspace.desktopIdeImages.intellijLatest + buildArgs: + # "https://data.services.jetbrains.com/products?code=IIU&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" + JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/idea/ideaIU-221.4994.44.tar.gz" + SUPERVISOR_IDE_CONFIG: supervisor-ide-config_intellij.json + image: + - ${imageRepoBase}/ide/intellij:${version}-latest + - ${imageRepoBase}/ide/intellij:commit-${__git_commit}-latest - name: goland type: docker srcs: @@ -52,6 +78,28 @@ packages: image: - ${imageRepoBase}/ide/goland:${version} - ${imageRepoBase}/ide/goland:commit-${__git_commit} + - name: goland-latest + type: docker + srcs: + - "startup.sh" + - "supervisor-ide-config_goland.json" + deps: + - components/ide/jetbrains/backend-plugin:plugin + - components/ide/jetbrains/image/status:app + - components/ide/jetbrains/cli:app + argdeps: + - imageRepoBase + config: + dockerfile: leeway.Dockerfile + metadata: + helm-component: workspace.desktopIdeImages.golandLatest + buildArgs: + # "https://data.services.jetbrains.com/products?code=GO&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" + JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/go/goland-221.4994.43.tar.gz" + SUPERVISOR_IDE_CONFIG: supervisor-ide-config_goland.json + image: + - ${imageRepoBase}/ide/goland:${version}-latest + - ${imageRepoBase}/ide/goland:commit-${__git_commit}-latest - name: pycharm type: docker srcs: @@ -74,6 +122,28 @@ packages: image: - ${imageRepoBase}/ide/pycharm:${version} - ${imageRepoBase}/ide/pycharm:commit-${__git_commit} + - name: pycharm-latest + type: docker + srcs: + - "startup.sh" + - "supervisor-ide-config_pycharm.json" + deps: + - components/ide/jetbrains/backend-plugin:plugin + - components/ide/jetbrains/image/status:app + - components/ide/jetbrains/cli:app + argdeps: + - imageRepoBase + config: + dockerfile: leeway.Dockerfile + metadata: + helm-component: workspace.desktopIdeImages.pycharmLatest + buildArgs: + # "https://data.services.jetbrains.com/products?code=PCP&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" + JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/python/pycharm-professional-221.4994.44.tar.gz" + SUPERVISOR_IDE_CONFIG: supervisor-ide-config_pycharm.json + image: + - ${imageRepoBase}/ide/pycharm:${version}-latest + - ${imageRepoBase}/ide/pycharm:commit-${__git_commit}-latest - name: phpstorm type: docker srcs: @@ -96,3 +166,25 @@ packages: image: - ${imageRepoBase}/ide/phpstorm:${version} - ${imageRepoBase}/ide/phpstorm:commit-${__git_commit} + - name: phpstorm-latest + type: docker + srcs: + - "startup.sh" + - "supervisor-ide-config_phpstorm.json" + deps: + - components/ide/jetbrains/backend-plugin:plugin + - components/ide/jetbrains/image/status:app + - components/ide/jetbrains/cli:app + argdeps: + - imageRepoBase + config: + dockerfile: leeway.Dockerfile + metadata: + helm-component: workspace.desktopIdeImages.phpstormLatest + buildArgs: + # "https://data.services.jetbrains.com/products?code=PS&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" + JETBRAINS_BACKEND_URL: "https://download.jetbrains.com/webide/PhpStorm-221.4994.43.tar.gz" + SUPERVISOR_IDE_CONFIG: supervisor-ide-config_phpstorm.json + image: + - ${imageRepoBase}/ide/phpstorm:${version}-latest + - ${imageRepoBase}/ide/phpstorm:commit-${__git_commit}-latest diff --git a/install/installer/pkg/components/server/ide/configmap.go b/install/installer/pkg/components/server/ide/configmap.go index ed33965034532f..de898da8c9a1c6 100644 --- a/install/installer/pkg/components/server/ide/configmap.go +++ b/install/installer/pkg/components/server/ide/configmap.go @@ -10,6 +10,8 @@ import ( "github.com/gitpod-io/gitpod/installer/pkg/common" "github.com/gitpod-io/gitpod/installer/pkg/components/workspace" "github.com/gitpod-io/gitpod/installer/pkg/components/workspace/ide" + "github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental" + "github.com/gitpod-io/gitpod/installer/pkg/config/versions" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,6 +33,21 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { goland := "goland" pycharm := "pycharm" phpstorm := "phpstorm" + + resolveLatestImage := func(name string, tag string, bundledLatest versions.Versioned) string { + resolveLatest := true + ctx.WithExperimental(func(ucfg *experimental.Config) error { + if ucfg.IDE != nil && ucfg.IDE.ResolveLatest != nil { + resolveLatest = *ucfg.IDE.ResolveLatest + } + return nil + }) + if resolveLatest { + return common.ImageName(ctx.Config.Repository, name, tag) + } + return common.ImageName(ctx.Config.Repository, name, bundledLatest.Version) + } + idecfg := IDEConfig{ SupervisorImage: common.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version), IDEOptions: IDEOptions{ @@ -72,7 +89,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Logo: getIdeLogoPath("vscodeInsiders"), Tooltip: pointer.String("Early access version, still subject to testing."), Label: pointer.String("Insiders"), - Image: common.ImageName(ctx.Config.Repository, ide.CodeIDEImage, ctx.VersionManifest.Components.Workspace.CodeImage.Version), + Image: resolveLatestImage(ide.CodeIDEImage, "nightly", ctx.VersionManifest.Components.Workspace.CodeImage), ResolveImageDigest: pointer.Bool(true), }, codeDesktop: { @@ -97,7 +114,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Type: typeDesktop, Logo: getIdeLogoPath("intellijIdeaLogo"), Image: common.ImageName(ctx.Config.Repository, ide.IntelliJDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJImage.Version), - LatestImage: common.ImageName(ctx.Config.Repository, ide.IntelliJDesktopIDEImage, "latest"), + LatestImage: resolveLatestImage(ide.IntelliJDesktopIDEImage, "latest", ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJLatestImage), }, goland: { OrderKey: pointer.String("05"), @@ -105,7 +122,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Type: typeDesktop, Logo: getIdeLogoPath("golandLogo"), Image: common.ImageName(ctx.Config.Repository, ide.GoLandDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandImage.Version), - LatestImage: common.ImageName(ctx.Config.Repository, ide.GoLandDesktopIdeImage, "latest"), + LatestImage: resolveLatestImage(ide.GoLandDesktopIdeImage, "latest", ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandLatestImage), }, pycharm: { OrderKey: pointer.String("06"), @@ -113,7 +130,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Type: typeDesktop, Logo: getIdeLogoPath("pycharmLogo"), Image: common.ImageName(ctx.Config.Repository, ide.PyCharmDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PyCharmImage.Version), - LatestImage: common.ImageName(ctx.Config.Repository, ide.PyCharmDesktopIdeImage, "latest"), + LatestImage: resolveLatestImage(ide.PyCharmDesktopIdeImage, "latest", ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PyCharmLatestImage), }, phpstorm: { OrderKey: pointer.String("07"), @@ -121,7 +138,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Type: typeDesktop, Logo: getIdeLogoPath("phpstormLogo"), Image: common.ImageName(ctx.Config.Repository, ide.PhpStormDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PhpStormImage.Version), - LatestImage: common.ImageName(ctx.Config.Repository, ide.PhpStormDesktopIdeImage, "latest"), + LatestImage: resolveLatestImage(ide.PhpStormDesktopIdeImage, "latest", ctx.VersionManifest.Components.Workspace.DesktopIdeImages.PhpStormLatestImage), }, }, DefaultIDE: "code", diff --git a/install/installer/pkg/config/v1/experimental/experimental.go b/install/installer/pkg/config/v1/experimental/experimental.go index 4a692845f55295..0c7e1f365a2351 100644 --- a/install/installer/pkg/config/v1/experimental/experimental.go +++ b/install/installer/pkg/config/v1/experimental/experimental.go @@ -14,13 +14,13 @@ import "k8s.io/apimachinery/pkg/api/resource" // Config contains all experimental configuration. type Config struct { - Workspace *WorkspaceConfig `json:"workspace"` - WebApp *WebAppConfig `json:"webapp"` - IDE *IDEConfig `json:"ide"` + Workspace *WorkspaceConfig `json:"workspace,omitempty"` + WebApp *WebAppConfig `json:"webapp,omitempty"` + IDE *IDEConfig `json:"ide,omitempty"` } type WorkspaceConfig struct { - Tracing *Tracing `json:"tracing"` + Tracing *Tracing `json:"tracing,omitempty"` Stage string `json:"stage"` CPULimits struct { @@ -34,7 +34,10 @@ type WorkspaceConfig struct { type WebAppConfig struct { } -type IDEConfig struct{} +type IDEConfig struct { + // Disable resolution of latest images and use bundled latest versions instead + ResolveLatest *bool `json:"resolveLatest,omitempty"` +} type TracingSampleType string diff --git a/install/installer/pkg/config/versions/versions.go b/install/installer/pkg/config/versions/versions.go index b8db5726b70650..2bf782a872e250 100644 --- a/install/installer/pkg/config/versions/versions.go +++ b/install/installer/pkg/config/versions/versions.go @@ -45,9 +45,13 @@ type Components struct { CodeDesktopImage Versioned `json:"codeDesktop"` CodeDesktopImageInsiders Versioned `json:"codeDesktopInsiders"` IntelliJImage Versioned `json:"intellij"` + IntelliJLatestImage Versioned `json:"intellijLatest"` GoLandImage Versioned `json:"goland"` + GoLandLatestImage Versioned `json:"golandLatest"` PyCharmImage Versioned `json:"pycharm"` + PyCharmLatestImage Versioned `json:"pycharmLatest"` PhpStormImage Versioned `json:"phpstorm"` + PhpStormLatestImage Versioned `json:"phpstormLatest"` } `json:"desktopIdeImages"` } `json:"workspace"` WSDaemon struct {