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

roachprod: create admin user and backup schedule for virtual clusters #118851

Merged

Conversation

renatolabs
Copy link
Contributor

This commit updates roachprod start{-sql} and unifies the set of
steps performed on the cluster regardless of whether we are starting
the system tenant for the first time or creating a new tenant.

Specifically, tenants will also have an admin user configured and a
default backup schedule is created when --schedule-backups is passed.

Epic: none

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs renatolabs force-pushed the rc/roachprod-admin-and-backup-for-tenants branch 2 times, most recently from 5eb5ccc to 3bbaf2b Compare February 7, 2024 16:12
@renatolabs renatolabs marked this pull request as ready for review February 7, 2024 19:17
@renatolabs renatolabs requested a review from a team as a code owner February 7, 2024 19:17
@renatolabs renatolabs requested review from herkolategan and srosenberg and removed request for a team February 7, 2024 19:17
@renatolabs
Copy link
Contributor Author

Ran a couple of builds on this branch:

  • 0.1 run, to make sure the changes to Start didn't break anything obvious.
  • multitenant run, which includes all tests migrated to the new API. If we inspect the logs, we see that we now have default admin users and backup schedules both for the system tenants and for each tenant as well.

Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Nice! Thank for fixing this!

@renatolabs renatolabs force-pushed the rc/roachprod-admin-and-backup-for-tenants branch from 3bbaf2b to c876254 Compare February 9, 2024 22:18
@renatolabs
Copy link
Contributor Author

Rebased to fix conflicts with recent changes.

Worth noting is that I changed the default username/password combination from roach:system to roachprod:cockroachdb. The new username more directly reflects that this was setup by roachprod, and system as a password was a little strange, especially in non-UA contexts. cockroachdb is more generic (but open to other suggestions).

I'll run a few test runs on this branch, I'm curious if there were any other assumptions on the previous credentials that we missed.

This changes `DefaultStartOpts` to use `system` as
`VirtualClusterName`. This simplifies the starting logic slightly, as
it ensures that the field is always non-empty when starting
clusters. When using `roachprod start`, the field will correctly be
set to `system`; when using `roachprod start-sql`, the field will be
the name of the tenant being started.

Epic: none

Release note: None
We will soon create default backup schedules for tenants as they are
started as well. This flag will allow backup management to be
controlled the same way as they currently are for the system tenant.

Epic: none

Release note: None
This commit updates `roachprod start{-sql}` and unifies the set of
steps performed on the cluster regardless of whether we are starting
the system tenant for the first time or creating a new tenant.

Specifically, tenants will also have an admin user configured and a
default backup schedule is created when `--schedule-backups` is passed.

Epic: none

Release note: None
More concretly, build `StartOpts` based on roachtest's implementation
of `DefaultStartOpts`, which includes creating a default backup
schedule on start.

Epic: none

Release note: None
@renatolabs renatolabs force-pushed the rc/roachprod-admin-and-backup-for-tenants branch from c876254 to 3d1995a Compare February 15, 2024 16:07
@renatolabs
Copy link
Contributor Author

Ran a final run on this branch; failures are unrelated and also happen on master.

TFTR!

bors r=herkolategan

@craig
Copy link
Contributor

craig bot commented Feb 15, 2024

Build succeeded:

@craig craig bot merged commit ea9fb4e into cockroachdb:master Feb 15, 2024
12 checks passed
@renatolabs renatolabs deleted the rc/roachprod-admin-and-backup-for-tenants branch February 15, 2024 18:30
@renatolabs
Copy link
Contributor Author

This has been running without problems on master, so I'll attempt to backport it.

blathers backport 23.2 23.1

Copy link

blathers-crl bot commented Feb 21, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 3cdcfe8 to blathers/backport-release-23.2-118851: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2 failed. See errors above.


error creating merge commit from 3cdcfe8 to blathers/backport-release-23.1-118851: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants