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

tough: update to v0.10.0 #1190

Merged
merged 1 commit into from
Jan 25, 2021
Merged

tough: update to v0.10.0 #1190

merged 1 commit into from
Jan 25, 2021

Conversation

webern
Copy link
Contributor

@webern webern commented Oct 30, 2020

Issue number:

N/A

Description of changes:

This PR is a companion to awslabs/tough#256 which changes the interface for loading a tough Repository.

    tough: update to v0.10.0

    This version of tough changes the interface of the Repository struct
    and its load function. The usage sites have been updated to use the
    new interface.

    updog: The query parameter mechanism needed to be changed to
    accommodate the fact that Repository now owns a Transport instead of
    holding a reference. This is done by holding an Arc pointer to the
    query params both inside and outside of the custom Transport.

    pubsys: A custom Transport is no-longer necessary (its purpose was to
    support both http and file transport, which DefaultTransport now does).
    Additionally, the new TransportError gives pubsys the information it
    needs to know whether a repo already exists or not.

    update_metadata and migrator: no significant changes.

Testing done:

[x] cargo make works and unit tests work.
[x] cargo make repo works when creating a new repo.
[x] cargo make repo works when adding to an existing repo.
[x] did an upgrade/downgrade with migration
[x] updog integ tested, working
[x] migrator integ tested, working (created a fake migration, did upgrade/downgrade in Bottlerocket and it worked)
[x] inspected s3 bucket logs and observed update query params (from updog)

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@webern
Copy link
Contributor Author

webern commented Nov 3, 2020

Testing complete, updated in PR text.

Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

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

I haven't looked through everything, but wanted to get this note out.

sources/Cargo.lock Outdated Show resolved Hide resolved
tools/pubsys/Cargo.toml Outdated Show resolved Hide resolved
@tjkirch tjkirch mentioned this pull request Nov 5, 2020
@webern
Copy link
Contributor Author

webern commented Nov 21, 2020

webern force-pushed the webern:tough-0.10.0 branch from f53df08 to c1a1b39

rebase develop. this will not compile. ignore.

@webern
Copy link
Contributor Author

webern commented Nov 21, 2020

webern force-pushed the webern:tough-0.10.0 branch from c1a1b39 to 1537560

This probably compiles. Updates everything to use the RepositoryLoader. cargo gave me some gruff about the version of Ring and I needed to cargo update ring to make it happy.

Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

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

The simplification is so nice!

sources/api/migration/migrator/Cargo.toml Outdated Show resolved Hide resolved
sources/api/migration/migrator/src/main.rs Outdated Show resolved Hide resolved
sources/api/migration/migrator/src/main.rs Outdated Show resolved Hide resolved
sources/updater/updog/Cargo.toml Outdated Show resolved Hide resolved
sources/updater/updog/src/error.rs Outdated Show resolved Hide resolved
sources/updater/update_metadata/Cargo.toml Outdated Show resolved Hide resolved
tools/pubsys/Cargo.toml Outdated Show resolved Hide resolved
tools/pubsys/src/repo.rs Outdated Show resolved Hide resolved
tools/pubsys/src/repo.rs Outdated Show resolved Hide resolved
tools/pubsys/src/repo.rs Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Nov 24, 2020

webern force-pushed the webern:tough-0.10.0 branch from ab0fc1b to 7ea42c9
webern force-pushed the webern:tough-0.10.0 branch from 7ea42c9 to 9179da3

Update to the latest sha of the tough PR for re-testing.

@webern
Copy link
Contributor Author

webern commented Nov 24, 2020

Testing re-verified at 9179da3

@gregdek gregdek added the status/needs-triage Pending triage or re-evaluation label Jan 7, 2021
@tjkirch tjkirch removed the status/needs-triage Pending triage or re-evaluation label Jan 7, 2021
@webern
Copy link
Contributor Author

webern commented Jan 19, 2021

webern force-pushed the webern:tough-0.10.0 branch from 9179da3 to a1566eb 2 minutes ago

