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

Clarify what the requestor_pays flag does #3431

Merged
merged 19 commits into from
Feb 28, 2024

Conversation

yuvipanda
Copy link
Member

@yuvipanda yuvipanda commented Nov 16, 2023

@GeorgianaElena GeorgianaElena marked this pull request as ready for review February 14, 2024 14:09
@GeorgianaElena GeorgianaElena requested a review from a team as a code owner February 14, 2024 14:09
@GeorgianaElena
Copy link
Member

I just pushed a small commit updating the docs as well and believe it might be ready for review. Did you want to do add anything else to this @yuvipanda ?

Copy link
Member Author

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

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

One documentation change, but otherwise this can be merged!

docs/topic/features.md Outdated Show resolved Hide resolved
Comment on lines 132 to 133
"public_access": true,
"requester_pays": true
Copy link
Member

Choose a reason for hiding this comment

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

@yuvipanda, do you think requester_pays has sense outside of a public access? Should these two flags be documented togheter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, great question @GeorgianaElena.

Right now, we don't actually have a terraform variable called requstor_pays (see list for gcp and aws for what we do have). So we currently don't have a way to mark a bucket as requestor pays via our terraform.

It's not super hard to implement (pass through to gcp config or this aws resource), so we should implement it if / when a community asks to make one of their buckets into requestor_pays.

It may also be helpful to rename public_access to public_anonymous_access - basically, it currently means that anyone can access that bucket, without needing to provide any authentication at all. But since requestor_pays requires that the entity requesting this be part of an AWS or GCP project, it by definition is authenticated - so GCP or AWS knows who to charge! This 'authentication' is what our hubs provide when we turn on the allow_access_to_requestor_pays_buckets flag.

So public_access (or public_anonymous_access) is actually mutually exclusive with requestor_pays. The first is fully unauthenticated, while the second requires authentication.

I hope this is helpful!

Copy link
Member

Choose a reason for hiding this comment

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

Extremely helpful @yuvipanda! Thank you very much for taking the time to clarify this <3

@GeorgianaElena GeorgianaElena requested a review from a team February 15, 2024 11:57
docs/topic/features.md Outdated Show resolved Hide resolved
Comment on lines 111 to 121
Some hubs want to expose a particular bucket to the broad internet
but not be billed for the charges associated with making and executing the
requests on this bucket.

By enabling the [Requester Pays flag](https://cloud.google.com/storage/docs/using-requester-pays#using),
the requesters are required to include a billing project in their requests,
which will mean that the billing will happen on the requester's project.

Enabling Requester Pays is useful, for example, if the communities have a lot
of data that they want to make available to others, but don't want to be
charged for their access to that data.
Copy link
Member

Choose a reason for hiding this comment

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

... but this section sounds like the host hub is providing access to buckets inside their hub. Which is it? Can it be both? In what scenario is the bucket inside and what scenario is the bucket outside?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it can be both. Requestor Pays is a feature that a bucket can have.

  • If buckets outside the project have this flag, then we need to:
    • set hub_cloud_permissions.allow_access_to_requestor_pays_buckets in the terraform config of a cluster (this config is simply called requestor_pays without this PR, which was the source of confusion for me).
    • This is to allow them to be charged on their project for access of such outside buckets
  • But buckets that we set for communities, inside their projects can also have this feature enabled on them, which means that other people outside will be charged for their usage.
    • This can be enabled by setting user_buckets.<bucket_name>.requester_pays to true in the terraform config of the cluster.
    • I don't think we have any buckets like this yet, but was recently requested by leap in https://2i2c.freshdesk.com/a/tickets/1316

Copy link
Member

Choose a reason for hiding this comment

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

Does the above has more sense @sgibson91? I will update the language in the docs as well to make the split and differences more clear.

Copy link
Member

@sgibson91 sgibson91 Feb 20, 2024

Choose a reason for hiding this comment

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

Yeah, thank you - though I'm wondering if it should be hub_cloud_permissions.allow_access_to_external_requester_pays_buckets to be crystal clear? Though I realise it's getting kinda long.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just want to say that https://github.com/2i2c-org/infrastructure/pull/3431/files#r1495651158 is an accurate description of the situation! Only difference is that right now,

This can be enabled by setting user_buckets.<bucket_name>.requester_pays to true in the terraform config of the cluster.

is not true because we don't have that implemented.

@GeorgianaElena GeorgianaElena self-assigned this Feb 20, 2024
Copy link
Member Author

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

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

Let's simplify this PR to:

I hope this helps! I can't 'request changes' because this is my own PR, but thanks for picking this up, @GeorgianaElena

terraform/aws/variables.tf Outdated Show resolved Hide resolved
docs/howto/features/buckets.md Outdated Show resolved Hide resolved
Comment on lines 111 to 121
Some hubs want to expose a particular bucket to the broad internet
but not be billed for the charges associated with making and executing the
requests on this bucket.

By enabling the [Requester Pays flag](https://cloud.google.com/storage/docs/using-requester-pays#using),
the requesters are required to include a billing project in their requests,
which will mean that the billing will happen on the requester's project.

Enabling Requester Pays is useful, for example, if the communities have a lot
of data that they want to make available to others, but don't want to be
charged for their access to that data.
Copy link
Member Author

Choose a reason for hiding this comment

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

I just want to say that https://github.com/2i2c-org/infrastructure/pull/3431/files#r1495651158 is an accurate description of the situation! Only difference is that right now,

This can be enabled by setting user_buckets.<bucket_name>.requester_pays to true in the terraform config of the cluster.

is not true because we don't have that implemented.

@GeorgianaElena
Copy link
Member

I've updated the PR per instructions and the terraform config of the clusters. I've also opened the follow-up issue, so this should be ready for review again 🚀

Copy link
Member

@sgibson91 sgibson91 left a comment

Choose a reason for hiding this comment

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

LGTM!

@GeorgianaElena
Copy link
Member

Yuhuuu! Thank you @sgibson91!

@GeorgianaElena
Copy link
Member

And thank you @yuvipanda for shining light over this confusing topic 🎉

@GeorgianaElena GeorgianaElena merged commit 31796fa into 2i2c-org:master Feb 28, 2024
3 checks passed
@yuvipanda
Copy link
Member Author

This is great work @GeorgianaElena!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

3 participants