Skip to content

Add cb upgrade command.#13

Merged
will merged 1 commit intoCrunchyData:mainfrom
abrightwell:abrightwell/cluster-upgrade
Mar 10, 2022
Merged

Add cb upgrade command.#13
will merged 1 commit intoCrunchyData:mainfrom
abrightwell:abrightwell/cluster-upgrade

Conversation

@abrightwell
Copy link
Member

Adds the following commands for managing cluster upgrades:

  • cb upgrade start starts an upgrade.
  • cb upgrade status shows the status of cluster upgrades.
  • cb upgrade cancel cancels cluster upgrades.

Adds the following commands for managing cluster upgrades:

* `cb upgrade start` starts an upgrade.
* `cb upgrade status` shows the status of cluster upgrades.
* `cb upgrade cancel` cancels cluster upgrades.
Copy link
Member Author

@abrightwell abrightwell left a comment

Choose a reason for hiding this comment

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

Throwing this one up as a DRAFT PR for the time being for some initial review.

Ready for review.

Comment on lines +36 to +46
private def print_team_slash_cluster(c, io : IO)
team_name = team_name_for_cluster c
io << team_name << "/" if team_name
io << c.name.colorize.t_name << "\n"
team_name
end

private def team_name_for_cluster(c)
# no way to look up a single team yet
client.get_teams.find { |t| t.id == c.team_id }.try &.name.colorize.t_alt
end
Copy link
Member Author

Choose a reason for hiding this comment

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

I pulled this into Action here as I figured they'd likely be useful across multiple commands. I haven't refactored them out of program.cr. But could probably see some value in moving the items there to a Action implementation as well for consistency. 🤷

end

# Action to cancel cluster upgrade.
class CB::UpgradeCancel < CB::Upgrade
Copy link
Member Author

Choose a reason for hiding this comment

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

I think it might make sense for cancel to require confirmation as well? Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It might, but I think it's okay to leave it just for truly destructive things. If someone accidentally cancels an upgrade, they can create it again pretty easily, it's not on the same level as deleting your db

@abrightwell abrightwell requested a review from will February 25, 2022 20:43
@abrightwell abrightwell marked this pull request as ready for review March 3, 2022 22:12
@abrightwell
Copy link
Member Author

Bump.

@abrightwell abrightwell mentioned this pull request Mar 9, 2022
@will
Copy link
Collaborator

will commented Mar 9, 2022

Oh sorry I didn't get an email for "@abrightwell abrightwell marked this pull request as ready for review 6 days ago" I’ll look at this today

@will will merged commit d24deea into CrunchyData:main Mar 10, 2022
will added a commit that referenced this pull request Oct 31, 2025
```
<<< /nix/store/6sk9jhxaqa01jm0wp0b4x9labcyi5a3c-cb-3.6.7.drv
>>> /nix/store/jwxavs1iq4zp0bshivkz508js1s8f6g2-cb-3.6.7.drv
Version changes:
[C.]  #1  binutils-with-gold               2.44.tar.bz2 x2 -> 2.44.tar.bz2
[C.]  #2  builder.pl                       <none> x3 -> <none> x2
[C.]  #3  cctools-binutils-darwin-wrapper  1010.6 x7 -> 1010.6 x5
[C.]  #4  clang                            20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #5  clang-at-least                   16-LLVMgold-path.patch x4 -> 16-LLVMgold-path.patch x3
[C.]  #6  clang-src                        20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #7  clang-wrapper                    20.1.8 x3, 21.1.2 x3 -> 21.1.2 x3
[C.]  #8  compiler-rt                      20.1.8, 21.1.2 -> 21.1.2
[C.]  #9  compiler-rt-libc                 20.1.8, 21.1.2 -> 21.1.2
[C.]  #10  compiler-rt-src                  20.1.8, 21.1.2 -> 21.1.2
[C.]  #11  cpio                             2.15 x3, 2.15.tar.bz2 x2 -> 2.15 x2, 2.15.tar.bz2
[C*]  #12  crystal                          1.10.1-1-darwin-universal.tar.gz, 1.16.3 -> 1.10.1-1-darwin-universal.tar.gz, 1.18.2
[C.]  #13  expand-response-params           <none> x5 -> <none> x4
[C.]  #14  gnu-install-dirs.patch           <none> x4 -> <none> x3
[C.]  #15  jq                               1.8.1 x2, 1.8.1.tar.gz x2 -> 1.8.1, 1.8.1.tar.gz
[C.]  #16  libbfd-plugin-api-header         <none> x3 -> <none> x2
[C.]  #17  libcxx                           19.1.2+apple-sdk-15.5 x5 -> 19.1.2+apple-sdk-15.5 x4
[C.]  #18  llvm                             18-compatibility.patch, 20.1.8, 21.1.2 x2 -> 18-compatibility.patch, 21.1.2 x2
[C.]  #19  llvm-src                         20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #20  llvm-tblgen                      20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #21  llvm-tblgen-src                  20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #22  macOS-SDK                        11.3 x2, 14.4, 15.5 x3 -> 11.3 x2, 14.4, 15.5 x2
[C.]  #23  make-binary-wrapper-hook         <none> x4 -> <none> x3
[C.]  #24  onig                             6.9.10.tar.gz x2 -> 6.9.10.tar.gz
[C.]  #25  oniguruma                        6.9.10 x2 -> 6.9.10
[C.]  #26  pbzx                             1.0.2 x3 -> 1.0.2 x2
[C.]  #27  psutil                           7.1.0.tar.gz x2 -> 7.1.0.tar.gz
[C.]  #28  python3                          3.13.8 x2, 3.13.8-env x2 -> 3.13.8 x2, 3.13.8-env
[C.]  #29  python3.13-psutil                7.1.0 x2 -> 7.1.0
[C*]  #30  source                           <none> x85 -> <none> x83
[C*]  #31  stdenv-darwin                    <none> x5 -> <none> x3
Removed packages:
[R.]  #1  bd49bbaaafc98433a2cb4e95ce25b7a201baf5a5.patch  <none>
Closure size: 1239 -> 1201 (806 paths added, 844 paths removed, delta -38, disk usage -161.7KiB).
```
will added a commit that referenced this pull request Oct 31, 2025
* Allow temp location to change if necessary