This push is a rebase. This push is in a broken state, but should help to isolate the changes that are due to rebasing from other changes that I will push.

@webern
Copy link
Contributor Author

webern commented Jan 20, 2021

webern force-pushed the webern:tough-0.10.0 branch from a1566eb to 53e60af now

  • Updates Cargo.tomls/locks to use the published versions of tough*
  • Fixes all of the PR comments

I reran all of the testing.

@webern webern marked this pull request as ready for review January 20, 2021 00:26
@webern webern requested review from tjkirch and etungsten January 20, 2021 00:27
Copy link
Contributor

@etungsten etungsten left a comment

Choose a reason for hiding this comment

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

Changes look good to me.
Can you do a few more additional tests?

  • cargo make check-repo-expirations: Example: cargo make -e PUBLISH_REPO="2020-07-07" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" check-repo-expirations
  • cargo make validate-repo: Example: cargo make -e PUBLISH_REPO="2020-07-07" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" validate-repo
  • cargo make refresh-repo: Example: cargo make -e PUBLISH_REPO="your-repo-with signing-key-defined-in-infra.toml" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" refresh-repo

@webern
Copy link
Contributor Author

webern commented Jan 22, 2021

  • cargo make check-repo-expirations: Example: cargo make -e PUBLISH_REPO="2020-07-07" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" check-repo-expirations

It worked!

00:00:25 [INFO] Looking for metadata expirations happening from now to 2021-01-25 00:00:25.419436 UTC
  • cargo make validate-repo: Example: cargo make -e PUBLISH_REPO="2020-07-07" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" validate-repo

It worked!

00:03:05 [INFO] Downloading target: bottlerocket-aws-k8s-1.18-x86_64-1.0.4-cef8dbd2-root.ext4.lz4
00:03:06 [INFO] Downloading target: bottlerocket-aws-k8s-1.18-x86_64-1.0.3-0c93e9a6-root.verity.lz4
00:03:06 [INFO] Downloading target: migrate_v0.3.2_admin-container-v0-5-0.lz4
00:03:06 [INFO] Downloading target: manifest.json
  • cargo make refresh-repo: Example: cargo make -e PUBLISH_REPO="your-repo-with signing-key-defined-in-infra.toml" -e BUILDSYS_VARIANT="aws-k8s-1.18" -e BUILDSYS_ARCH="x86_64" refresh-repo

It worked!

00:09:31 [INFO] Setting non-root metadata expiration times:
	snapshot:  2021-02-05 00:09:31.258455146 UTC
	targets:   2021-02-05 00:09:31.258455146 UTC
	timestamp: 2021-01-29 00:09:31.258455146 UTC
00:09:31 [INFO] Writing repo metadata to...

@webern
Copy link
Contributor Author

webern commented Jan 25, 2021

webern force-pushed the webern:tough-0.10.0 branch from 53e60af to aec7e9a

rebase

Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

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

I'm still really happy about this simplification!

sources/api/migration/migrator/src/main.rs Outdated Show resolved Hide resolved
This version of tough changes the interface of the Repository struct
and its load function. The usage sites have been updated to use the
new interface.

updog: The query parameter mechanism needed to be changed to
accommodate the fact that Repository now owns a Transport instead of
holding a reference. This is done by holding an Arc pointer to the
query params both inside and outside of the custom Transport.

pubsys: A custom Transport is no-longer necessary (its purpose was to
support both http and file transport, which DefaultTransport now does).
Additionally, the new TransportError gives pubsys the information it
needs to know whether a repo already exists or not.

update_metadata and migrator: no significant changes.
@webern
Copy link
Contributor Author

webern commented Jan 25, 2021

webern force-pushed the webern:tough-0.10.0 branch from aec7e9a to 2110613

Use with_context.

@webern webern merged commit 7ec18f5 into bottlerocket-os:develop Jan 25, 2021
@webern webern deleted the tough-0.10.0 branch January 25, 2021 22:54
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.

4 participants