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

[installer] Add disableMigration experimental config #9793

Merged
merged 2 commits into from
May 5, 2022

Conversation

andrew-farries
Copy link
Contributor

@andrew-farries andrew-farries commented May 5, 2022

Description

One of the Webapp team's epics for Q2 is to use the Gitpod installer to deploy to Gitpod SaaS. In order to do that we will need to add additional configuration to the installer to make the output suitable for a SaaS deployment as opposed to a self-hosted deployment.

This PR adds an extra disableDbMigration config flag under experimental.webapp. When set, the flag causes the installer not to render:

  • The dbinit-session job
  • The migrations job
  • The db-init-scripts configmaps

We do this because for Gitpod SaaS, Werft runs the migrations as part of the release process.

Related Issue(s)

Part of #9097

How to test

Create an installer config file containing this experimental section:

experimental:
  webapp:
    disableMigration: true

Get a versions.yaml for use with the installer:

docker run -it --rm "eu.gcr.io/gitpod-core-dev/build/versions:${version}" cat versions.yaml > versions.yaml

Then invoke the installer as:

go run . render --debug-version-file versions.yaml --config /path/to/config --use-experimental-config

The resources mentioned above will not be part of the rendered output.

Release Notes

Add `disableDbMigration` config flag to the installer to disable db migrations

Documentation

None.

@andrew-farries andrew-farries requested a review from a team May 5, 2022 11:56
@andrew-farries andrew-farries marked this pull request as draft May 5, 2022 11:57
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label May 5, 2022
@andrew-farries andrew-farries force-pushed the af/installer-disable-migration branch 3 times, most recently from a4ef522 to bc9692a Compare May 5, 2022 13:30
@andrew-farries andrew-farries marked this pull request as ready for review May 5, 2022 13:32
@@ -18,6 +19,10 @@ import (
var initScriptFiles embed.FS

func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
if disableMigration := common.IsDatabaseMigrationEnabled(ctx); disableMigration {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -20,6 +20,10 @@ import (
var initScriptFiles embed.FS

func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
if disableMigration := common.IsDatabaseMigrationEnabled(ctx); disableMigration {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -19,6 +20,10 @@ import (
)

func job(ctx *common.RenderContext) ([]runtime.Object, error) {
if disableMigration := common.IsDatabaseMigrationEnabled(ctx); disableMigration {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -15,6 +15,10 @@ import (
)

func job(ctx *common.RenderContext) ([]runtime.Object, error) {
if disableMigration := common.IsDatabaseMigrationEnabled(ctx); disableMigration {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

LGTM

Andrew Farries added 2 commits May 5, 2022 13:37
Use it to skip rendering:
* the `migration' job.
* the `dbinit-session` job.
* the `dbinit-scripts` configmaps.
Test that the objects are/are not rendered when the `disableMigration` config
flag is set.
@andrew-farries andrew-farries force-pushed the af/installer-disable-migration branch from bc9692a to 7e82584 Compare May 5, 2022 13:37
@andrew-farries
Copy link
Contributor Author

andrew-farries commented May 5, 2022

/werft run with-clean-slate-deployment=true

👍 started the job as gitpod-build-af-installer-disable-migration.5
(with .werft/ from main)

@roboquat roboquat merged commit 411de1e into main May 5, 2022
@roboquat roboquat deleted the af/installer-disable-migration branch May 5, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/L team: delivery Issue belongs to the self-hosted team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants