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

Add migration for changed containerd config template path #653

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Jan 15, 2020

We changed the path to the containerd config template file in #613 to support
image variants, and we need a migration to update existing installations.

Testing done:

0.2.0 path:

$ cat datastore-sample/current/live/configuration-files/containerd-config-toml/template-path; echo
"/usr/share/templates/containerd-config-toml"

Migrate up:

$ cargo run -- --log-level trace --datastore-path datastore-sample/current --migration-directories ./migration-binaries --migrate-to-version 0.2
...
19:58:04 [DEBUG] (1) migrator: Sorted migrations: ["migrate_v0.2_containerd-config-path"]
19:58:04 [ INFO] Copying datastore from /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.1_kZNHRvDkARjcHinw to work location /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.2_Dce4ixf0zQNvT6gb
19:58:04 [ INFO] Running migration command: "./migration-binaries/migrate_v0.2_containerd-config-path" "--forward" "--datastore-path" "/home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.2_Dce4ixf0zQNvT6gb"
19:58:04 [DEBUG] (1) migrator: Migration stdout: 
19:58:04 [DEBUG] (1) migrator: Migration stderr: 
19:58:04 [ INFO] Flipping /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.2 to point to v0.2_Dce4ixf0zQNvT6gb
19:58:04 [ INFO] Flipping /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0 to point to v0.2

0.2.1 path:

$ cat datastore-sample/current/live/configuration-files/containerd-config-toml/template-path; echo
"/usr/share/templates/containerd-config-toml_aws-k8s"

Migrate down:

$ cargo run -- --log-level trace --datastore-path datastore-sample/current --migration-directories ./migration-binaries --migrate-to-version 0.1
...
19:58:21 [DEBUG] (1) migrator: Sorted migrations: ["migrate_v0.2_containerd-config-path"]
19:58:21 [ INFO] Copying datastore from /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.2_Dce4ixf0zQNvT6gb to work location /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.1_aEOHCFfM25xykQ7J
19:58:21 [ INFO] Running migration command: "./migration-binaries/migrate_v0.2_containerd-config-path" "--backward" "--datastore-path" "/home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.1_aEOHCFfM25xykQ7J"
19:58:21 [DEBUG] (1) migrator: Migration stdout: 
19:58:21 [DEBUG] (1) migrator: Migration stderr: 
19:58:21 [ INFO] Flipping /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0.1 to point to v0.1_aEOHCFfM25xykQ7J
19:58:21 [ INFO] Flipping /home/ANT.AMAZON.COM/tjk/work/thar/workspaces/api/migration/migrator/datastore-sample/v0 to point to v0.1

Back to 0.2.0 path:

$ cat datastore-sample/current/live/configuration-files/containerd-config-toml/template-path; echo
"/usr/share/templates/containerd-config-toml"

We changed the path to the containerd config template file in #613 to support
image variants, and we need a migration to update existing installations.
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🏒

RELEASE.toml Show resolved Hide resolved
version = "0.2.0"
datastore_version = "0.1"
version = "0.2.1"
datastore_version = "0.2"

[[migrations]]
Copy link
Contributor

Choose a reason for hiding this comment

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

While not directly related to this PR (and perhaps deserving of its own issue), do we want this migrations section to contain only the migrations for the current release? Or all migrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had talked about it in a team meeting previously and decided it should only be for the current release, but I fully expect this file format to change quite a bit.

@tjkirch tjkirch merged commit 356222b into develop Jan 15, 2020
@tjkirch tjkirch deleted the ctrd-cfg-migration branch January 15, 2020 22:15
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