To keep the specs completely isolated, we don't want to reuse the same
global tempdir.

* update crystal 1.16 -> 1.18


```
<<< /nix/store/6sk9jhxaqa01jm0wp0b4x9labcyi5a3c-cb-3.6.7.drv
>>> /nix/store/jwxavs1iq4zp0bshivkz508js1s8f6g2-cb-3.6.7.drv
Version changes:
[C.]  #1  binutils-with-gold               2.44.tar.bz2 x2 -> 2.44.tar.bz2
[C.]  #2  builder.pl                       <none> x3 -> <none> x2
[C.]  #3  cctools-binutils-darwin-wrapper  1010.6 x7 -> 1010.6 x5
[C.]  #4  clang                            20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #5  clang-at-least                   16-LLVMgold-path.patch x4 -> 16-LLVMgold-path.patch x3
[C.]  #6  clang-src                        20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #7  clang-wrapper                    20.1.8 x3, 21.1.2 x3 -> 21.1.2 x3
[C.]  #8  compiler-rt                      20.1.8, 21.1.2 -> 21.1.2
[C.]  #9  compiler-rt-libc                 20.1.8, 21.1.2 -> 21.1.2
[C.]  #10  compiler-rt-src                  20.1.8, 21.1.2 -> 21.1.2
[C.]  #11  cpio                             2.15 x3, 2.15.tar.bz2 x2 -> 2.15 x2, 2.15.tar.bz2
[C*]  #12  crystal                          1.10.1-1-darwin-universal.tar.gz, 1.16.3 -> 1.10.1-1-darwin-universal.tar.gz, 1.18.2
[C.]  #13  expand-response-params           <none> x5 -> <none> x4
[C.]  #14  gnu-install-dirs.patch           <none> x4 -> <none> x3
[C.]  #15  jq                               1.8.1 x2, 1.8.1.tar.gz x2 -> 1.8.1, 1.8.1.tar.gz
[C.]  #16  libbfd-plugin-api-header         <none> x3 -> <none> x2
[C.]  #17  libcxx                           19.1.2+apple-sdk-15.5 x5 -> 19.1.2+apple-sdk-15.5 x4
[C.]  #18  llvm                             18-compatibility.patch, 20.1.8, 21.1.2 x2 -> 18-compatibility.patch, 21.1.2 x2
[C.]  #19  llvm-src                         20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #20  llvm-tblgen                      20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #21  llvm-tblgen-src                  20.1.8, 21.1.2 x2 -> 21.1.2 x2
[C.]  #22  macOS-SDK                        11.3 x2, 14.4, 15.5 x3 -> 11.3 x2, 14.4, 15.5 x2
[C.]  #23  make-binary-wrapper-hook         <none> x4 -> <none> x3
[C.]  #24  onig                             6.9.10.tar.gz x2 -> 6.9.10.tar.gz
[C.]  #25  oniguruma                        6.9.10 x2 -> 6.9.10
[C.]  #26  pbzx                             1.0.2 x3 -> 1.0.2 x2
[C.]  #27  psutil                           7.1.0.tar.gz x2 -> 7.1.0.tar.gz
[C.]  #28  python3                          3.13.8 x2, 3.13.8-env x2 -> 3.13.8 x2, 3.13.8-env
[C.]  #29  python3.13-psutil                7.1.0 x2 -> 7.1.0
[C*]  #30  source                           <none> x85 -> <none> x83
[C*]  #31  stdenv-darwin                    <none> x5 -> <none> x3
Removed packages:
[R.]  #1  bd49bbaaafc98433a2cb4e95ce25b7a201baf5a5.patch  <none>
Closure size: 1239 -> 1201 (806 paths added, 844 paths removed, delta -38, disk usage -161.7KiB).
```

---------

Co-authored-by: Will Leinweber <will@bitfission.com>
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.

2 participants