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

pubsys: minor cleanup #1066

Merged
merged 5 commits into from
Aug 24, 2020
Merged

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Aug 24, 2020

commit 5b684ea3be5b84cd1aeffda5e274a2d9ee6a2156
Author: Tom Kirchner <tjk@amazon.com>
Date:   Sun Aug 23 17:16:09 2020 -0700

    pubsys: wait for AMIs to be available before granting access

    Without a wait, if you use publish_ami right after registering/copying AMIs,
    describe images responses can include partial information that doesn't include
    snapshot IDs.
commit afe9526e7ee415ac169bcdf4a3e055d59a7ddf87
Author: Tom Kirchner <tjk@amazon.com>
Date:   Sun Aug 23 17:35:06 2020 -0700

    pubsys: print waiting message only if we're going to sleep

    If the AMI is found on the first attempt, the success message is enough.
commit 08b31055ab117d03a252287311dc95ce8b3d80e5
Author: Tom Kirchner <tjk@amazon.com>
Date:   Sun Aug 23 17:04:21 2020 -0700

    pubsys: increase log level inside AMI registration process

    Waiting for snapshots is the longest part of AMI registration and there wasn't
    much explanation of what was happening, so this bumps a couple debug messages
    up to info level.
commit 6f60d7a2267491f313fdbf8769b772d487558d76
Author: Tom Kirchner <tjk@amazon.com>
Date:   Sun Aug 23 16:57:37 2020 -0700

    pubsys: rename client variable to reduce confusion

    It's too easy to use "ec2_client" by accident when you need a regional client,
    when this is actually a client just for the base region.
commit 996385ce19454653f037f81e35983f9012924610
Author: Tom Kirchner <tjk@amazon.com>
Date:   Sun Aug 23 16:55:21 2020 -0700

    pubsys: fix region name in error message

A few small bug fixes and a performance improvement, now that the blockers are out of the way.

Testing done:

  • Ran an ami / ami-public / ami-private cycle successfully; before, if you ran ami-public immediately after ami you could get a failure based on partial describe-images responses not having snapshot IDs.
  • Ran an ami-public / ami-private cycle with AMIs that already existed and saw the waits finish immediately.
  • Saw the improved logging, for example:
00:48:25 [INFO] Registering 'bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-5b684ea3' in us-west-2
00:50:17 [INFO] Waiting for root and data snapshots to become available in us-west-2
00:50:26 [INFO] Making register image call in us-west-2
00:50:26 [INFO] Registered AMI 'bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-5b684ea3' in us-west-2: ami-12345

and:

00:56:07 [INFO] Waiting for AMIs to be available...
00:56:07 [INFO] Found ami-23456 available in us-west-1
...
00:56:11 [INFO] Updating snapshot permissions - making private

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.

@tjkirch tjkirch requested review from bcressey and zmrow August 24, 2020 01:04
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.

🖖

tools/pubsys/src/aws/publish_ami/mod.rs Show resolved Hide resolved
@tjkirch tjkirch changed the base branch from copy-permissions to develop August 24, 2020 23:38
It's too easy to use "ec2_client" by accident when you need a regional client,
when this is actually a client just for the base region.
Waiting for snapshots is the longest part of AMI registration and there wasn't
much explanation of what was happening, so this bumps a couple debug messages
up to info level.
If the AMI is found on the first attempt, the success message is enough.
Without a wait, if you use publish_ami right after registering/copying AMIs,
describe images responses can include partial information that doesn't include
snapshot IDs.
@tjkirch
Copy link
Contributor Author

tjkirch commented Aug 24, 2020

^ just a rebase on develop.

@tjkirch tjkirch merged commit 0ed47a0 into bottlerocket-os:develop Aug 24, 2020
@tjkirch tjkirch deleted the pubsys-cleanup branch August 24, 2020 23:47
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.

5 participants