Skip to content

InstallScripts: pin teleport version using ServerVersion#28149

Merged
marcoandredinis merged 2 commits intomasterfrom
marco/auto_upgrade_script_fix_stablecloud
Jun 23, 2023
Merged

InstallScripts: pin teleport version using ServerVersion#28149
marcoandredinis merged 2 commits intomasterfrom
marco/auto_upgrade_script_fix_stablecloud

Conversation

@marcoandredinis
Copy link
Copy Markdown
Contributor

@marcoandredinis marcoandredinis commented Jun 22, 2023

When Automatic Upgrades are enabled and it is cloud, it will install teleport using:

Demo:

Running in Cloud with Auto Upgrades image

I got the expected channel and version:
image

Running in Cloud without Auto Upgrades image
An enterprise version running self-hosted with auto upgrades

image

Fix #28113

@marcoandredinis marcoandredinis force-pushed the marco/auto_upgrade_script_fix_stablecloud branch 2 times, most recently from 81ec1f4 to 9340eab Compare June 22, 2023 16:15
@marcoandredinis marcoandredinis marked this pull request as ready for review June 22, 2023 16:23
@github-actions github-actions Bot added machine-id size/md tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Jun 22, 2023
@github-actions github-actions Bot requested review from hugoShaka and timothyb89 June 22, 2023 16:24
Copy link
Copy Markdown
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

@marcoandredinis Can you please also test it on a Cloud tenant to make sure we don't run into the same situation during upgrade as we did earlier this week?

Comment thread lib/automaticupgrades/version.go Outdated
Comment thread lib/web/join_tokens.go Outdated
Comment thread lib/utils/utils.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change seems irrelevant to the issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was causing an import cycle because:

github.com/gravitational/teleport/lib/modules imports github.com/gravitational/teleport/lib/automaticupgrades imports github.com/gravitational/teleport/lib/utils imports github.com/gravitational/teleport/lib/modules: import cycle not allowed .

It was only used in our binaries and it was a one liner, so I just replaced the function call

Comment thread lib/web/join_tokens.go Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would update this comment to explicitly mention that currently auto-upgrades in the install script are enabled only for Cloud customers enrolled in auto-upgrades. Otherwise, it looks strange that we're checking generic "installUpdater" variable but override the channel to the cloud one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to:


	// The install script will install the updater (teleport-ent-updater) for Cloud customers enrolled in Automatic Upgrades.
	// The repo channel used must be `stable/cloud` which has the available packages for the Cloud Customer's agents.
	// It pins the teleport version to the one specified by https://updates.releases.teleport.dev/v1/stable/cloud/version
	// This ensures the initial installed version is the same as the `teleport-ent-updater` would install.

@marcoandredinis marcoandredinis force-pushed the marco/auto_upgrade_script_fix_stablecloud branch from 9340eab to b5bdd86 Compare June 22, 2023 21:52
@marcoandredinis
Copy link
Copy Markdown
Contributor Author

@marcoandredinis Can you please also test it on a Cloud tenant to make sure we don't run into the same situation during upgrade as we did earlier this week?

Yes 👍
I tested using an enterprise build with the license from my tenant in Cloud Stage
But using the real env seems a better approach 👍

@marcoandredinis marcoandredinis force-pushed the marco/auto_upgrade_script_fix_stablecloud branch 2 times, most recently from a02e298 to a84d9c6 Compare June 22, 2023 22:26
@marcoandredinis
Copy link
Copy Markdown
Contributor Author

With auto upgrades on
image

And Server reporting version 14-dev
image

I got the expected channel and version:
image

@marcoandredinis
Copy link
Copy Markdown
Contributor Author

After disabling automatic upgrades for my tenant, I get the following script
image

Working as expected 👍

@marcoandredinis marcoandredinis force-pushed the marco/auto_upgrade_script_fix_stablecloud branch from a84d9c6 to 97195ed Compare June 23, 2023 07:32
When Automatic Upgrades are enabled and the current installation is an
enterprise build, it will install teleport using:
- stable/cloud repo channel (yum, apt)
- pin the version to the one present at:
  https://updates.releases.teleport.dev/v1/stable/cloud/version
@marcoandredinis marcoandredinis force-pushed the marco/auto_upgrade_script_fix_stablecloud branch from 97195ed to 01a8763 Compare June 23, 2023 14:28
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from timothyb89 June 23, 2023 15:45
@marcoandredinis marcoandredinis added this pull request to the merge queue Jun 23, 2023
Merged via the queue into master with commit 48a113b Jun 23, 2023
@marcoandredinis marcoandredinis deleted the marco/auto_upgrade_script_fix_stablecloud branch June 23, 2023 16:03
@public-teleport-github-review-bot
Copy link
Copy Markdown

@marcoandredinis See the table below for backport results.

Branch Result
branch/v13 Failed

marcoandredinis added a commit that referenced this pull request Jun 23, 2023
* InstallScripts: pin teleport version using ServerVersion

When Automatic Upgrades are enabled and the current installation is an
enterprise build, it will install teleport using:
- stable/cloud repo channel (yum, apt)
- pin the version to the one present at:
  https://updates.releases.teleport.dev/v1/stable/cloud/version

* improve comments
github-merge-queue Bot pushed a commit that referenced this pull request Jun 23, 2023
… (#28208)

* InstallScripts: pin teleport version using ServerVersion (#28149)

* InstallScripts: pin teleport version using ServerVersion

When Automatic Upgrades are enabled and the current installation is an
enterprise build, it will install teleport using:
- stable/cloud repo channel (yum, apt)
- pin the version to the one present at:
  https://updates.releases.teleport.dev/v1/stable/cloud/version

* improve comments

* fix test
@r0mant r0mant mentioned this pull request Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

machine-id size/md tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race between Cloud upgrade and stable/cloud repos

5 participants