Skip to content

Support migration.#1089

Merged
floitsch merged 15 commits into
mainfrom
floitsch/fleet-server.30.migrate
Jun 14, 2024
Merged

Support migration.#1089
floitsch merged 15 commits into
mainfrom
floitsch/fleet-server.30.migrate

Conversation

@floitsch
Copy link
Copy Markdown
Member

No description provided.

@floitsch floitsch requested a review from kasperl June 13, 2024 18:38
Copy link
Copy Markdown
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Awesome stuff!

Comment thread src/cli/cmds/fleet.toit Outdated
- Add a new broker to your configuration. Use 'config broker add ...'.
- Start the migration with 'migration start --broker=<broker>'.
- Upload a new pod, and roll it out to the fleet with 'fleet roll-out'.
- Check the status of the migration with the 'status' command.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Check the status of the migration with the 'status' command.
- Check the status of the migration with the 'migration status' command.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no specific migration status command. The normal status command is enough.
Changed it to "fleet's 'status' command".

Comment thread src/cli/cmds/fleet.toit Outdated
--examples=[
cli.Example """
Finish the migration.
All old brokers are removed, and devices can only b
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Incomplete sentence.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread src/cli/cmds/fleet.toit Outdated
with-devices-fleet parsed config cache ui: | fleet/FleetWithDevices |
new-broker := get-server-from-config config ui --name=broker-name
fleet.migration-start --broker-config=new-broker
ui.info "Started migration to broker $broker-name."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add information on how to check the status right here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread src/cli/cmds/fleet.toit Outdated

with-devices-fleet parsed config cache ui: | fleet/FleetWithDevices |
fleet.migration-finish brokers
ui.info "Finished migration."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add broker information to the output?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread src/cli/fleet.toit Outdated
broker-config := default-broker-config

broker-name := fleet-content.get "broker"
migrated-from-entry := fleet-content.get "migrated-from"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this should be more like 'migrating-from' since it isn't finished yet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread src/cli/fleet.toit Outdated

// We need to notify the migrated-from brokers.
fleet-file_.migrated-from.do: | server-name |
ui_.info "Rolling out on migrated-from broker $server-name."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

migrated-from sounds so low-level here. Maybe reword it?

Rolling out to $old broker (migration in progress).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like that.
done.

Comment thread src/cli/fleet.toit Outdated
// This also makes it possible to move forward and backward between two brokers.
detailed-devices = old-broker.get-devices --device-ids=device-ids
old-broker.roll-out --devices=detailed-devices.values --pods=pods --diff-bases=diff-bases
ui_.info "Successfully rolled out on migrated-from broker $server-name."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Successfully rolled out to $old broker (migration in progress).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread src/cli/cmds/fleet.toit Outdated
- Start the migration with 'migration start --broker=<broker>'.
- Upload a new pod, and roll it out to the fleet with 'fleet roll-out'.
- Check the status of the migration with the 'status' command.
- Finish the migration with 'migration finish', once all devices have migrated.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this should be stop? Finish seems to imply that we're done with it better than stop, but on the other hand, we don't really know if we're done. If finish checked the status and complained if it wasn't really finished (unless --force), then maybe finish would be better.

All in all, I think start/stop is likely the simpler pair and we still check that we don't stop an incomplete migration without a '--force' flag.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Copy link
Copy Markdown
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good!

Base automatically changed from floitsch/fleet-server.26.cache to main June 14, 2024 14:25
@floitsch floitsch enabled auto-merge (squash) June 14, 2024 14:31
@floitsch floitsch merged commit 365e182 into main Jun 14, 2024
@floitsch floitsch deleted the floitsch/fleet-server.30.migrate branch June 14, 2024 16:05
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