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

Upload artifacts with public_read ACL to start with. #195

Merged
merged 2 commits into from
Nov 7, 2016

Conversation

rmmh
Copy link
Contributor

@rmmh rmmh commented Nov 4, 2016

This fixes kubernetes/test-infra#990 where a recursive acl change
immediately after an upload might miss objects, since GCS bucket listing
is eventually consistent.

@@ -480,23 +480,20 @@ release::gcs::copy_release_artifacts() {

# Copy the main set from staging to destination
logecho -n "- Copying release artifacts to $gcs_destination: "
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's pull in some of the lost messaging
"Copying public release artifacts..."


logecho -n "- Listing final contents to log file: "
logrun -s $GSUTIL ls -lhr "$gcs_destination" || return 1

# Push to mirror if set
if [[ -n "$bucket_mirror" && "$bucket" != "$bucket_mirror" ]]; then
logecho -n "- Mirroring build to $gcs_mirror: "
logrun -s $GSUTIL -q -m rsync -d -r "$gcs_destination" "$gcs_mirror" \
logrun -s $GSUTIL -q -m rsync -a public_read -d -r "$gcs_destination" "$gcs_mirror" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Let's pull in some of the lost messaging
"Mirroring public build..."

"$gcs_destination" || return 1
# This small sleep gives the eventually consistent GCS bucket listing a chance
# to stabilize.
sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

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

Eww. There are no consistency checks available in gsutil? I know the answer is probably no. :)

Copy link
Member

Choose a reason for hiding this comment

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

maybe gsutil ls the gcs destination and make sure the number of artifacts matches the number uploaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's pretty gross. Would it would be better to re-upload to the gcs_mirror instead of trying to copy between gcs_destination and gcs_mirror?

Copy link
Member

@ixdy ixdy Nov 4, 2016

Choose a reason for hiding this comment

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

I'm not sure anything is even still using the --bucket-mirror codepath.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great! Let's delete code instead!

Copy link
Contributor Author

@rmmh rmmh Nov 4, 2016

Choose a reason for hiding this comment

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

Neat, I didn't find any mentions of "Mirroring build" in PR or CI jobs.

Should I leave the sleep in, accept that the "listing final contents" step might lie, or remove it?

Copy link
Member

Choose a reason for hiding this comment

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

maybe do gsutil cp -L upload.log ... && cat upload.log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's pretty different from what gsutil ls -lhr outputs. I'll just leave the sleep in with a note that it's just an attempt.

This fixes kubernetes/test-infra#990 where a recursive acl change
immediately after an upload might miss objects, since GCS bucket listing
is eventually consistent.
@david-mcmahon
Copy link
Contributor

Thanks for plumbing through all of this. More red (deleted) than green (added). Woot!
Still reviewing...

Copy link
Member

@ixdy ixdy left a comment

Choose a reason for hiding this comment

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

LGTM besides one minor suggestion

@@ -139,7 +133,7 @@ if ! common::set_cloud_binaries; then
common::exit 1
fi

for bucket in $RELEASE_BUCKET $RELEASE_BUCKET_MIRROR; do
for bucket in $RELEASE_BUCKET; do
Copy link
Member

Choose a reason for hiding this comment

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

just kill the loop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that was really my only one too.

@rmmh
Copy link
Contributor Author

rmmh commented Nov 7, 2016

Removed the last unnecessary for-loop.

@rmmh rmmh merged commit 3d198a9 into kubernetes:master Nov 7, 2016
logecho -n "- Copying release artifacts to $gcs_destination: "
logrun -s $GSUTIL -qm cp -r $gcs_stage/* $gcs_destination/ || return 1
logecho -n "- Copying public release artifacts to $gcs_destination: "
logrun -s $GSUTIL -qm cp -a public_read -r $gcs_stage/* $gcs_destination/ || return 1
Copy link

Choose a reason for hiding this comment

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

s/public_read/public-read

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in #199.

@zmerlynn
Copy link
Member

This PR broke the background release copying because it explicitly set an ACL, which avoided the defacl on the release bucket.

# to stabilize before the diagnostic listing. There's no way to directly
# query for consistency, but it's OK if something is dropped from the
# debugging output.
sleep 5

Copy link
Member

Choose a reason for hiding this comment

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

I think we should just revert this PR, then change this not to bother with the all:R change. This should be relying on the defacl on the bucket and nothing else.

Copy link
Member

Choose a reason for hiding this comment

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

it'd probably be worth adding a comment explicitly noting that, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds like a better solution-- I didn't know about defacl.

Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry I didn't think about it when this PR went by. :/

marpaia pushed a commit to marpaia/release that referenced this pull request Feb 21, 2019
Add release theme: A Long-Expected Release
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.

Permanent build failure: Unpacking kubernetes release ... gzip: stdin: not in gzip format
6 participants