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

Restart rework #1457

Merged
merged 31 commits into from Nov 15, 2022
Merged

Restart rework #1457

merged 31 commits into from Nov 15, 2022

Conversation

davissp14
Copy link
Contributor

@davissp14 davissp14 commented Nov 14, 2022

Notable changes:

  • fly apps restart now supports Machines.

  • Machine orchestration primitives have been abstracted out into a higher level machines package. This will allow us to easily re-use them across command packages.

https://github.com/superfly/flyctl/tree/fly-restart-rework-2/internal/machine

fly restart
This command is being softly removed. A user will receive an error indicating that they should use fly apps restart instead.

fly apps restart
This is what almost all apps should be using.

Unfortunately, I was not able to include the PG restart process due to a cyclic dependency issue. The postgres package will need to be restructured a bit before we can make this work. PG apps will receive an error when hitting this command indicating they should use fly pg restart instead. Not great, but progress.

fly pg restart
Has been reworked to use the new machine orchestration primitives.

fly machine restart
Has been reworked to use the new machine orchestration primitives.

@davissp14 davissp14 changed the title Fly restart rework Restart rework Nov 14, 2022
Copy link
Member

@jsierles jsierles left a comment

Choose a reason for hiding this comment

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

Nice to see the machines stuff being split out! Just left some comments.

)

func newRestart() *cobra.Command {
const (
long = `The APPS RESTART command will restart all running vms.
`
long = `The APPS RESTART command will perform a rolling restart against all running VM's`
Copy link
Member

Choose a reason for hiding this comment

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

Should just be "VMs" here

NewOpen(),
NewReleases(),
)

return apps
}

// BuildContext is a helper that builds out commonly required context requirements
func BuildContext(ctx context.Context, app *api.AppCompact) (context.Context, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this mainly to get the flaps client into context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both the flaps client and dialer.

@@ -0,0 +1,52 @@
package machine
Copy link
Member

Choose a reason for hiding this comment

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

Is it a problem that we have the machines package split across internal/command/machine and internal/machine?

Copy link
Contributor Author

@davissp14 davissp14 Nov 15, 2022

Choose a reason for hiding this comment

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

We can rename the package if it's confusing, but it's not really an issue afaict. If both packages need to be used at the same time we will just need to define an alias during import.

Copy link
Contributor

@shortdiv shortdiv left a comment

Choose a reason for hiding this comment

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

Someday we can get rid of that platform version if conditional

@davissp14 davissp14 merged commit 71ba74b into master Nov 15, 2022
@davissp14 davissp14 deleted the fly-restart-rework-2 branch November 15, 2022 17:46
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.

None yet

3 participants