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

Convert swift quotas from GB to GiB #162

Closed
knikolla opened this issue May 22, 2024 · 7 comments · Fixed by #168
Closed

Convert swift quotas from GB to GiB #162

knikolla opened this issue May 22, 2024 · 7 comments · Fixed by #168
Assignees

Comments

@knikolla
Copy link
Collaborator

knikolla commented May 22, 2024

  • Convert GB_IN_BYTES from 10**9 = 1,000,000,000 to 2**30 = 1,073,741,824.
  • Either create a new command to convert the quotas per the new definition of GiB or update validate_allocations to set the new values on the allocations.

Related nerc-project/operations#587

@QuanMPhm
Copy link
Contributor

QuanMPhm commented May 28, 2024

I'll update validate_allocations to convert all existing Swift quotas to GiB

@QuanMPhm
Copy link
Contributor

@knikolla Do you want me to rename variables that reference GB appropriately? So QUOTA_OBJECT_GB and GB_IN_BYTES will be QUOTA_OBJECT_GiB and GiB_IN_BYTES. This may make a very messy diff?

@knikolla
Copy link
Collaborator Author

I'll update validate_allocations to convert all existing Swift quotas to GB

Don't do this as part of validate_allocations as that will introduce more complications. The reason why it would be more complicated like this, is because get_quota will round to the nearest GB, so we would have to break one abstraction layer to get the actual value.

Create a new one-off command that will be called once to do the conversion, calling set_quota for only swift with the new values for all active/expired allocations on OpenStack.

Do you want me to rename variables that reference GB appropriately? So QUOTA_OBJECT_GB and GB_IN_BYTES will be QUOTA_OBJECT_GiB and GiB_IN_BYTES. This may make a very messy diff?

Keep the underlying variable name the same, however introduce a new attribute name migration (similar to #163 ) that renames the attribute to a similar naming scheme.

@QuanMPhm
Copy link
Contributor

QuanMPhm commented Jun 3, 2024

@knikolla Sorry for the late response. I see. I'll make a one-time command convert_swift_quota_to_gib.py then. Do you think it would be worth it to do an "informal check" to see if a Swift quota is in Gb or Gib? By that I mean...

Right now, given the current code, I assume that all of our Swift quotas are in quantities that are divisible by 1000^2. After the conversion from Gb to Gib, we can still do checks in the future to see if any Swift quotas were (inadvertently or not) set in Gb or Gib by seeing if they're divisible by 1,000^2 or 1024^2. This would make the command not a one-time thing?

@joachimweyl
Copy link

@QuanMPhm can you link the PR here please.

@knikolla
Copy link
Collaborator Author

knikolla commented Jun 7, 2024

@knikolla Sorry for the late response. I see. I'll make a one-time command convert_swift_quota_to_gib.py then. Do you think it would be worth it to do an "informal check" to see if a Swift quota is in Gb or Gib? By that I mean...

Right now, given the current code, I assume that all of our Swift quotas are in quantities that are divisible by 1000^2. After the conversion from Gb to Gib, we can still do checks in the future to see if any Swift quotas were (inadvertently or not) set in Gb or Gib by seeing if they're divisible by 1,000^2 or 1024^2. This would make the command not a one-time thing?

I don't think those checks are necessary.

@QuanMPhm
Copy link
Contributor

@QuanMPhm can you link the PR here please.

I'm sorry. I'm encountering a problem with running VMs on my computer, and it's taking an absurd amount of time

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 a pull request may close this issue.

3 participants